Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pending state for social login #2785

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/components/common/SocialSigner/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Button, SvgIcon, Tooltip, Typography } from '@mui/material'
import { Box, Button, LinearProgress, SvgIcon, Tooltip, Typography } from '@mui/material'
import { useCallback, useContext, useMemo, useState } from 'react'
import { PasswordRecovery } from '@/components/common/SocialSigner/PasswordRecovery'
import GoogleLogo from '@/public/images/welcome/logo-google.svg'
Expand Down Expand Up @@ -118,6 +118,13 @@ export const SocialSigner = ({
disabled={isDisabled}
fullWidth
>
<LinearProgress
color="secondary"
className={css.loginProgress}
sx={{
opacity: loginPending ? 1 : 0,
}}
/>
<Box width="100%" display="flex" flexDirection="row" alignItems="center" gap={1}>
<img
src={userInfo.profileImage}
Expand Down Expand Up @@ -145,6 +152,13 @@ export const SocialSigner = ({
fullWidth
sx={{ borderWidth: '1px !important' }}
>
<LinearProgress
color="secondary"
className={css.loginProgress}
sx={{
opacity: loginPending ? 1 : 0,
}}
/>
<Box display="flex" flexDirection="row" alignItems="center" gap={1}>
<SvgIcon component={GoogleLogo} inheritViewBox fontSize="medium" /> Continue with Google
</Box>
Expand Down
10 changes: 10 additions & 0 deletions src/components/common/SocialSigner/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
align-items: flex-start;
}

.loginProgress {
margin-bottom: -16px;
top: 0;
width: 100%;
height: 2px;
position: absolute;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}

.passwordWrapper {
padding: var(--space-4) var(--space-4) var(--space-2) var(--space-4);
display: flex;
Expand Down
Loading