diff --git a/src/App.tsx b/src/App.tsx index 7a08ace..052f0ec 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -4,6 +4,7 @@ import { BreakpointProvider } from './components/Breakpoint' import { Layout } from './components/Layout' import { Home } from './pages/activation/home' import { Login } from './pages/activation/login' +import { Activate } from './pages/activation/activate' function App() { return ( @@ -12,6 +13,7 @@ function App() { }> } /> } /> + } /> diff --git a/src/components/Typography/Text.tsx b/src/components/Typography/Text.tsx new file mode 100644 index 0000000..eff8d3d --- /dev/null +++ b/src/components/Typography/Text.tsx @@ -0,0 +1,19 @@ +import React, { FC, ComponentProps } from 'react' +import { Typography, TypographyProps } from 'antd' +import styled from 'styled-components' + +type TextProps = ComponentProps & { + primary?: boolean + inherit?: boolean +} + +const StyledText = styled(Typography.Text)<{ + $inherit?: boolean + $primary?: boolean +}>` + ${({ $inherit }) => $inherit ? 'font-size: inherit;line-height:inherit;' : ''} + ${({ $primary, theme }) => $primary ? `color: ${theme.brandPrimary}` : ''} +` +export const Text: FC = ({ primary, inherit, ...props }) => { + return +} diff --git a/src/components/Typography/index.ts b/src/components/Typography/index.ts index 7f3a9dd..4e325f1 100644 --- a/src/components/Typography/index.ts +++ b/src/components/Typography/index.ts @@ -1,8 +1,9 @@ import { Typography } from 'antd' -const { Text, Title, Link } = Typography +const { Title, Link } = Typography export * from './Paragraph' export * from './ButtonText' export * from './TinyText' -export { Text, Title, Link } +export * from './Text' +export { Title, Link } diff --git a/src/pages/activation/activate/Activate.tsx b/src/pages/activation/activate/Activate.tsx new file mode 100644 index 0000000..474d702 --- /dev/null +++ b/src/pages/activation/activate/Activate.tsx @@ -0,0 +1,85 @@ +import React, { FC, useState } from 'react' +import { + StyledContainer, + StyledImageWrapper, + StyledMainContent, + StyledHeadline, + StyledContent, + StyledButton, + StyledParagraph, StyledHint, StyledFormContent, +} from './styled' +import { Form } from 'antd' +import { Paragraph, Link, Text } from '../../../components/Typography' +import { Input, ErrorMessage } from '../../../components/FormControl' +import { ActivateGuide } from './ActivateGuide' + +export const Activate: FC = () => { + const [logined] = useState(true) + const [showModal, setModal] = useState(false) + const handleShowModal = () => { + setModal(true) + } + + const handleCloseModal = () => { + setModal(false) + } + const onFinish = (values: any) => { + // TODO: login + console.log('Success:', values); + }; + return ( + + + + + {logined ? ( + + Hello, John +
+ Welcome to your kit activation. +
+ ) : ( + + Welcome to your kit activation. + + )} + Your kit needs to be activated before the lab can process your sample. + +
+ + }, + // Activation code not found + ]} + > + + + + Next + +
+ + + {!logined ? + <> + Already have an account?  + Log in +
+ : null} + Can’t find your activation code? +
+
+
+
+
+ +
+ ) +} diff --git a/src/pages/activation/activate/ActivateGuide.tsx b/src/pages/activation/activate/ActivateGuide.tsx new file mode 100644 index 0000000..9212d66 --- /dev/null +++ b/src/pages/activation/activate/ActivateGuide.tsx @@ -0,0 +1,56 @@ +import React, { FC } from 'react' +import styled from 'styled-components' +import { Modal, ModalProps } from '../../../components/Modal' +import { Title, Text, Paragraph } from '../../../components/Typography' + +type Props = Pick & { + onClose?: () => void +} + +const StyledWrapper = styled.div` + display: flex; + align-items: center; + flex-direction: column; + min-height: 366px; + + ${props => props.theme.breakpoints.up('s')} { + justify-content: center; + } +` +const StyledMain = styled.div` + width: 100%; + + ${props => props.theme.breakpoints.up('s')} { + width: 400px; + padding-top: 16px; + } + + ${props => props.theme.breakpoints.down('s')} { + padding-top: 33px; + padding-left: 4px; + padding-right: 4px; + } +` +const StyledTitle = styled(Title)` + margin-bottom: 3px !important; + + ${props => props.theme.breakpoints.down('s')} { + margin-bottom: 27px !important; + } +` +export const ActivateGuide: FC = ({ onClose, ...props }) => { + const handleClose = () => { + onClose && onClose() + } + return ( + + + + Can’t find your activation code? + The activation code is located on the Kit ID Card in your home collection + kit. + + + + ) +} diff --git a/src/pages/activation/activate/images/activate@2x.png b/src/pages/activation/activate/images/activate@2x.png new file mode 100644 index 0000000..7466c42 Binary files /dev/null and b/src/pages/activation/activate/images/activate@2x.png differ diff --git a/src/pages/activation/activate/images/activateMobile@2x.png b/src/pages/activation/activate/images/activateMobile@2x.png new file mode 100644 index 0000000..7da7996 Binary files /dev/null and b/src/pages/activation/activate/images/activateMobile@2x.png differ diff --git a/src/pages/activation/activate/index.ts b/src/pages/activation/activate/index.ts new file mode 100644 index 0000000..4ca4015 --- /dev/null +++ b/src/pages/activation/activate/index.ts @@ -0,0 +1 @@ +export * from './Activate' diff --git a/src/pages/activation/activate/styled.tsx b/src/pages/activation/activate/styled.tsx new file mode 100644 index 0000000..793c371 --- /dev/null +++ b/src/pages/activation/activate/styled.tsx @@ -0,0 +1,85 @@ +import React from 'react' +import styled from 'styled-components' +import Image from './images/activate@2x.png' +import ImageMobile from './images/activateMobile@2x.png' +import { Title, Paragraph } from '../../../components/Typography' +import { Button } from '../../../components/Button' + +export const StyledContainer = styled.div` + display: flex; + flex-direction: row; + padding: 25px 0 25px 40px; + + ${props => props.theme.breakpoints.down('s')} { + padding: 12px 16px; + flex-direction: column; + align-items: center; + } +` +export const StyledImageWrapper = styled.div` + width: 54%; + max-width: 737px; + height: 809px; + background-size: cover; + background-repeat: no-repeat; + background-position: center; + background-image: url(${Image}); + flex: 0 0 auto; + + ${props => props.theme.breakpoints.down('s')} { + background-image: url(${ImageMobile}); + max-width: 358px; + width: 100%; + height: 232px; + } +` + +export const StyledMainContent = styled.div` + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + flex: auto; + + ${props => props.theme.breakpoints.down('s')} { + width: 100%; + padding-top: 20px; + } +` + +export const StyledHeadline = styled(Title)<{$login: boolean}>` + margin-bottom: ${({ $login }) => $login ? '0' : '37'}px !important; + font-size: 36px; + + ${props => props.theme.breakpoints.down('s')} { + margin-bottom: 1px !important; + } +` +export const StyledParagraph = styled(Paragraph)` + margin-top: 0 !important; + margin-bottom: 0 !important; +` +export const StyledContent = styled.div` + width: 388px; + + ${props => props.theme.breakpoints.down('s')} { + width: 100%; + } +` + +export const StyledFormContent = styled.div` + margin-top: 26px; +` + +export const StyledButton = styled(Button)` + margin-top: 15px; +` + + +export const StyledHint = styled.div` + text-align: center; + margin-top: 33px; + ${props => props.theme.breakpoints.down('s')} { + margin-top: 18px; + } +` diff --git a/src/pages/activation/login/Login.tsx b/src/pages/activation/login/Login.tsx index 3662a44..f5f635b 100644 --- a/src/pages/activation/login/Login.tsx +++ b/src/pages/activation/login/Login.tsx @@ -30,7 +30,7 @@ export const Login: FC = () => { - Welcome Back! + Welcome Back! Log in to continue