diff --git a/frontend/src/assets/icons/google.svg b/frontend/src/assets/icons/google.svg index 2cdc5e2781..f9c6f88d2b 100644 --- a/frontend/src/assets/icons/google.svg +++ b/frontend/src/assets/icons/google.svg @@ -60,6 +60,7 @@ > @@ -74,22 +75,22 @@ diff --git a/frontend/src/assets/img/logo.svg b/frontend/src/assets/img/logo.svg new file mode 100644 index 0000000000..843669fff4 --- /dev/null +++ b/frontend/src/assets/img/logo.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/frontend/src/component/common/DividerText/DividerText.styles.js b/frontend/src/component/common/DividerText/DividerText.styles.js new file mode 100644 index 0000000000..2fe709fafa --- /dev/null +++ b/frontend/src/component/common/DividerText/DividerText.styles.js @@ -0,0 +1,21 @@ +import { makeStyles } from '@material-ui/styles'; + +export const useStyles = makeStyles(theme => ({ + container: { + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + margin: '1rem auto', + }, + wing: { + width: '80px', + height: '3px', + backgroundColor: theme.palette.division.main, + borderRadius: theme.borders.radius.main, + }, + text: { + textAlign: 'center', + display: 'block', + margin: '0 1rem', + }, +})); diff --git a/frontend/src/component/common/DividerText/DividerText.tsx b/frontend/src/component/common/DividerText/DividerText.tsx new file mode 100644 index 0000000000..fc36607979 --- /dev/null +++ b/frontend/src/component/common/DividerText/DividerText.tsx @@ -0,0 +1,22 @@ +import { Typography } from '@material-ui/core'; +import { useStyles } from './DividerText.styles'; + +interface IDividerTextProps { + text: string; +} + +const DividerText = ({ text, ...rest }: IDividerTextProps) => { + const styles = useStyles(); + + return ( +
+ + + {text} + + +
+ ); +}; + +export default DividerText; diff --git a/frontend/src/component/common/Gradient/Gradient.tsx b/frontend/src/component/common/Gradient/Gradient.tsx index 136570d741..46150018c2 100644 --- a/frontend/src/component/common/Gradient/Gradient.tsx +++ b/frontend/src/component/common/Gradient/Gradient.tsx @@ -1,12 +1,14 @@ interface IGradientProps { from: string; to: string; + style?: object; } const Gradient: React.FC = ({ children, from, to, + style, ...rest }) => { return ( @@ -15,6 +17,8 @@ const Gradient: React.FC = ({ background: `linear-gradient(${from}, ${to})`, height: '100%', width: '100%', + position: 'relative', + ...style, }} {...rest} > diff --git a/frontend/src/component/user/DemoAuth/DemoAuth.jsx b/frontend/src/component/user/DemoAuth/DemoAuth.jsx index 136837c120..7fcbf55fa7 100644 --- a/frontend/src/component/user/DemoAuth/DemoAuth.jsx +++ b/frontend/src/component/user/DemoAuth/DemoAuth.jsx @@ -4,7 +4,7 @@ import { Button, TextField } from '@material-ui/core'; import styles from './DemoAuth.module.scss'; -import logoIcon from '../../../assets/img/logo.png'; +import { ReactComponent as Logo } from '../../../assets/img/logo.svg'; const DemoAuth = ({ demoLogin, history, authDetails }) => { const [email, setEmail] = useState(''); @@ -24,13 +24,14 @@ const DemoAuth = ({ demoLogin, history, authDetails }) => { return (
+
- Unleash Logo

Access the Unleash demo instance

No further data or Credit Card required

{ required type="email" /> -    + + +
diff --git a/frontend/src/component/user/HostedAuth/HostedAuth.jsx b/frontend/src/component/user/HostedAuth/HostedAuth.jsx index 5fac62f9f9..cdd6b7996b 100644 --- a/frontend/src/component/user/HostedAuth/HostedAuth.jsx +++ b/frontend/src/component/user/HostedAuth/HostedAuth.jsx @@ -5,11 +5,12 @@ import { Button, Grid, TextField, Typography } from '@material-ui/core'; import { useHistory } from 'react-router'; import { useCommonStyles } from '../../../common.styles'; import { useStyles } from './HostedAuth.styles'; -import { Link } from 'react-router-dom'; import useQueryParams from '../../../hooks/useQueryParams'; import AuthOptions from '../common/AuthOptions/AuthOptions'; +import DividerText from '../../common/DividerText/DividerText'; +import ConditionallyRender from '../../common/ConditionallyRender'; -const PasswordAuth = ({ authDetails, passwordLogin }) => { +const HostedAuth = ({ authDetails, passwordLogin }) => { const commonStyles = useCommonStyles(); const styles = useStyles(); const history = useHistory(); @@ -67,12 +68,17 @@ const PasswordAuth = ({ authDetails, passwordLogin }) => { const { options = [] } = authDetails; return ( -
-
-
- -
-

or

+ <> + 0} + show={ + <> + + + + } + /> +
{apiError} @@ -105,43 +111,26 @@ const PasswordAuth = ({ authDetails, passwordLogin }) => { variant="outlined" size="small" /> - - - - - - - - Forgot your password? - - - + + -
-
- - Don't have an account?
{' '} - - Sign up - -
-
+ ); }; -PasswordAuth.propTypes = { +HostedAuth.propTypes = { authDetails: PropTypes.object.isRequired, passwordLogin: PropTypes.func.isRequired, history: PropTypes.object.isRequired, }; -export default PasswordAuth; +export default HostedAuth; diff --git a/frontend/src/component/user/HostedAuth/HostedAuth.styles.js b/frontend/src/component/user/HostedAuth/HostedAuth.styles.js index c99473967b..d54a934609 100644 --- a/frontend/src/component/user/HostedAuth/HostedAuth.styles.js +++ b/frontend/src/component/user/HostedAuth/HostedAuth.styles.js @@ -15,26 +15,10 @@ export const useStyles = makeStyles(theme => ({ apiError: { color: theme.palette.error.main, }, - - fancyLine: { - display: 'flex', - width: '100%', - margin: '10px 0', - justifyContent: 'center', - alignItems: 'center', + button: { + width: '150px', + margin: '1rem auto 0 auto', + display: 'block', textAlign: 'center', - color: 'gray', - '&::before': { - content: '""', - borderTop: '1px solid silver', - margin: '0 20px 0 0', - flex: '1 0 20px', - }, - '&::after': { - content: '""', - borderTop: '1px solid silver', - margin: '0 20px 0 0', - flex: '1 0 20px', - } - } + }, })); diff --git a/frontend/src/component/user/Login/Login.jsx b/frontend/src/component/user/Login/Login.jsx index 18be561815..e1966aae12 100644 --- a/frontend/src/component/user/Login/Login.jsx +++ b/frontend/src/component/user/Login/Login.jsx @@ -7,6 +7,7 @@ import { useStyles } from './Login.styles'; import useQueryParams from '../../../hooks/useQueryParams'; import ResetPasswordSuccess from '../common/ResetPasswordSuccess/ResetPasswordSuccess'; import StandaloneLayout from '../common/StandaloneLayout/StandaloneLayout'; +import { DEMO_TYPE } from '../../../constants/authTypes'; const Login = ({ history, user, fetchUser }) => { const styles = useStyles(); @@ -28,15 +29,21 @@ const Login = ({ history, user, fetchUser }) => { return ( -
-

Login

+
+ + Login to continue the great work + + } + /> + } /> -
- -
+
); diff --git a/frontend/src/component/user/Login/Login.styles.js b/frontend/src/component/user/Login/Login.styles.js index d107c058c8..bc0f5bc226 100644 --- a/frontend/src/component/user/Login/Login.styles.js +++ b/frontend/src/component/user/Login/Login.styles.js @@ -1,6 +1,13 @@ import { makeStyles } from '@material-ui/styles'; export const useStyles = makeStyles(theme => ({ + login: { + width: '350px', + maxWidth: '350px', + [theme.breakpoints.down('xs')]: { + width: '100%', + }, + }, loginContainer: { minHeight: '100vh', width: '100%', @@ -25,7 +32,7 @@ export const useStyles = makeStyles(theme => ({ }, title: { fontSize: theme.fontSizes.mainHeader, - marginBottom: '0.5rem', + marginBottom: '1rem', display: 'flex', alignItems: 'center', }, @@ -38,7 +45,8 @@ export const useStyles = makeStyles(theme => ({ fontSize: '1.25rem', }, loginFormContainer: { - maxWidth: '500px', + display: 'flex', + flexDirection: 'column', }, imageContainer: { display: 'flex', diff --git a/frontend/src/component/user/NewUser/NewUser.styles.ts b/frontend/src/component/user/NewUser/NewUser.styles.ts index 5b91dbfad0..86d985c790 100644 --- a/frontend/src/component/user/NewUser/NewUser.styles.ts +++ b/frontend/src/component/user/NewUser/NewUser.styles.ts @@ -1,6 +1,22 @@ import { makeStyles } from '@material-ui/core/styles'; export const useStyles = makeStyles(theme => ({ + newUser: { + width: '350px', + [theme.breakpoints.down('xs')]: { + width: '100%', + }, + }, + title: { + fontSize: theme.fontSizes.mainHeader, + marginBottom: '1.25rem', + display: 'flex', + alignItems: 'center', + }, + inviteText: { + marginBottom: '1rem', + textAlign: 'center', + }, container: { display: 'flex', }, @@ -9,7 +25,6 @@ export const useStyles = makeStyles(theme => ({ }, innerContainer: { width: '60%', - minHeight: '100vh', padding: '4rem 3rem', }, buttonContainer: { @@ -20,14 +35,14 @@ export const useStyles = makeStyles(theme => ({ marginRight: '8px', }, subtitle: { - marginBottom: '0.5rem', - fontSize: '1.1rem', + margin: '0.5rem 0', }, passwordHeader: { marginTop: '2rem', }, emailField: { minWidth: '300px', + width: '100%', [theme.breakpoints.down('xs')]: { minWidth: '100%', }, diff --git a/frontend/src/component/user/NewUser/NewUser.tsx b/frontend/src/component/user/NewUser/NewUser.tsx index ed1fea3ab1..e4873d4bdf 100644 --- a/frontend/src/component/user/NewUser/NewUser.tsx +++ b/frontend/src/component/user/NewUser/NewUser.tsx @@ -5,13 +5,13 @@ import StandaloneBanner from '../StandaloneBanner/StandaloneBanner'; import ResetPasswordDetails from '../common/ResetPasswordDetails/ResetPasswordDetails'; import { useStyles } from './NewUser.styles'; -import { useCommonStyles } from '../../../common.styles'; import useResetPassword from '../../../hooks/useResetPassword'; import StandaloneLayout from '../common/StandaloneLayout/StandaloneLayout'; import ConditionallyRender from '../../common/ConditionallyRender'; import InvalidToken from '../common/InvalidToken/InvalidToken'; import { IAuthStatus } from '../../../interfaces/user'; import AuthOptions from '../common/AuthOptions/AuthOptions'; +import DividerText from '../../common/DividerText/DividerText'; interface INewUserProps { user: IAuthStatus; @@ -21,109 +21,97 @@ const NewUser = ({ user }: INewUserProps) => { const { token, data, loading, setLoading, invalidToken } = useResetPassword(); const ref = useLoading(loading); - const commonStyles = useCommonStyles(); const styles = useStyles(); return (
- - You have been invited by {data?.createdBy} - - } - /> - - } + BannerComponent={} > - } - elseShow={ - - + } + elseShow={ + - Your username is - - -
- - In Unleash your role is:{' '} - {data?.role?.name} - - - {data?.role?.description} - -
+

+ Enter your personal details and start your + journey +

0 - } + condition={data?.createdBy} show={ - <> - - Login with 3rd party providers - - -
- - OR set a new password for your - account - - - } - elseShow={ - Set a password for your account. + {data?.createdBy} +

has invited you to join + Unleash.
} /> -
- - } - /> + + + Your username is + + + +
+ + 0 + } + show={ + <> + + + + + + } + elseShow={ + + Set a password for your account. + + } + /> +
+ + } + /> +
); diff --git a/frontend/src/component/user/PasswordAuth/PasswordAuth.jsx b/frontend/src/component/user/PasswordAuth/PasswordAuth.jsx index b79240b5e0..275fba6740 100644 --- a/frontend/src/component/user/PasswordAuth/PasswordAuth.jsx +++ b/frontend/src/component/user/PasswordAuth/PasswordAuth.jsx @@ -1,21 +1,19 @@ -import React, { useState } from 'react'; +import { useState } from 'react'; import classnames from 'classnames'; import PropTypes from 'prop-types'; -import { Button, TextField, Typography, IconButton } from '@material-ui/core'; -import LockRounded from '@material-ui/icons/LockRounded'; +import { Button, TextField, Typography } from '@material-ui/core'; import ConditionallyRender from '../../common/ConditionallyRender'; import { useHistory } from 'react-router'; import { useCommonStyles } from '../../../common.styles'; import { useStyles } from './PasswordAuth.styles'; -import { Link } from 'react-router-dom'; import useQueryParams from '../../../hooks/useQueryParams'; -import { GoogleSvg } from '../HostedAuth/Icons'; +import AuthOptions from '../common/AuthOptions/AuthOptions'; +import DividerText from '../../common/DividerText/DividerText'; const PasswordAuth = ({ authDetails, passwordLogin }) => { const commonStyles = useCommonStyles(); const styles = useStyles(); const history = useHistory(); - const [showFields, setShowFields] = useState(false); const params = useQueryParams(); const [username, setUsername] = useState(params.get('email') || ''); const [password, setPassword] = useState(''); @@ -24,11 +22,6 @@ const PasswordAuth = ({ authDetails, passwordLogin }) => { passwordError: '', }); - const onShowOptions = e => { - e.preventDefault(); - setShowFields(true); - }; - const handleSubmit = async evt => { evt.preventDefault(); @@ -110,17 +103,11 @@ const PasswordAuth = ({ authDetails, passwordLogin }) => { autoComplete="true" size="small" /> - - - - Forgot your password? - - @@ -130,44 +117,23 @@ const PasswordAuth = ({ authDetails, passwordLogin }) => { }; const renderWithOptions = options => ( -
- {options.map(o => ( -
- -
- ))} - - Show more options - - } - /> -
+ <> + + + {renderLoginForm()} + ); const { options = [] } = authDetails; return ( -
- {authDetails.message} + <> 0} show={renderWithOptions(options)} elseShow={renderLoginForm()} /> -
+ ); }; diff --git a/frontend/src/component/user/SimpleAuth/SimpleAuth.module.scss b/frontend/src/component/user/SimpleAuth/SimpleAuth.module.scss index 29b4c9d22f..6fce2f097e 100644 --- a/frontend/src/component/user/SimpleAuth/SimpleAuth.module.scss +++ b/frontend/src/component/user/SimpleAuth/SimpleAuth.module.scss @@ -1,7 +1,20 @@ +.container { + width: 350px; +} + .container > * { margin: 0.6rem 0; + width: 100%; } .button { min-width: 150px; + margin: 0 auto; + display: block; +} + +@media (max-width: 600px) { + .container { + width: 100%; + } } diff --git a/frontend/src/component/user/StandaloneBanner/StandaloneBanner.styles.ts b/frontend/src/component/user/StandaloneBanner/StandaloneBanner.styles.ts index 4460fe2670..b7941da934 100644 --- a/frontend/src/component/user/StandaloneBanner/StandaloneBanner.styles.ts +++ b/frontend/src/component/user/StandaloneBanner/StandaloneBanner.styles.ts @@ -3,14 +3,22 @@ import { makeStyles } from '@material-ui/core/styles'; export const useStyles = makeStyles(theme => ({ title: { color: '#fff', - fontSize: '1.2rem', - fontWeight: 'bold', marginBottom: '1rem', + fontSize: '2rem', + marginTop: '5rem', + [theme.breakpoints.down('sm')]: { + textAlign: 'left', + fontSize: '1.75rem', + marginTop: 0, + }, }, container: { - padding: '4rem 2rem', + padding: '6rem 4rem', color: '#fff', position: 'relative', + borderTopLeftRadius: '3px', + borderBottomLeftRadius: '3px', + textAlign: 'right', [theme.breakpoints.down('sm')]: { padding: '3rem 2rem', }, @@ -18,9 +26,22 @@ export const useStyles = makeStyles(theme => ({ padding: '3rem 1rem', }, }, + bannerSubtitle: { + [theme.breakpoints.down('sm')]: { + maxWidth: '300px', + fontSize: '1.75rem', + textAlign: 'left', + }, + [theme.breakpoints.down('xs')]: { + display: 'none', + }, + fontSize: '2rem', + fontWeight: '300', + }, switchesContainer: { position: 'absolute', - bottom: '40px', + bottom: '15px', + left: '-50px', display: 'flex', flexDirection: 'column', [theme.breakpoints.down('sm')]: { @@ -28,46 +49,6 @@ export const useStyles = makeStyles(theme => ({ }, }, switchIcon: { - height: '180px', - }, - bottomStar: { - position: 'absolute', - bottom: '-54px', - left: '100px', - [theme.breakpoints.down('sm')]: { - display: 'none', - }, - }, - bottomRightStar: { - position: 'absolute', - bottom: '-100px', - left: '200px', - [theme.breakpoints.down('sm')]: { - display: 'none', - }, - }, - midRightStar: { - position: 'absolute', - bottom: '-80px', - left: '300px', - [theme.breakpoints.down('sm')]: { - display: 'none', - }, - }, - midLeftStar: { - position: 'absolute', - top: '10px', - left: '150px', - [theme.breakpoints.down('sm')]: { - display: 'none', - }, - }, - midLeftStarTwo: { - position: 'absolute', - top: '25px', - left: '350px', - [theme.breakpoints.down('sm')]: { - display: 'none', - }, + height: '100px', }, })); diff --git a/frontend/src/component/user/StandaloneBanner/StandaloneBanner.tsx b/frontend/src/component/user/StandaloneBanner/StandaloneBanner.tsx index e3fdc3b60e..17e7a76f4a 100644 --- a/frontend/src/component/user/StandaloneBanner/StandaloneBanner.tsx +++ b/frontend/src/component/user/StandaloneBanner/StandaloneBanner.tsx @@ -2,45 +2,35 @@ import { FC } from 'react'; import { Typography, useTheme } from '@material-ui/core'; import Gradient from '../../common/Gradient/Gradient'; -import { ReactComponent as StarIcon } from '../../../assets/icons/star.svg'; import { ReactComponent as RightToggleIcon } from '../../../assets/icons/toggleRight.svg'; import { ReactComponent as LeftToggleIcon } from '../../../assets/icons/toggleLeft.svg'; import { useStyles } from './StandaloneBanner.styles'; -import ConditionallyRender from '../../common/ConditionallyRender'; interface IStandaloneBannerProps { - showStars?: boolean; title: string; } -const StandaloneBanner: FC = ({ - showStars = false, - title, - children, -}) => { +const StandaloneBanner: FC = ({ title, children }) => { const theme = useTheme(); const styles = useStyles(); return ( - +
{title} - {children} - - - - - - - - - } - /> + + Committed to creating new ways of developing software +
diff --git a/frontend/src/component/user/authentication-component.jsx b/frontend/src/component/user/authentication-component.jsx index 926d271bb6..37d7c86041 100644 --- a/frontend/src/component/user/authentication-component.jsx +++ b/frontend/src/component/user/authentication-component.jsx @@ -6,10 +6,13 @@ import PasswordAuth from './PasswordAuth/PasswordAuth'; import HostedAuth from './HostedAuth/HostedAuth'; import DemoAuth from './DemoAuth'; -const SIMPLE_TYPE = 'unsecure'; -const DEMO_TYPE = 'demo'; -const PASSWORD_TYPE = 'password'; -const HOSTED_TYPE = 'enterprise-hosted'; +import { + SIMPLE_TYPE, + DEMO_TYPE, + PASSWORD_TYPE, + HOSTED_TYPE, +} from '../../constants/authTypes'; +import SecondaryLoginActions from './common/SecondaryLoginActions/SecondaryLoginActions'; class AuthComponent extends React.Component { static propTypes = { @@ -22,16 +25,20 @@ class AuthComponent extends React.Component { render() { const authDetails = this.props.user.authDetails; + if (!authDetails) return null; let content; if (authDetails.type === PASSWORD_TYPE) { content = ( - + <> + + + ); } else if (authDetails.type === SIMPLE_TYPE) { content = ( @@ -51,18 +58,21 @@ class AuthComponent extends React.Component { ); } else if (authDetails.type === HOSTED_TYPE) { content = ( - + <> + + + ); } else { content = ( ); } - return
{content}
; + return <>{content}; } } diff --git a/frontend/src/component/user/authentication-custom-component.jsx b/frontend/src/component/user/authentication-custom-component.jsx index dee299b2dc..d98addfe0a 100644 --- a/frontend/src/component/user/authentication-custom-component.jsx +++ b/frontend/src/component/user/authentication-custom-component.jsx @@ -13,8 +13,14 @@ class AuthenticationCustomComponent extends React.Component {

{authDetails.message}

- - + +
diff --git a/frontend/src/component/user/common/AuthOptions/AuthOptions.tsx b/frontend/src/component/user/common/AuthOptions/AuthOptions.tsx index 42a85211c3..6787685c20 100644 --- a/frontend/src/component/user/common/AuthOptions/AuthOptions.tsx +++ b/frontend/src/component/user/common/AuthOptions/AuthOptions.tsx @@ -4,6 +4,7 @@ import { useCommonStyles } from '../../../../common.styles'; import { IAuthOptions } from '../../../../interfaces/user'; import { ReactComponent as GoogleSvg } from '../../../../assets/icons/google.svg'; import LockRounded from '@material-ui/icons/LockRounded'; +import ConditionallyRender from '../../../common/ConditionallyRender'; interface IAuthOptionProps { options?: IAuthOptions[]; @@ -27,13 +28,27 @@ const AuthOptions = ({ options }: IAuthOptionProps) => { variant="outlined" href={o.path} size="small" - style={{ maxWidth: '300px' }} + style={{ height: '40px', color: '#000' }} startIcon={ - o.type === 'google' ? ( - - ) : ( - - ) + + } + elseShow={ + + } + /> } > {o.message} diff --git a/frontend/src/component/user/common/ResetPasswordForm/PasswordChecker/PasswordChecker.tsx b/frontend/src/component/user/common/ResetPasswordForm/PasswordChecker/PasswordChecker.tsx index f801d43780..55e728c6ad 100644 --- a/frontend/src/component/user/common/ResetPasswordForm/PasswordChecker/PasswordChecker.tsx +++ b/frontend/src/component/user/common/ResetPasswordForm/PasswordChecker/PasswordChecker.tsx @@ -10,6 +10,8 @@ import { formatApiPath } from '../../../../../utils/format-path'; interface IPasswordCheckerProps { password: string; callback: Dispatch>; + style?: object; + hideOnCompletion?: boolean; } interface IErrorResponse { @@ -30,7 +32,11 @@ const UPPERCASE_ERROR = const LOWERCASE_ERROR = 'The password must contain at least one lowercase letter.'; -const PasswordChecker = ({ password, callback }: IPasswordCheckerProps) => { +const PasswordChecker = ({ + password, + callback, + style = {}, +}: IPasswordCheckerProps) => { const styles = useStyles(); const [casingError, setCasingError] = useState(true); const [numberError, setNumberError] = useState(true); @@ -142,7 +148,12 @@ const PasswordChecker = ({ password, callback }: IPasswordCheckerProps) => { -
+
diff --git a/frontend/src/component/user/common/ResetPasswordForm/ResetPasswordForm.styles.ts b/frontend/src/component/user/common/ResetPasswordForm/ResetPasswordForm.styles.ts index 919ddf58c8..d427e9c007 100644 --- a/frontend/src/component/user/common/ResetPasswordForm/ResetPasswordForm.styles.ts +++ b/frontend/src/component/user/common/ResetPasswordForm/ResetPasswordForm.styles.ts @@ -4,9 +4,11 @@ export const useStyles = makeStyles(theme => ({ container: { display: 'flex', flexDirection: 'column', - maxWidth: '300px', + position: 'relative', }, button: { width: '150px', + margin: '1rem auto', + display: 'block', }, })); diff --git a/frontend/src/component/user/common/ResetPasswordForm/ResetPasswordForm.tsx b/frontend/src/component/user/common/ResetPasswordForm/ResetPasswordForm.tsx index 25acdae8af..02dc1ca826 100644 --- a/frontend/src/component/user/common/ResetPasswordForm/ResetPasswordForm.tsx +++ b/frontend/src/component/user/common/ResetPasswordForm/ResetPasswordForm.tsx @@ -28,6 +28,7 @@ const ResetPasswordForm = ({ token, setLoading }: IResetPasswordProps) => { const commonStyles = useCommonStyles(); const [apiError, setApiError] = useState(false); const [password, setPassword] = useState(''); + const [showPasswordChecker, setShowPasswordChecker] = useState(false); const [confirmPassword, setConfirmPassword] = useState(''); const [matchingPasswords, setMatchingPasswords] = useState(false); const [validOwaspPassword, setValidOwaspPassword] = useState(false); @@ -102,10 +103,6 @@ const ResetPasswordForm = ({ token, setLoading }: IResetPasswordProps) => { styles.container )} > - { placeholder="Password" value={password || ''} onChange={e => setPassword(e.target.value)} + onFocus={() => setShowPasswordChecker(true)} autoComplete="password" data-loading /> @@ -126,6 +124,17 @@ const ResetPasswordForm = ({ token, setLoading }: IResetPasswordProps) => { autoComplete="confirm-password" data-loading /> + + } + /> + ({ + container: { + margin: 'auto auto 0 auto', + width: '200px', + [theme.breakpoints.down('sm')]: { + marginTop: '1rem', + }, + }, + link: { + textDecoration: 'none', + fontWeight: 'bold', + color: theme.palette.primary.main, + textAlign: 'center', + }, + text: { fontWeight: 'bold', marginBottom: '0.5rem' }, +})); diff --git a/frontend/src/component/user/common/SecondaryLoginActions/SecondaryLoginActions.tsx b/frontend/src/component/user/common/SecondaryLoginActions/SecondaryLoginActions.tsx new file mode 100644 index 0000000000..5ea6b9c43e --- /dev/null +++ b/frontend/src/component/user/common/SecondaryLoginActions/SecondaryLoginActions.tsx @@ -0,0 +1,29 @@ +import { Typography } from '@material-ui/core'; +import { Link } from 'react-router-dom'; +import { useStyles } from './SecondaryLoginActions.styles'; + +const SecondaryLoginActions = () => { + const styles = useStyles(); + return ( +
+ + + Forgot password? + + + + Don't have an account?{' '} + + Sign up + + +
+ ); +}; + +export default SecondaryLoginActions; diff --git a/frontend/src/component/user/common/StandaloneLayout/StandaloneLayout.styles.ts b/frontend/src/component/user/common/StandaloneLayout/StandaloneLayout.styles.ts index 9a31b49c48..7c48403d8b 100644 --- a/frontend/src/component/user/common/StandaloneLayout/StandaloneLayout.styles.ts +++ b/frontend/src/component/user/common/StandaloneLayout/StandaloneLayout.styles.ts @@ -2,28 +2,31 @@ import { makeStyles } from '@material-ui/core/styles'; export const useStyles = makeStyles(theme => ({ container: { + padding: '4rem', + background: '#3a5663', display: 'flex', [theme.breakpoints.down('sm')]: { flexDirection: 'column', }, - overflow: 'hidden', + [theme.breakpoints.down('xs')]: { + padding: '0', + }, + minHeight: '100vh', }, leftContainer: { width: '40%', - minHeight: '100vh', + borderRadius: '3px', [theme.breakpoints.down('sm')]: { width: '100%', minHeight: 'auto', }, }, - bannerSubtitle: { - [theme.breakpoints.down('sm')]: { - maxWidth: '300px', - }, - }, rightContainer: { width: '60%', - minHeight: '100vh', + flex: '1', + borderTopRightRadius: '3px', + borderBottomRightRadius: '3px', + backgroundColor: '#fff', position: 'relative', [theme.breakpoints.down('sm')]: { width: '100%', @@ -31,27 +34,16 @@ export const useStyles = makeStyles(theme => ({ minHeight: 'auto', }, }, - menu: { - position: 'absolute', - right: '20px', - top: '20px', - '& a': { - textDecoration: 'none', - color: '#000', - }, - [theme.breakpoints.down('sm')]: { - '& a': { - color: '#fff', - }, - }, - }, title: { fontWeight: 'bold', fontSize: '1.2rem', marginBottom: '1rem', }, innerRightContainer: { - padding: '4rem 3rem', + display: 'flex', + justifyContent: 'center', + height: '100%', + padding: '6rem 3rem', [theme.breakpoints.down('sm')]: { padding: '2rem 2rem', }, diff --git a/frontend/src/component/user/common/StandaloneLayout/StandaloneLayout.tsx b/frontend/src/component/user/common/StandaloneLayout/StandaloneLayout.tsx index e65d8de7c2..fd29069c6e 100644 --- a/frontend/src/component/user/common/StandaloneLayout/StandaloneLayout.tsx +++ b/frontend/src/component/user/common/StandaloneLayout/StandaloneLayout.tsx @@ -1,11 +1,7 @@ import { FC } from 'react'; import StandaloneBanner from '../../StandaloneBanner/StandaloneBanner'; -import { Typography } from '@material-ui/core'; - import { useStyles } from './StandaloneLayout.styles'; -import ConditionallyRender from '../../../common/ConditionallyRender'; -import { Link, useLocation } from 'react-router-dom'; interface IStandaloneLayout { BannerComponent?: JSX.Element; @@ -14,39 +10,20 @@ interface IStandaloneLayout { const StandaloneLayout: FC = ({ children, - showMenu = true, BannerComponent, }) => { const styles = useStyles(); - const location = useLocation(); - let banner = ( - - - Committed to creating new ways of developing software. - - - ); + let banner = ; if (BannerComponent) { banner = BannerComponent; } - const isLoginpage = location.pathname.includes('login'); - return (
{banner}
- - Login -
- } - /> -
{children}
diff --git a/frontend/src/constants/authTypes.ts b/frontend/src/constants/authTypes.ts new file mode 100644 index 0000000000..af0a211abd --- /dev/null +++ b/frontend/src/constants/authTypes.ts @@ -0,0 +1,5 @@ +/* AUTH TYPES */ +export const SIMPLE_TYPE = 'unsecure'; +export const DEMO_TYPE = 'demo'; +export const PASSWORD_TYPE = 'password'; +export const HOSTED_TYPE = 'enterprise-hosted'; diff --git a/frontend/src/interfaces/palette.d.ts b/frontend/src/interfaces/palette.d.ts index f173071c66..d18640f8bb 100644 --- a/frontend/src/interfaces/palette.d.ts +++ b/frontend/src/interfaces/palette.d.ts @@ -1,10 +1,19 @@ -import * as createPalette from '@material-ui/core/styles/createPalette'; - declare module '@material-ui/core/styles/createPalette' { interface PaletteOptions { borders?: PaletteColorOptions; + login?: ILoginPaletteOptions; } interface Palette { borders?: PaletteColor; } } + +interface ILoginPaletteOptions { + gradient?: IGradientPaletteOptions; + main?: string; +} + +interface IGradientPaletteOptions { + top: string; + bottom: string; +}