Skip to content

Commit

Permalink
Center Sign-In Button
Browse files Browse the repository at this point in the history
  • Loading branch information
GodVenn authored and aeshub committed May 6, 2023
1 parent 5b700aa commit c39c868
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions frontend/src/components/Pages/SignInPage/SignInPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ import { useMsal } from '@azure/msal-react'
import { loginRequest } from '../../../api/AuthConfig'
import { Button } from '@equinor/eds-core-react'
import { IPublicClientApplication } from '@azure/msal-browser'
import styled from 'styled-components'

const Centered = styled.div`
display: flex;
flex-direction: column;
align-items: center;
`

function handleLogin(instance: IPublicClientApplication) {
instance.loginRedirect(loginRequest).catch((e) => {
Expand All @@ -17,9 +24,11 @@ export const SignInButton = () => {
const { instance } = useMsal()

return (
<Button href="" variant="contained" onClick={() => handleLogin(instance)}>
Sign in using Redirect
</Button>
<Centered>
<Button href="" variant="contained" onClick={() => handleLogin(instance)}>
Sign in
</Button>
</Centered>
)
}

Expand Down

0 comments on commit c39c868

Please sign in to comment.