⬆️ Upgrade dependencies

Closes #198, closes #171
This commit is contained in:
Baptiste Arnaud
2023-01-02 10:33:35 +01:00
parent b9ed50b016
commit ec7481d002
22 changed files with 992 additions and 942 deletions

View File

@@ -20,7 +20,6 @@ const userContext = createContext<{
isLoading: boolean
isSaving: boolean
hasUnsavedChanges: boolean
isOAuthProvider: boolean
currentWorkspaceId?: string
updateUser: (newUser: Partial<User>) => void
saveUser: (newUser?: Partial<User>) => Promise<void>
@@ -36,10 +35,6 @@ export const UserProvider = ({ children }: { children: ReactNode }) => {
const [currentWorkspaceId, setCurrentWorkspaceId] = useState<string>()
const [isSaving, setIsSaving] = useState(false)
const isOAuthProvider = useMemo(
() => (session?.providerType as boolean | undefined) ?? false,
[session?.providerType]
)
const hasUnsavedChanges = useMemo(
() => !dequal(session?.user, user),
@@ -97,7 +92,6 @@ export const UserProvider = ({ children }: { children: ReactNode }) => {
isSaving,
isLoading: status === 'loading',
hasUnsavedChanges,
isOAuthProvider,
currentWorkspaceId,
updateUser,
saveUser,

View File

@@ -18,14 +18,7 @@ import { UploadButton } from '@/components/ImageUploadContent/UploadButton'
import { useUser } from '@/features/account'
export const MyAccountForm = () => {
const {
user,
updateUser,
saveUser,
hasUnsavedChanges,
isSaving,
isOAuthProvider,
} = useUser()
const { user, updateUser, saveUser, hasUnsavedChanges, isSaving } = useUser()
const handleFileUploaded = async (url: string) => {
updateUser({ image: url })
@@ -74,12 +67,7 @@ export const MyAccountForm = () => {
hasArrow
>
<FormControl>
<FormLabel
htmlFor="email"
color={isOAuthProvider ? 'gray.500' : 'current'}
>
Email address
</FormLabel>
<FormLabel htmlFor="email">Email address</FormLabel>
<Input
id="email"
type="email"