Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 134
[C-3260, C-3236] Layout for SignIn page (web)#6440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
ab0f822939c4dee4e3317aa3a213b9691dda69a41159db06c485e7f6d5464e060ca4806e6e8e242d1be2File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { TextInput } from '@audius/harmony' | ||
| import { TextInputProps } from '@audius/harmony/dist/components/input/TextInput/types' | ||
| import { useField } from 'formik' | ||
| export type TextFieldProps = TextInputProps & { | ||
| name: string | ||
| } | ||
| // TODO: rename to TextField and replace old usages | ||
| export const HarmonyTextField = (props: TextFieldProps) => { | ||
| const { name, ...other } = props | ||
| const [field, { touched, error }] = useField(name) | ||
| const hasError = Boolean(touched && error) | ||
| return ( | ||
| <TextInput | ||
| {...field} | ||
| error={hasError} | ||
| helperText={hasError ? error : undefined} | ||
| {...other} | ||
| /> | ||
| ) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| .root { | ||
| background-color: var(--harmony-white); | ||
| } | ||
| .logo { | ||
| max-height: 160px; | ||
| max-width: 160px; | ||
| height: 100%; | ||
| width: 100%; | ||
| object-fit: contain; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,34 @@ | ||
| import { useCallback } from 'react' | ||
| import { Button } from '@audius/harmony' | ||
| import { | ||
| Box, | ||
| Button, | ||
| Flex, | ||
| IconArrowRight, | ||
| IconVisibilityHidden, | ||
| Text | ||
| } from '@audius/harmony' | ||
| import { Button as ButtonTmp } from '@audius/stems' | ||
| import { Form, Formik } from 'formik' | ||
| import { useDispatch } from 'react-redux' | ||
| import { Link } from 'react-router-dom' | ||
| import audiusLogoColored from 'assets/img/audiusLogoColored.png' | ||
| import { signIn } from 'common/store/pages/signon/actions' | ||
| import { TextField } from 'components/form-fields' | ||
| import { HarmonyTextField } from 'components/form-fields/HarmonyTextField' | ||
| import PreloadImage from 'components/preload-image/PreloadImage' | ||
| import { PageWithAudiusValues } from 'pages/sign-on/components/desktop/PageWithAudiusValues' | ||
| import { SIGN_UP_PAGE } from 'utils/route' | ||
| import styles from './SignInPage.module.css' | ||
| const messages = { | ||
| header: 'Sign Into Audius', | ||
| title: 'Sign Into Audius', | ||
| emailLabel: 'Email', | ||
| passwordLabel: 'Password', | ||
| signIn: 'Sign In', | ||
| createAccount: 'Create An Account' | ||
| createAccount: 'Create An Account', | ||
| forgotPassword: 'Forgot password?' | ||
| } | ||
| type SignInValues = { | ||
| @@ -39,21 +52,74 @@ export const SignInPage = () => { | ||
| ) | ||
| return ( | ||
| <div> | ||
| <h1>{messages.header}</h1> | ||
| <Formik initialValues={initialValues} onSubmit={handleSubmit}> | ||
| <Form> | ||
| <TextField name='email' label={messages.emailLabel} /> | ||
| <TextField name='password' label={messages.passwordLabel} /> | ||
| <Button type='submit'> {messages.signIn} </Button> | ||
| </Form> | ||
| </Formik> | ||
| <ButtonTmp | ||
| // @ts-ignore | ||
| as={Link} | ||
| to={SIGN_UP_PAGE} | ||
| text={messages.createAccount} | ||
| /> | ||
| </div> | ||
| <Flex h='100%' alignItems='center' justifyContent='center'> | ||
| <PageWithAudiusValues> | ||
| <Flex | ||
| className={styles.root} | ||
| h='100%' | ||
| w={480} | ||
| // want 80px but don't have var for it | ||
| pv='4xl' | ||
| ph='2xl' | ||
| direction='column' | ||
| gap='2xl' | ||
| justifyContent='space-between' | ||
| > | ||
| {/* TODO: confirm 40px spacing value */} | ||
| <Flex direction='column' gap='2xl' alignItems='center'> | ||
| <PreloadImage | ||
| src={audiusLogoColored} | ||
| className={styles.logo} | ||
| alt='Audius Colored Logo' | ||
| /> | ||
| <Flex w='100%' direction='row' justifyContent='flex-start'> | ||
| <Text variant='heading' size='l' tag='h1' color='heading'> | ||
| {messages.title} | ||
| </Text> | ||
| </Flex> | ||
| <Formik initialValues={initialValues} onSubmit={handleSubmit}> | ||
| <Box w='100%'> | ||
| <Form> | ||
| <Flex direction='column' gap='2xl' w='100%'> | ||
| <Flex direction='column' gap='l'> | ||
| {/* TODO: replace old TextField */} | ||
| <HarmonyTextField | ||
| name='email' | ||
| label={messages.emailLabel} | ||
| /> | ||
| {/* TODO: password visibility icon and toggle */} | ||
| <HarmonyTextField | ||
| name='password' | ||
| label={messages.passwordLabel} | ||
| endIcon={IconVisibilityHidden} | ||
| type='password' | ||
| /> | ||
| </Flex> | ||
| <Flex direction='column' gap='l'> | ||
| <Button iconRight={IconArrowRight} type='submit'> | ||
| {messages.signIn} | ||
| </Button> | ||
| <Flex direction='row' alignItems='flexStart'> | ||
| <Text color='heading'> | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so is the idea here for the text to be type heading, and also render a react-navigation link? maybe we get together and develop a link component for harmony? ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah let's do it! ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gonna merge this then we can follow up with the fix | ||
| {/* TODO: link destination */} | ||
| <Link to={''}>{messages.forgotPassword}</Link> | ||
| </Text> | ||
| </Flex> | ||
| </Flex> | ||
| </Flex> | ||
| </Form> | ||
| </Box> | ||
| </Formik> | ||
| </Flex> | ||
| {/* TODO: switch to stems button when we have asChild support */} | ||
| <ButtonTmp | ||
| // @ts-ignore | ||
| as={Link} | ||
| to={SIGN_UP_PAGE} | ||
| text={messages.createAccount} | ||
| />{' '} | ||
| </Flex> | ||
| </PageWithAudiusValues> | ||
| </Flex> | ||
| ) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| .root { | ||
| box-shadow: var(--harmony-shadow-far); | ||
| /* TODO: should this be on box/flex? */ | ||
| overflow: hidden; | ||
| } | ||
| .valuesRoot { | ||
| background: radial-gradient( | ||
| 77.16% 77.16% at 50% 51.81%, | ||
| rgba(91, 35, 225, 0.8) 0%, | ||
| rgba(113, 41, 230, 0.64) 67.96%, | ||
| rgba(162, 47, 235, 0.5) 100% | ||
| ), | ||
| url('../../../../assets/img/2-DJ-4-3.jpg'), lightgray 50% / cover no-repeat; | ||
| background-position: -175px; | ||
| background-size: cover; | ||
| } | ||
| .valueRow, | ||
| .valuesRoot h1 { | ||
| color: var(--harmony-static-white); | ||
| } | ||
| .icon path { | ||
| fill: currentColor; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| import React, { PropsWithChildren } from 'react' | ||
| import { | ||
| Box, | ||
| Flex, | ||
| IconCloudUpload, | ||
| IconComponent, | ||
| IconHeadphones, | ||
| IconMessage, | ||
| Text | ||
| } from '@audius/harmony' | ||
| import styles from './PageWithAudiusValues.module.css' | ||
| type PageWithAudiusValuesProps = PropsWithChildren<{}> | ||
| const messages = { | ||
| heading: 'Your Music, Your Way', | ||
| unlimitedStreaming: 'Unlimited Streaming & Uploads', | ||
| directMessages: 'Message & Connect With Fans', | ||
| adFree: 'Ad-Free, Offline Listening' | ||
| } | ||
| export const PageWithAudiusValues = (props: PageWithAudiusValuesProps) => { | ||
| const { children } = props | ||
| return ( | ||
| <Flex | ||
| className={styles.root} | ||
| direction='row' | ||
| w={1280} | ||
| h={864} | ||
| borderRadius='l' | ||
| shadow='far' | ||
| > | ||
| {children} | ||
| <AudiusValues /> | ||
| </Flex> | ||
| ) | ||
| } | ||
| const AudiusValue = (props: { icon: IconComponent; text: string }) => { | ||
| const { icon: Icon, text } = props | ||
| return ( | ||
| <Flex | ||
| className={styles.valueRow} | ||
| direction='row' | ||
| gap='l' | ||
| alignItems='center' | ||
| > | ||
| <Icon className={styles.icon} /> | ||
| <Text variant='heading' size='xl'> | ||
| {text} | ||
| </Text> | ||
| </Flex> | ||
| ) | ||
| } | ||
| const AudiusValues = () => { | ||
| return ( | ||
| <Flex | ||
| className={styles.valuesRoot} | ||
| w={800} | ||
| h={864} | ||
| direction='column' | ||
| alignItems='center' | ||
| justifyContent='center' | ||
| > | ||
| <Flex direction='column' gap='xl'> | ||
| <Box pb='l'> | ||
| <Text variant='display' size='s' strength='strong'> | ||
| {messages.heading} | ||
| </Text> | ||
| </Box> | ||
| <AudiusValue | ||
| icon={IconCloudUpload} | ||
| text={messages.unlimitedStreaming} | ||
| /> | ||
| <AudiusValue icon={IconMessage} text={messages.directMessages} /> | ||
| <AudiusValue icon={IconHeadphones} text={messages.adFree} /> | ||
| </Flex> | ||
| </Flex> | ||
| ) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fun name :)