diff --git a/src/frontend/src/components/GoogleAuth/index.tsx b/src/frontend/src/components/GoogleAuth/index.tsx index dc950450..1763a886 100644 --- a/src/frontend/src/components/GoogleAuth/index.tsx +++ b/src/frontend/src/components/GoogleAuth/index.tsx @@ -3,15 +3,7 @@ import { useEffect, useState } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; import { Flex } from '@Components/common/Layouts'; import { toast } from 'react-toastify'; - -export interface UserProfileDetailsType { - id: string; - email: string; - img_url: string; - has_user_profile: boolean; -} - -export type IUserProfileDetailsType = UserProfileDetailsType | null; +import { UserProfileDetailsType } from './types'; const { BASE_URL } = process.env; diff --git a/src/frontend/src/components/GoogleAuth/types/index.ts b/src/frontend/src/components/GoogleAuth/types/index.ts new file mode 100644 index 00000000..ef71bddc --- /dev/null +++ b/src/frontend/src/components/GoogleAuth/types/index.ts @@ -0,0 +1,8 @@ +export interface UserProfileDetailsType { + id: string; + email: string; + img_url: string; + has_user_profile: boolean; +} + +export type IUserProfileDetailsType = UserProfileDetailsType | null; diff --git a/src/frontend/src/components/UserProfile/FormContents/BasicDetails/index.tsx b/src/frontend/src/components/UserProfile/FormContents/BasicDetails/index.tsx index f0275a7e..6679e457 100644 --- a/src/frontend/src/components/UserProfile/FormContents/BasicDetails/index.tsx +++ b/src/frontend/src/components/UserProfile/FormContents/BasicDetails/index.tsx @@ -1,20 +1,10 @@ import { Flex, FlexColumn } from '@Components/common/Layouts'; -import { - FormControl, - FormGroup, - Input, - Label, - Select, -} from '@Components/common/FormUI'; -import { UserProfileDetailsType } from '@Components/GoogleAuth'; -import { useForm } from 'react-hook-form'; +import { FormControl, Input, Label } from '@Components/common/FormUI'; import ErrorMessage from '@Components/common/ErrorMessage'; export default function BasicDetails({ formProps }: { formProps: any }) { const { register } = formProps; - console.log(formProps.formState.errors, 'formProps.formState.errors'); - // const userProfile: UserProfileDetailsType = // localStorage.getItem('userprofile'); return ( diff --git a/src/frontend/src/services/common.ts b/src/frontend/src/services/common.ts index 018a2336..c82bb142 100644 --- a/src/frontend/src/services/common.ts +++ b/src/frontend/src/services/common.ts @@ -1,4 +1,4 @@ -import { UserProfileDetailsType } from '@Components/GoogleAuth'; +import { UserProfileDetailsType } from '@Components/GoogleAuth/types'; import { api } from '.'; export const signInUser = (data: any) => api.post('/users/login/', data); diff --git a/src/frontend/src/utils/sagaUtils.ts b/src/frontend/src/utils/sagaUtils.ts index 87c3a173..e6843d4b 100644 --- a/src/frontend/src/utils/sagaUtils.ts +++ b/src/frontend/src/utils/sagaUtils.ts @@ -30,4 +30,4 @@ export function withLoader(func: Function) { }; } -export const nothing = ''; \ No newline at end of file +export const nothing = ''; diff --git a/src/frontend/src/views/UserProfile/index.tsx b/src/frontend/src/views/UserProfile/index.tsx index b4097808..3598ab33 100644 --- a/src/frontend/src/views/UserProfile/index.tsx +++ b/src/frontend/src/views/UserProfile/index.tsx @@ -11,7 +11,7 @@ import { } from '@Components/UserProfile/FormContents'; import { useMutation } from '@tanstack/react-query'; import { postUserProfile } from '@Services/common'; -import { IUserProfileDetailsType } from '@Components/GoogleAuth'; +import { IUserProfileDetailsType } from '@Components/GoogleAuth/types'; import Tab from './UserProfileTabs'; const getActiveFormContent = (activeTab: number, formProps: any) => {