Skip to content

Commit

Permalink
fix: pending state for social login
Browse files Browse the repository at this point in the history
  • Loading branch information
schmanu committed Nov 9, 2023
1 parent 798e998 commit 1855023
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
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

0 comments on commit 1855023

Please sign in to comment.