-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(subdomain): add env var IS_MULTIWORKSPACE_ENABLED + add link on …
…switch workspace button
- Loading branch information
Showing
8 changed files
with
59 additions
and
28 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,14 +20,15 @@ import { Title } from '@/auth/components/Title'; | |
import { useFindAvailableWorkspacesByEmail } from '@/auth/sign-in-up/hooks/useFindAvailableWorkspacedByEmail'; | ||
import { FormEvent, useState } from 'react'; | ||
import { FooterNote } from '@/auth/sign-in-up/components/FooterNote'; | ||
import { useSetRecoilState } from 'recoil'; | ||
import { useRecoilValue, useSetRecoilState } from 'recoil'; | ||
import { isDefined } from '~/utils/isDefined'; | ||
import { availableWorkspacesForAuthState } from '@/auth/states/availableWorkspacesForAuthState'; | ||
import { | ||
SignInUpStep, | ||
signInUpStepState, | ||
} from '@/auth/states/signInUpStepState'; | ||
import { redirectToWorkspace } from '~/utils/workspace-url.helper'; | ||
import { isSignInPrefilledState } from '@/client-config/states/isSignInPrefilledState'; | ||
|
||
const StyledContentContainer = styled(motion.div)` | ||
margin-bottom: ${({ theme }) => theme.spacing(8)}; | ||
|
@@ -57,6 +58,7 @@ const validationSchema = z | |
|
||
export const SignInUpGlobalScope = () => { | ||
const theme = useTheme(); | ||
const isSignInPrefilled = useRecoilValue(isSignInPrefilledState); | ||
|
||
const { signInWithGoogle } = useSignInWithGoogle(); | ||
const { signInWithMicrosoft } = useSignInWithMicrosoft(); | ||
|
@@ -72,7 +74,7 @@ export const SignInUpGlobalScope = () => { | |
const form = useForm<z.infer<typeof validationSchema>>({ | ||
mode: 'onChange', | ||
defaultValues: { | ||
email: '', | ||
email: isSignInPrefilled === true ? '[email protected]' : '', | ||
}, | ||
resolver: zodResolver(validationSchema), | ||
}); | ||
|
@@ -81,7 +83,7 @@ export const SignInUpGlobalScope = () => { | |
event.preventDefault(); | ||
setShowErrors(true); | ||
|
||
const { data, error } = await findAvailableWorkspacesByEmail( | ||
const { data } = await findAvailableWorkspacesByEmail( | ||
form.getValues('email'), | ||
); | ||
if (isDefined(data) && data.findAvailableWorkspacesByEmail.length > 1) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ export const USER_QUERY_FRAGMENT = gql` | |
logo | ||
displayName | ||
domainName | ||
subdomain | ||
} | ||
} | ||
userVars | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters