-
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
[PAY-2730] Artist Dashboard empty tab states #8192
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4b41b3a
[PAY-2730] Artist Dashboard empty tab states
dharit-tan d3ee2b9
empty search results
dharit-tan 57a47cc
Merge remote-tracking branch 'origin/main' into rt-empty
dharit-tan a407b8e
restore deleted styles
dharit-tan 6193266
sneak in kebab menu size change
dharit-tan e4f733b
switch icons, always show pills
dharit-tan 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
16 changes: 16 additions & 0 deletions
16
packages/web/src/pages/dashboard-page/components/EmptySearchResults.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Flex, IconSearch, Text } from '@audius/harmony' | ||
|
||
const messages = { | ||
noResults: 'No results match your search' | ||
} | ||
|
||
export const EmptySearchResults = () => { | ||
return ( | ||
<Flex w='100%' direction='column' alignItems='center' p='unit10' gap='l'> | ||
<IconSearch size='3xl' color='subdued' /> | ||
<Text variant='heading' size='s'> | ||
{messages.noResults} | ||
</Text> | ||
</Flex> | ||
) | ||
} |
52 changes: 52 additions & 0 deletions
52
packages/web/src/pages/dashboard-page/components/EmptyTabState.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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { useCallback } from 'react' | ||
|
||
import { Name } from '@audius/common/models' | ||
import { Button, Flex, IconAlbum, IconNote, Text } from '@audius/harmony' | ||
import { push as pushRoute } from 'connected-react-router' | ||
import { useDispatch } from 'react-redux' | ||
import { Link } from 'react-router-dom' | ||
|
||
import { track, make } from 'services/analytics' | ||
import { UPLOAD_ALBUM_PAGE, UPLOAD_PAGE } from 'utils/route' | ||
|
||
const messages = { | ||
header: (type: 'track' | 'album') => `You haven't uploaded any ${type}s yet`, | ||
label: (type: 'track' | 'album') => | ||
`Upload a${type === 'album' ? 'n' : ''} ${type} and it will appear here.`, | ||
upload: 'Upload' | ||
} | ||
|
||
export const EmptyTabState = ({ type }: { type: 'track' | 'album' }) => { | ||
const dispatch = useDispatch() | ||
|
||
const handleUpload = useCallback(() => { | ||
dispatch(pushRoute(type === 'track' ? UPLOAD_PAGE : UPLOAD_ALBUM_PAGE)) | ||
track( | ||
make({ | ||
eventName: Name.TRACK_UPLOAD_OPEN, | ||
source: 'dashboard' | ||
}) | ||
) | ||
}, [dispatch, type]) | ||
|
||
return ( | ||
<Flex w='100%' direction='column' alignItems='center' p='unit10' gap='2xl'> | ||
{type === 'track' ? ( | ||
<IconNote size='3xl' color='subdued' /> | ||
) : ( | ||
<IconAlbum size='3xl' color='subdued' /> | ||
)} | ||
<Flex gap='l' direction='column' alignItems='center'> | ||
<Text variant='heading' size='s'> | ||
{messages.header(type)} | ||
</Text> | ||
<Text variant='body' size='l'> | ||
{messages.label(type)} | ||
</Text> | ||
</Flex> | ||
<Button variant='secondary' size='small' asChild onClick={handleUpload}> | ||
<Link to={UPLOAD_PAGE}>{messages.upload}</Link> | ||
</Button> | ||
</Flex> | ||
) | ||
} |
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
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.
Is unit10 the desired padding? Just checking since it's a non-standard number.
Usually if it's that big we're ok with one of the standard sizes or else relying on centering for alignment
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.
yep mocks say 40px 🤷
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.
could just do
pv
and then rely onalignItems
but at that point doesn't really matter