-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #229 from glific/auth-restructuring
Auth restructuring
- Loading branch information
Showing
10 changed files
with
508 additions
and
550 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
.Container { | ||
width: 100%; | ||
height: 100vh; | ||
} | ||
|
||
.Auth { | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
vertical-align: middle; | ||
} | ||
|
||
.GlificLogo { | ||
font-family: 'Tenor Sans'; | ||
color: #0d6b3d; | ||
font-size: 36px; | ||
margin-top: 5vh; | ||
} | ||
|
||
.Box { | ||
border-radius: 12px; | ||
margin-top: 5vh; | ||
align-content: center; | ||
justify-content: center; | ||
flex-grow: 1; | ||
} | ||
|
||
.RegistrationBox { | ||
width: 400px; | ||
height: 450px; | ||
background-color: #073f24; | ||
} | ||
|
||
.OTPBox { | ||
width: 400px; | ||
height: 360px; | ||
background-color: #073f24; | ||
} | ||
|
||
.LoginBox { | ||
height: 390px; | ||
width: 395px; | ||
border-color: #eaedec; | ||
border-style: solid; | ||
border-width: 2px; | ||
} | ||
|
||
.BoxTitle { | ||
justify-content: start; | ||
margin-bottom: 10px; | ||
margin-top: 32px; | ||
margin-left: 32px; | ||
font-weight: bold; | ||
width: 320px; | ||
} | ||
|
||
.RegistrationBoxTitle { | ||
color: white; | ||
} | ||
|
||
.LoginBoxTitle { | ||
color: #073f24; | ||
} | ||
|
||
.TitleText { | ||
font-weight: bold !important; | ||
} | ||
|
||
.CenterBox { | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
} | ||
|
||
.AuthButton { | ||
width: 335px; | ||
border-radius: 27px !important; | ||
margin-top: 20px !important; | ||
} | ||
|
||
.LoginButton { | ||
background-color: white !important; | ||
border: solid 2px #119656 !important; | ||
margin-top: 0px; | ||
color: #119656 !important; | ||
} | ||
|
||
.OrText { | ||
color: #93a29b; | ||
font-weight: bolder; | ||
margin-top: 24px; | ||
margin-bottom: 24px; | ||
font-size: 16px; | ||
} | ||
|
||
.Auth a { | ||
color: #119656; | ||
text-decoration: none; | ||
font-size: 16px; | ||
font-weight: bolder; | ||
} | ||
|
||
.Auth a:visited { | ||
color: #119656; | ||
} | ||
|
||
.Auth hr { | ||
margin-top: 32px; | ||
margin-left: 18px; | ||
margin-right: 18px; | ||
height: 1px; | ||
width: 142px; | ||
border-color: #eaedec; | ||
background-color: #eaedec; | ||
color: #eaedec; | ||
border-style: solid; | ||
} | ||
|
||
.Or { | ||
display: flex; | ||
flex-direction: row; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import React from 'react'; | ||
|
||
import styles from './Auth.module.css'; | ||
import { Typography } from '@material-ui/core'; | ||
import { Button } from '../../components/UI/Form/Button/Button'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
export interface AuthProps { | ||
children: any; | ||
pageTitle: string; | ||
buttonText: string; | ||
alternateLink?: string; | ||
alternateText?: string; | ||
handlerSubmitCallback: Function; | ||
mode: string; | ||
} | ||
|
||
const Auth: React.SFC<AuthProps> = (props) => { | ||
const boxClass = [styles.Box]; | ||
const boxTitleClass = [styles.BoxTitle]; | ||
const buttonClass = [styles.AuthButton]; | ||
switch (props.mode) { | ||
case 'login': | ||
boxClass.push(styles.LoginBox); | ||
boxTitleClass.push(styles.LoginBoxTitle); | ||
buttonClass.push(styles.LoginButton); | ||
break; | ||
case 'registration': | ||
boxClass.push(styles.RegistrationBox); | ||
boxTitleClass.push(styles.RegistrationBoxTitle); | ||
break; | ||
case 'confirmotp': | ||
boxClass.push(styles.OTPBox); | ||
boxTitleClass.push(styles.RegistrationBoxTitle); | ||
break; | ||
} | ||
|
||
return ( | ||
<div className={styles.Container}> | ||
<div className={styles.Auth}> | ||
<div className={styles.GlificLogo}>Glific</div> | ||
<div className={boxClass.join(' ')}> | ||
<div className={boxTitleClass.join(' ')}> | ||
<Typography variant="h4" classes={{ root: styles.TitleText }}> | ||
{props.pageTitle} | ||
</Typography> | ||
</div> | ||
<div className={styles.CenterBox}> | ||
{props.children} | ||
<Button | ||
data-testid="AuthButton" | ||
onClick={props.handlerSubmitCallback} | ||
color="primary" | ||
variant={'contained'} | ||
className={buttonClass.join(' ')} | ||
> | ||
{props.buttonText} | ||
</Button> | ||
</div> | ||
</div> | ||
{props.alternateText ? ( | ||
<> | ||
<div className={styles.Or}> | ||
<hr /> | ||
<div className={styles.OrText}>OR</div> | ||
<hr /> | ||
</div> | ||
<div> | ||
<Link to={'/' + props.alternateLink}>{props.alternateText}</Link> | ||
</div> | ||
</> | ||
) : null} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Auth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.