mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
feat: Uploading company logo
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// @ts-nocheck
|
||||
import { useFormikContext } from 'formik';
|
||||
import { FFormGroup } from '@/components';
|
||||
import { CompanyLogoUpload } from './CompanyLogoUpload';
|
||||
|
||||
export function BrandingCompanyLogoUploadField() {
|
||||
const { setFieldValue, values } = useFormikContext();
|
||||
|
||||
return (
|
||||
<FFormGroup name={'companyLogo'} label={''} fastField>
|
||||
<CompanyLogoUpload
|
||||
initialPreview={values.companyLogoUri}
|
||||
onChange={(file) => {
|
||||
const imageUrl = file ? URL.createObjectURL(file) : '';
|
||||
|
||||
setFieldValue('_companyLogoFile', file);
|
||||
setFieldValue('companyLogoUri', imageUrl);
|
||||
}}
|
||||
/>
|
||||
</FFormGroup>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user