Skip to content

Commit

Permalink
fix: update login screen to match new design
Browse files Browse the repository at this point in the history
- color Google and MS logos
- order is Google MS Apple
  • Loading branch information
paulschreiber committed Oct 16, 2023
1 parent 53afe9c commit 16e27f2
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/account/components/AccountLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { useNavigate, useSearchParams } from 'react-router-dom';
import { fetchAuthURLs } from 'terraso-client-shared/account/accountSlice';
import { useFetchData } from 'terraso-client-shared/store/utils';
import AppleIcon from '@mui/icons-material/Apple';
import GoogleIcon from '@mui/icons-material/Google';
import { Box, Button, Stack, Typography } from '@mui/material';
import SvgIcon from '@mui/material/SvgIcon';

Expand All @@ -33,6 +32,7 @@ import PageLoader from 'layout/PageLoader';
import LocalePicker from 'localization/components/LocalePicker';
import { useAnalytics } from 'monitoring/analytics';

import { ReactComponent as GoogleSvg } from 'assets/google.svg';
import logo from 'assets/logo.svg';
import { ReactComponent as MicrosoftSvg } from 'assets/microsoft.svg';

Expand All @@ -41,6 +41,10 @@ const MicrosoftIcon = props => {
return <SvgIcon component={MicrosoftSvg} {...props} />;
};

const GoogleIcon = props => {
return <SvgIcon component={GoogleSvg} {...props} />;
};

const appendReferrer = (url, referrer) => {
if (!referrer) {
return url;
Expand Down Expand Up @@ -132,19 +136,6 @@ const AccountForm = () => {
</Button>
)}

{urls.apple && (
<Button
variant="outlined"
startIcon={<AppleIcon sx={{ paddingRight: '5px' }} />}
href={appendReferrer(urls.apple, referrer)}
onClick={() =>
trackEvent('user.login', { props: { source: 'apple' } })
}
>
{t('account.apple_login')}
</Button>
)}

{urls.microsoft && (
<Button
variant="outlined"
Expand All @@ -161,6 +152,19 @@ const AccountForm = () => {
{t('account.microsoft_login')}
</Button>
)}

{urls.apple && (
<Button
variant="outlined"
startIcon={<AppleIcon sx={{ paddingRight: '5px' }} />}
href={appendReferrer(urls.apple, referrer)}
onClick={() =>
trackEvent('user.login', { props: { source: 'apple' } })
}
>
{t('account.apple_login')}
</Button>
)}
</Stack>

<Typography sx={{ mb: 4 }}>
Expand Down

0 comments on commit 16e27f2

Please sign in to comment.