Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/harmony/src/components/layout/Paper/index.ts
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
export { Paper } from './Paper'
export { type PaperProps } from './types'
3 changes: 1 addition & 2 deletions packages/web/src/app/web-player/App.module.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -58,12 +58,11 @@ body {
}

.mainContentWrapperMobile {
min-height: 100vh;
min-height: calc(100vh - calc(env(safe-area-inset-top, 0px) + 40px));
position: relative;
margin-left: 0px;
overflow-y: visible;
overflow-x: visible;
margin-top: 40px;
margin-top: calc(env(safe-area-inset-top, 0px) + 40px);
margin-bottom: 0;
}
4 changes: 1 addition & 3 deletions packages/web/src/components/summary-table/SummaryTable.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -54,9 +54,7 @@ export const SummaryTable = ({
{withRadioOptions ? <RadioButton value={id} /> : null}
{Icon ? (
<Box ml='s'>
<Icon
color='default'
/>
<Icon color='default' />
</Box>
) : null}
<Text>{label}</Text>
Expand Down
13 changes: 10 additions & 3 deletions packages/web/src/pages/sign-in-page/SignInPageDesktop.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,8 +7,12 @@ import audiusLogoColored from 'assets/img/audiusLogoColored.png'
import { HarmonyPasswordField } from 'components/form-fields/HarmonyPasswordField'
import { HarmonyTextField } from 'components/form-fields/HarmonyTextField'
import PreloadImage from 'components/preload-image/PreloadImage'
import {
ArtworkContainer,
AudiusValues
} from 'pages/sign-on/components/AudiusValues'
import { LeftContentContainer } from 'pages/sign-on/components/desktop/LeftContentContainer'
import { PageWithAudiusValues } from 'pages/sign-on/components/desktop/PageWithAudiusValues'
import { SignOnContainerDesktop } from 'pages/sign-on/components/desktop/SignOnContainerDesktop'
import { SIGN_UP_PAGE } from 'utils/route'

import styles from './SignInPage.module.css'
Expand All@@ -25,7 +29,7 @@ const messages = {
export const SignInPageDesktop = () => {
return (
<Flex h='100%' alignItems='center' justifyContent='center'>
<PageWithAudiusValues>
<SignOnContainerDesktop>
<LeftContentContainer gap='2xl' justifyContent='space-between'>
{/* TODO: confirm 40px spacing value */}
<Flex direction='column' gap='2xl' alignItems='center'>
Expand DownExpand Up@@ -76,7 +80,10 @@ export const SignInPageDesktop = () => {
text={messages.createAccount}
/>{' '}
</LeftContentContainer>
</PageWithAudiusValues>
<ArtworkContainer>
<AudiusValues />
</ArtworkContainer>
</SignOnContainerDesktop>
</Flex>
)
}
116 changes: 58 additions & 58 deletions packages/web/src/pages/sign-in-page/SignInPageMobile.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,6 +11,8 @@ import { Link } from 'react-router-dom'

import { HarmonyPasswordField } from 'components/form-fields/HarmonyPasswordField'
import { HarmonyTextField } from 'components/form-fields/HarmonyTextField'
import { ArtworkContainer } from 'pages/sign-on/components/AudiusValues'
import { SignOnContainerMobile } from 'pages/sign-on/components/mobile/SignOnContainerMobile'

import styles from './SignInPageMobile.module.css'

Expand All@@ -26,65 +28,63 @@ const messages = {

export const SignInPageMobile = () => {
return (
<Flex
className={styles.root}
direction='column'
w='100%'
h='100%'
justifyContent='space-between'
pb='4xl'
>
<Flex
className={styles.content}
w='100%'
pv='2xl'
ph='l'
direction='column'
gap='2xl'
justifyContent='space-between'
>
<Flex direction='column' gap='2xl' alignItems='center'>
<IconAudiusLogoHorizontalColor />
<Text variant='heading' size='l' tag='h1' color='heading'>
{messages.title}
</Text>
<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} />
<HarmonyPasswordField
name='password'
label={messages.passwordLabel}
/>
<SignOnContainerMobile>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SignOn or SignIn? or is it used for sign-up and sign-in?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! Used it for both sign up/in, so I named it SignOn

<ArtworkContainer justifyContent='space-between'>
<Flex
className={styles.content}
w='100%'
pv='2xl'
ph='l'
direction='column'
gap='2xl'
justifyContent='space-between'
>
<Flex direction='column' gap='2xl' alignItems='center'>
<IconAudiusLogoHorizontalColor />
<Text variant='heading' size='l' tag='h1' color='heading'>
{messages.title}
</Text>
<Box w='100%'>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Box as=Form ?

<Form>
<Flex direction='column' gap='2xl' w='100%'>
<Flex direction='column' gap='l'>
{/* TODO: replace old TextField */}
<HarmonyTextField
name='email'
label={messages.emailLabel}
/>
<HarmonyPasswordField
name='password'
label={messages.passwordLabel}
/>
</Flex>
<Flex direction='column' gap='l'>
<Button iconRight={IconArrowRight} type='submit'>
{messages.signIn}
</Button>
<Text color='heading' variant='body'>
{/* TODO: link destination */}
{messages.forgotPassword}
</Text>
</Flex>
</Flex>
<Flex direction='column' gap='l'>
<Button iconRight={IconArrowRight} type='submit'>
{messages.signIn}
</Button>
<Text color='heading' variant='body'>
{/* TODO: link destination */}
{messages.forgotPassword}
</Text>
</Flex>
</Flex>
</Form>
</Box>
</Form>
</Box>
</Flex>
</Flex>
<Flex
className={styles.createAccountRow}
direction='row'
w='100%'
justifyContent='center'
gap='xs'
mb='4xl'
>
{/* TODO: args look good but style doesn't match design */}
<Text variant='title'>{messages.newToAudius}</Text>
<Link to={''}>{messages.createAccount}</Link>
</Flex>
</Flex>
<Flex
className={styles.createAccountRow}
direction='row'
w='100%'
justifyContent='center'
gap='xs'
mb='4xl'
>
{/* TODO: args look good but style doesn't match design */}
<Text variant='title'>{messages.newToAudius}</Text>
<Link to={''}>{messages.createAccount}</Link>
</Flex>
</Flex>
</ArtworkContainer>
</SignOnContainerMobile>
)
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
.artworkBackground {
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;
}

.artworkBackground.desktop {
width: 800px;
height: 864px;
background-position: -175px;
background-size: cover;
}

.artworkBackground.mobile {
width: 100%;
height: 100%;
background-size: auto 100%;
background-position: 50%;
gap: var(--harmony-spacing-2xl);
}

.valueRow,
.artworkBackground h1 {
color: var(--harmony-static-white);
}

.icon path {
fill: currentColor;
}
96 changes: 96 additions & 0 deletions packages/web/src/pages/sign-on/components/AudiusValues.tsx
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
import React, { PropsWithChildren } from 'react'

import {
Box,
Flex,
FlexProps,
IconCloudUpload,
IconComponent,
IconHeadphones,
IconMessage,
Text
} from '@audius/harmony'
import cn from 'classnames'

import { useMedia } from 'hooks/useMedia'

import styles from './AudiusValues.module.css'

const messages = {
heading: 'Your Music, Your Way',
unlimitedStreaming: 'Unlimited Streaming & Uploads',
directMessages: 'Message & Connect With Fans',
adFree: 'Ad-Free, Offline Listening'
}

/**
*
* @param param0
* @returns
*/
export const ArtworkContainer = ({
children,
...rest
}: PropsWithChildren<FlexProps>) => {
const { isDesktop } = useMedia()
return (
<Flex
className={cn(
styles.artworkBackground,
styles[isDesktop ? 'desktop' : 'mobile']
)}
direction='column'
justifyContent={isDesktop ? 'center' : 'flex-start'}
{...rest}
>
{children}
</Flex>
)
}

/**
* Each individual audius value text + icon row
*/
type AudiusValueProps = { icon: IconComponent; text: string }
const AudiusValue = (props: AudiusValueProps) => {
const { icon: Icon, text } = props
const { isDesktop } = useMedia()
return (
<Flex
className={styles.valueRow}
direction='row'
gap='l'
alignItems='center'
>
<Icon className={styles.icon} />
<Text
variant={isDesktop ? 'heading' : 'title'}
size={isDesktop ? 'xl' : 'l'}
strength={isDesktop ? 'default' : 'weak'}
>
{text}
</Text>
</Flex>
)
}

/**
* Renders all the audius values
*/
export const AudiusValues = () => {
const { isDesktop } = useMedia()
return (
<Flex direction='column' gap={isDesktop ? 'xl' : 'l'} alignItems='center'>
{isDesktop ? (
<Box pb='l'>
<Text variant='display' size='s' strength='strong'>
{messages.heading}
</Text>
</Box>
) : null}
<AudiusValue icon={IconCloudUpload} text={messages.unlimitedStreaming} />
<AudiusValue icon={IconMessage} text={messages.directMessages} />
<AudiusValue icon={IconHeadphones} text={messages.adFree} />
</Flex>
)
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
.root {
background-color: var(--harmony-white);
text-align: left;
height: max-content;
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
import { HTMLAttributes, PropsWithChildren } from 'react'

import { Flex, FlexProps } from '@audius/harmony'
import cn from 'classnames'

import styles from './MobileContentContainer.module.css'

export type MobileContentContainerProps = PropsWithChildren<FlexProps> &

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems we really only use children + className, can prob just say "FlexProps" ?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I tried just FlexProps but it didnt bring in children for some reason 🤷

@DejayJDDejayJDNov 15, 2023

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see why. It's because the FlexProps type doesn't include the React/html props that Emotion adds for us. So FlexProps is basically just our custom types. A little odd but it makes sense I guess 🤔
Wondering if we should update that type to reflect the html stuff too or leave that for defining like this 🤔

@dylanjeffersdylanjeffersNov 15, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question... i wonder if emotion is also able to check the children type from the as= as well, so it might be dangerous setting children in flex props.... pretty annoying though

HTMLAttributes<HTMLDivElement>

export const MobileContentContainer = ({

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

container for this
image

children,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be a bit silly, but i like const Component => (props: PropType) { ...with the destructure in body. do you have a preference?

className
}: MobileContentContainerProps) => {
return (
<Flex
className={cn(className, styles.root)}
Comment thread
DejayJD marked this conversation as resolved.
ph='l'
pv='2xl'
direction='column'
gap='2xl'
alignItems='center'
w='100%'
>
{children}
</Flex>
)
}

This file was deleted.

Loading