Skip to content

Commit c581bb6

Browse files
committed
refactor: remove unused initialValues logic from EditProfileForm
1 parent 977566b commit c581bb6

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

web-marketplace/src/components/organisms/EditProfileForm/EditProfileForm.constants.tsx

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,6 @@ import UserIcon from 'web-components/src/components/icons/UserIcon';
77
import { AccountType } from 'generated/graphql';
88
import { TranslatorType } from 'lib/i18n/i18n.types';
99

10-
import {
11-
DEFAULT_NAME,
12-
DEFAULT_PROFILE_BG,
13-
DEFAULT_PROFILE_TYPE,
14-
DEFAULT_PROFILE_USER_AVATAR,
15-
} from 'pages/ProfileEdit/ProfileEdit.constants';
16-
17-
import { EditProfileFormSchemaType } from './EditProfileForm.schema';
18-
19-
export const getEditProfileFormInitialValues = (
20-
_: TranslatorType,
21-
): EditProfileFormSchemaType => ({
22-
profileType: DEFAULT_PROFILE_TYPE,
23-
name: _(DEFAULT_NAME),
24-
profileImage: DEFAULT_PROFILE_USER_AVATAR,
25-
backgroundImage: DEFAULT_PROFILE_BG,
26-
description: '',
27-
twitterLink: '',
28-
websiteLink: '',
29-
});
30-
3110
export const getRadioCardItems = (_: TranslatorType): RadioCardItem[] => [
3211
{
3312
id: 'individual',

web-marketplace/src/components/organisms/EditProfileForm/EditProfileForm.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import Form from 'components/molecules/Form/Form';
3131
import { useZodForm } from 'components/molecules/Form/hook/useZodForm';
3232

3333
import {
34-
getEditProfileFormInitialValues,
3534
getRadioCardItems,
3635
LINKS_LABEL,
3736
PROFILE_AVATAR_FILE_NAME,
@@ -58,14 +57,7 @@ export interface EditProfileFormProps {
5857
onUpload?: (imageFile: File) => Promise<{ url: string }>;
5958
}
6059
const EditProfileForm: React.FC<React.PropsWithChildren<EditProfileFormProps>> =
61-
({
62-
children,
63-
initialValues = getEditProfileFormInitialValues,
64-
isDirtyRef,
65-
onSubmit,
66-
onSuccess,
67-
onUpload,
68-
}) => {
60+
({ children, initialValues, isDirtyRef, onSubmit, onSuccess, onUpload }) => {
6961
const { _ } = useLingui();
7062
const form = useZodForm({
7163
schema: editProfileFormSchema,

0 commit comments

Comments
 (0)