From f63f48882a9869c0a7d67db4ef30af8f02b39e01 Mon Sep 17 00:00:00 2001 From: Antoine Moreaux Date: Thu, 14 Nov 2024 18:18:38 +0100 Subject: [PATCH] feat(auth): Consolidate HorizontalSeparator imports Consolidate all HorizontalSeparator imports to 'twenty-ui' instead of local paths. This change simplifies module dependencies and ensures consistency across the sign-in and sign-up components. --- .../components/SignInUpGlobalScopeForm.tsx | 13 ++++++++++--- .../SignInUpSSOIdentityProviderSelection.tsx | 3 +-- .../components/SignInUpWithCredentials.tsx | 2 +- .../sign-in-up/components/SignInUpWithGoogle.tsx | 3 +-- .../sign-in-up/components/SignInUpWithMicrosoft.tsx | 3 +-- .../auth/sign-in-up/components/SignInUpWithSSO.tsx | 3 +-- .../components/SignInUpWorkspaceScopeForm.tsx | 3 +-- .../components/SignInUpWorkspaceSelection.tsx | 3 +-- .../auth/sign-in-up/hooks/useSignInUpForm.ts | 2 +- 9 files changed, 18 insertions(+), 17 deletions(-) diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpGlobalScopeForm.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpGlobalScopeForm.tsx index 2aac15db2c6c..b035e158d941 100644 --- a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpGlobalScopeForm.tsx +++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpGlobalScopeForm.tsx @@ -1,6 +1,11 @@ import styled from '@emotion/styled'; -import { IconGoogle, IconMicrosoft, Loader, MainButton } from 'twenty-ui'; -import { HorizontalSeparator } from '@/auth/sign-in-up/components/HorizontalSeparator'; +import { + IconGoogle, + IconMicrosoft, + Loader, + MainButton, + HorizontalSeparator, +} from 'twenty-ui'; import { useTheme } from '@emotion/react'; import { useSignInWithGoogle } from '@/auth/sign-in-up/hooks/useSignInWithGoogle'; import { useSignInWithMicrosoft } from '@/auth/sign-in-up/hooks/useSignInWithMicrosoft'; @@ -180,7 +185,9 @@ export const SignInUpGlobalScopeForm = () => { )} (form.formState.isSubmitting ? : null)} diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpSSOIdentityProviderSelection.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpSSOIdentityProviderSelection.tsx index 1e0810ff4867..10422b829347 100644 --- a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpSSOIdentityProviderSelection.tsx +++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpSSOIdentityProviderSelection.tsx @@ -1,11 +1,10 @@ /* @license Enterprise */ -import { HorizontalSeparator } from '@/auth/sign-in-up/components/HorizontalSeparator'; import { useSSO } from '@/auth/sign-in-up/hooks/useSSO'; import { guessSSOIdentityProviderIconByUrl } from '@/settings/security/utils/guessSSOIdentityProviderIconByUrl'; import styled from '@emotion/styled'; import { useRecoilValue } from 'recoil'; -import { MainButton } from 'twenty-ui'; +import { MainButton, HorizontalSeparator } from 'twenty-ui'; import { isDefined } from '~/utils/isDefined'; import { authProvidersState } from '@/client-config/states/authProvidersState'; diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWithCredentials.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWithCredentials.tsx index c373ec0f66cb..c535294c4db1 100644 --- a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWithCredentials.tsx +++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWithCredentials.tsx @@ -13,7 +13,7 @@ import { import { useRecoilValue } from 'recoil'; import styled from '@emotion/styled'; import { SignInUpPasswordField } from '@/auth/sign-in-up/components/SignInUpPasswordField'; -import { useState, useMemo, useEffect } from 'react'; +import { useState, useMemo } from 'react'; import { captchaProviderState } from '@/client-config/states/captchaProviderState'; import { isRequestingCaptchaTokenState } from '@/captcha/states/isRequestingCaptchaTokenState'; import { FormProvider } from 'react-hook-form'; diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWithGoogle.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWithGoogle.tsx index c7be6d6c8e92..ad98752504b7 100644 --- a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWithGoogle.tsx +++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWithGoogle.tsx @@ -1,9 +1,8 @@ -import { IconGoogle, MainButton } from 'twenty-ui'; +import { IconGoogle, MainButton, HorizontalSeparator } from 'twenty-ui'; import { SignInUpStep, signInUpStepState, } from '@/auth/states/signInUpStepState'; -import { HorizontalSeparator } from '@/auth/sign-in-up/components/HorizontalSeparator'; import { useTheme } from '@emotion/react'; import { useRecoilValue } from 'recoil'; import { useSignInWithGoogle } from '@/auth/sign-in-up/hooks/useSignInWithGoogle'; diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWithMicrosoft.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWithMicrosoft.tsx index 608c659db116..652336b0d644 100644 --- a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWithMicrosoft.tsx +++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWithMicrosoft.tsx @@ -1,10 +1,9 @@ -import { IconMicrosoft, MainButton } from 'twenty-ui'; +import { IconMicrosoft, MainButton, HorizontalSeparator } from 'twenty-ui'; import { SignInUpStep, signInUpStepState, } from '@/auth/states/signInUpStepState'; import { useTheme } from '@emotion/react'; -import { HorizontalSeparator } from '@/auth/sign-in-up/components/HorizontalSeparator'; import { useSignInWithMicrosoft } from '@/auth/sign-in-up/hooks/useSignInWithMicrosoft'; import { useRecoilValue } from 'recoil'; diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWithSSO.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWithSSO.tsx index 485e55b52708..2314a6414bae 100644 --- a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWithSSO.tsx +++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWithSSO.tsx @@ -1,9 +1,8 @@ -import { IconLock, MainButton } from 'twenty-ui'; +import { IconLock, MainButton, HorizontalSeparator } from 'twenty-ui'; import { SignInUpStep, signInUpStepState, } from '@/auth/states/signInUpStepState'; -import { HorizontalSeparator } from '@/auth/sign-in-up/components/HorizontalSeparator'; import { useTheme } from '@emotion/react'; import { useRecoilValue, useSetRecoilState } from 'recoil'; import { useSSO } from '@/auth/sign-in-up/hooks/useSSO'; diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWorkspaceScopeForm.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWorkspaceScopeForm.tsx index 0dee7ec79dea..e156c56c626b 100644 --- a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWorkspaceScopeForm.tsx +++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWorkspaceScopeForm.tsx @@ -1,4 +1,3 @@ -import { HorizontalSeparator } from '@/auth/sign-in-up/components/HorizontalSeparator'; import { useHandleResetPassword } from '@/auth/sign-in-up/hooks/useHandleResetPassword'; import { useSignInUp } from '@/auth/sign-in-up/hooks/useSignInUp'; import { useSignInUpForm } from '@/auth/sign-in-up/hooks/useSignInUpForm'; @@ -7,7 +6,7 @@ import { authProvidersState } from '@/client-config/states/authProvidersState'; import styled from '@emotion/styled'; import { useCallback } from 'react'; import { useRecoilState } from 'recoil'; -import { ActionLink } from 'twenty-ui'; +import { ActionLink, HorizontalSeparator } from 'twenty-ui'; import { SignInUpWithGoogle } from '@/auth/sign-in-up/components/SignInUpWithGoogle'; import { SignInUpWithMicrosoft } from '@/auth/sign-in-up/components/SignInUpWithMicrosoft'; import { SignInUpWithSSO } from '@/auth/sign-in-up/components/SignInUpWithSSO'; diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWorkspaceSelection.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWorkspaceSelection.tsx index 322b5e95a262..e4e5ec057878 100644 --- a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWorkspaceSelection.tsx +++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWorkspaceSelection.tsx @@ -1,10 +1,9 @@ import styled from '@emotion/styled'; import { useRecoilValue } from 'recoil'; -import { H2Title, MainButton } from 'twenty-ui'; +import { H2Title, MainButton, HorizontalSeparator } from 'twenty-ui'; import { availableWorkspacesForAuthState } from '@/auth/states/availableWorkspacesForAuthState'; import { DEFAULT_WORKSPACE_LOGO } from '@/ui/navigation/navigation-drawer/constants/DefaultWorkspaceLogo'; import { redirectToWorkspace } from '~/utils/workspace-url.helper'; -import { HorizontalSeparator } from '@/auth/sign-in-up/components/HorizontalSeparator'; import { isMultiWorkspaceEnabledState } from '@/client-config/states/isMultiWorkspaceEnabledState'; const StyledContentContainer = styled.div` diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUpForm.ts b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUpForm.ts index 8e1ba8929c69..621446e2fee6 100644 --- a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUpForm.ts +++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUpForm.ts @@ -40,7 +40,7 @@ export const useSignInUpForm = () => { if (isDefined(email)) { form.setValue('email', email); } else if (isSignInPrefilled === true) { - form.setValue('email', 'moreaux.antoine@gmail.com'); + form.setValue('email', 'tim@apple.dev'); form.setValue('password', 'Applecar2025'); } }, [form, isSignInPrefilled]);