Skip to content

Commit

Permalink
feat: Dual login screen (#3452)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianjon3s authored Jul 30, 2024
1 parent 7ccde86 commit 3eb174f
Showing 1 changed file with 39 additions and 6 deletions.
45 changes: 39 additions & 6 deletions editor.planx.uk/src/pages/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import GoogleIcon from "@mui/icons-material/Google";
import MicrosoftIcon from "@mui/icons-material/Microsoft";
import Box from "@mui/material/Box";
import Button from "@mui/material/Button";
import Container from "@mui/material/Container";
import Link from "@mui/material/Link";
import { styled } from "@mui/material/styles";
import Typography from "@mui/material/Typography";
import React from "react";
Expand All @@ -27,6 +29,22 @@ const PhaseText = styled("span")(() => ({
color: "rgba(255, 255, 255, 0.49);",
}));

const LoginButton = styled(Button)(({ theme }) => ({
minWidth: "280px",
marginTop: theme.spacing(1),
display: "flex",
flexDirection: "column",
"& > span": {
display: "flex",
alignItems: "center",
gap: theme.spacing(0.75),
},
"&.Mui-disabled": {
color: "#eee",
backgroundColor: `rgba(0, 0, 0, 0.25)`,
},
}));

const Login: React.FC = () => {
return (
<Wrapper>
Expand All @@ -35,16 +53,31 @@ const Login: React.FC = () => {
Plan✕
<PhaseText>beta</PhaseText>
</Typography>
<Link
variant="body1"
color="#FFFFFF"
<LoginButton
variant="contained"
color="secondary"
href={`${
process.env.REACT_APP_GOOGLE_OAUTH_OVERRIDE ??
process.env.REACT_APP_API_URL
}/auth/google`}
>
Login with Google
</Link>
<Box component="span">
<GoogleIcon />
Continue with Google
</Box>
</LoginButton>
<LoginButton
disabled
variant="contained"
color="secondary"
href={`...`}
>
<Box component="span">
<MicrosoftIcon />
Continue with Microsoft
</Box>
(coming soon)
</LoginButton>
</LoginContainer>
</Wrapper>
);
Expand Down

0 comments on commit 3eb174f

Please sign in to comment.