-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
b65db45
commit c2d0289
Showing
8 changed files
with
116 additions
and
43 deletions.
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