Refactor input arch (#1982)

This commit is contained in:
Charles Bochet
2023-10-12 17:41:50 +02:00
committed by GitHub
parent 09fd5b6454
commit 6b990c8501
47 changed files with 312 additions and 523 deletions

View File

@ -1,13 +1,13 @@
import { useRecoilValue } from 'recoil';
import { currentUserState } from '@/auth/states/currentUserState';
import { TextInputSettings } from '@/ui/input/text/components/TextInputSettings';
import { TextInput } from '@/ui/input/components/TextInput';
export const EmailField = () => {
const currentUser = useRecoilValue(currentUserState);
return (
<TextInputSettings
<TextInput
value={currentUser?.email}
disabled
fullWidth

View File

@ -5,7 +5,7 @@ import debounce from 'lodash.debounce';
import { useRecoilValue } from 'recoil';
import { currentUserState } from '@/auth/states/currentUserState';
import { TextInputSettings } from '@/ui/input/text/components/TextInputSettings';
import { TextInput } from '@/ui/input/components/TextInput';
import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser';
import { useUpdateUserMutation } from '~/generated/graphql';
import { logError } from '~/utils/logError';
@ -87,14 +87,14 @@ export const NameFields = ({
return (
<StyledComboInputContainer>
<TextInputSettings
<TextInput
label="First Name"
value={firstName}
onChange={setFirstName}
placeholder="Tim"
fullWidth
/>
<TextInputSettings
<TextInput
label="Last Name"
value={lastName}
onChange={setLastName}

View File

@ -3,7 +3,7 @@ import { getOperationName } from '@apollo/client/utilities';
import { useRecoilState } from 'recoil';
import { currentUserState } from '@/auth/states/currentUserState';
import { ImageInput } from '@/ui/input/image/components/ImageInput';
import { ImageInput } from '@/ui/input/components/ImageInput';
import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser';
import { getImageAbsoluteURIOrBase64 } from '@/users/utils/getProfilePictureAbsoluteURI';
import {

View File

@ -5,7 +5,7 @@ import debounce from 'lodash.debounce';
import { useRecoilState } from 'recoil';
import { currentUserState } from '@/auth/states/currentUserState';
import { TextInputSettings } from '@/ui/input/text/components/TextInputSettings';
import { TextInput } from '@/ui/input/components/TextInput';
import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser';
import { useUpdateWorkspaceMutation } from '~/generated/graphql';
import { logError } from '~/utils/logError';
@ -72,7 +72,7 @@ export const NameField = ({
return (
<StyledComboInputContainer>
<TextInputSettings
<TextInput
label="Name"
value={displayName}
onChange={setDisplayName}

View File

@ -2,7 +2,7 @@ import { getOperationName } from '@apollo/client/utilities';
import { useRecoilState } from 'recoil';
import { currentUserState } from '@/auth/states/currentUserState';
import { ImageInput } from '@/ui/input/image/components/ImageInput';
import { ImageInput } from '@/ui/input/components/ImageInput';
import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser';
import { getImageAbsoluteURIOrBase64 } from '@/users/utils/getProfilePictureAbsoluteURI';
import {