diff --git a/src/containers/auth/AuthContainer.tsx b/src/containers/auth/AuthContainer.tsx index 2f9190d0..ffbe3fff 100644 --- a/src/containers/auth/AuthContainer.tsx +++ b/src/containers/auth/AuthContainer.tsx @@ -19,7 +19,7 @@ const AuthWrapper = styled(Container)(({ theme }) => ({ right: 0, top: 0, background: theme.palette.common.white, - height: '100vh', + height: '100%', width: '50%', opacity: 0, animationDelay: '1s', diff --git a/src/pages/auth/login/LoginPage.tsx b/src/pages/auth/login/LoginPage.tsx index 5d0b0262..b8f8ad00 100644 --- a/src/pages/auth/login/LoginPage.tsx +++ b/src/pages/auth/login/LoginPage.tsx @@ -33,7 +33,7 @@ export default function LoginPage() { { - const { data } = useQuery([], oauthProvidersQuery) + const [search] = useSearchParams() + const { data } = useQuery(['LoginSocialMedia', search.get('returnUrl') ?? '/'], oauthProvidersQuery) return ( <> diff --git a/src/pages/auth/login/oauthProviders.query.ts b/src/pages/auth/login/oauthProviders.query.ts index 4166427e..13324ea8 100644 --- a/src/pages/auth/login/oauthProviders.query.ts +++ b/src/pages/auth/login/oauthProviders.query.ts @@ -3,10 +3,11 @@ import { endPoints } from 'src/shared/constants' import { OAuthProvidersResponse } from 'src/shared/types/server' import { simpleAxios } from 'src/shared/utils/axios' -export const oauthProvidersQuery = async ({ signal }: QueryFunctionContext) => { +export const oauthProvidersQuery = async ({ signal, queryKey: [_, redirect_url] }: QueryFunctionContext<['LoginSocialMedia', string]>) => { return await simpleAxios .get(endPoints.auth.oauthProviders, { signal, + params: { redirect_url }, }) .then((response) => response?.data) .then((res) => new Promise((resolve) => window.setTimeout(() => resolve(res), 3000))) diff --git a/src/shared/loading/Spinner.tsx b/src/shared/loading/Spinner.tsx index 136e8d3b..8734eb3f 100644 --- a/src/shared/loading/Spinner.tsx +++ b/src/shared/loading/Spinner.tsx @@ -89,15 +89,15 @@ interface SpinnerProps { isLoading?: boolean } -const SpinnerContainer = styled(Container, { shouldForwardProp })<{ isLoading?: boolean }>(({ theme, isLoading }) => - isLoading - ? {} - : { - [theme.breakpoints.down('md')]: { - display: 'none', - }, - }, -) +const SpinnerContainer = styled(Container, { shouldForwardProp })<{ isLoading?: boolean }>(({ theme, isLoading }) => ({ + transition: theme.transitions.create(['opacity'], { + duration: 1000, + easing: theme.transitions.easing.easeInOut, + }), + [theme.breakpoints.down('md')]: { + opacity: isLoading ? 1 : 0, + }, +})) export const Spinner = ({ width = 110, isDark, isLoading }: SpinnerProps) => { return (