-
Notifications
You must be signed in to change notification settings - Fork 111
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
[PROTO-1787] Add full screen oauth variant #8233
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { FormEvent, useLayoutEffect, useState } from 'react' | ||
import { FormEvent, useState } from 'react' | ||
|
||
import { Name, ErrorLevel } from '@audius/common/models' | ||
import { accountSelectors, signOutActions } from '@audius/common/store' | ||
|
@@ -35,12 +35,6 @@ const { signOut } = signOutActions | |
const { getAccountUser } = accountSelectors | ||
|
||
export const OAuthLoginPage = () => { | ||
useLayoutEffect(() => { | ||
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. handled in css |
||
document.body.classList.add(styles.bgWhite) | ||
return () => { | ||
document.body.classList.remove(styles.bgWhite) | ||
} | ||
}, []) | ||
const record = useRecord() | ||
const account = useSelector(getAccountUser) | ||
const isLoggedIn = Boolean(account) | ||
|
@@ -156,7 +150,8 @@ export const OAuthLoginPage = () => { | |
appImage, | ||
userEmail, | ||
authorize, | ||
txParams | ||
txParams, | ||
display | ||
} = useOAuthSetup({ | ||
onError: handleAuthError, | ||
onPendingTransactionApproval: handlePendingTransactionApproval, | ||
|
@@ -247,7 +242,7 @@ export const OAuthLoginPage = () => { | |
|
||
if (queryParamsError) { | ||
return ( | ||
<ContentWrapper> | ||
<ContentWrapper display={display}> | ||
<div className={cn(styles.centeredContent, styles.titleContainer)}> | ||
<span className={styles.errorText}>{queryParamsError}</span> | ||
</div> | ||
|
@@ -256,7 +251,7 @@ export const OAuthLoginPage = () => { | |
} | ||
if (loading) { | ||
return ( | ||
<ContentWrapper> | ||
<ContentWrapper display={display}> | ||
<div | ||
className={cn(styles.centeredContent, styles.loadingStateContainer)} | ||
> | ||
|
@@ -271,7 +266,7 @@ export const OAuthLoginPage = () => { | |
} | ||
|
||
return ( | ||
<ContentWrapper> | ||
<ContentWrapper display={display}> | ||
<Flex alignItems='center' direction='column'> | ||
<Flex gap='l' alignItems='center' mb='l'> | ||
<Flex h='88px' w='88px'> | ||
|
31 changes: 28 additions & 3 deletions
31
packages/web/src/pages/oauth-login-page/components/ContentWrapper.tsx
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 |
---|---|---|
@@ -1,9 +1,34 @@ | ||
import { ReactNode } from 'react' | ||
|
||
import { Paper } from '@audius/harmony' | ||
import cn from 'classnames' | ||
|
||
import styles from '../OAuthLoginPage.module.css' | ||
import { Display } from '../types' | ||
|
||
export const ContentWrapper = ({ children }: { children: ReactNode }) => ( | ||
<div className={styles.wrapper}> | ||
<div className={styles.container}>{children}</div> | ||
export const ContentWrapper = ({ | ||
display, | ||
children | ||
}: { | ||
display: Display | ||
children: ReactNode | ||
}) => ( | ||
<div className={cn(styles.wrapper, { [styles.popup]: display === 'popup' })}> | ||
{display === 'popup' ? ( | ||
<div className={styles.container}>{children}</div> | ||
) : ( | ||
<Paper | ||
shadow='mid' | ||
w='375px' | ||
direction='column' | ||
pv='3xl' | ||
ph='xl' | ||
mv='3xl' | ||
alignSelf='flex-start' | ||
borderRadius='xl' | ||
> | ||
{children} | ||
</Paper> | ||
)} | ||
</div> | ||
) |
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
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 @@ | ||
export type Display = 'popup' | 'fullScreen' |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe use
--harmony-bg-white
, so that it's not stuck on white if the user is in dark mode?Only matters if the rest of this supports themes though.
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.
og design had it static white, so i kept as is!