@@ -19,6 +19,7 @@ import {
19
19
PurchaseableContentType
20
20
} from '@audius/common/store'
21
21
import { getDogEarType , removeNullable } from '@audius/common/utils'
22
+ import { Flex , Text } from '@audius/harmony'
22
23
23
24
import {
24
25
CollectiblesPlaylistTableColumn ,
@@ -38,7 +39,8 @@ import styles from './CollectionPage.module.css'
38
39
39
40
const getMessages = ( collectionType : 'album' | 'playlist' ) => ( {
40
41
emptyPage : {
41
- owner : `This ${ collectionType } is empty. Start adding tracks to share it or make it public.` ,
42
+ ownerTitle : 'Nothing here yet' ,
43
+ ownerCta : 'Start adding tracks' ,
42
44
visitor : `This ${ collectionType } is empty...`
43
45
} ,
44
46
type : {
@@ -48,19 +50,24 @@ const getMessages = (collectionType: 'album' | 'playlist') => ({
48
50
remove : 'Remove from this'
49
51
} )
50
52
51
- const EmptyPage = ( props : {
53
+ type EmptyPageProps = {
52
54
text ?: string | null
53
55
isOwner : boolean
54
56
isAlbum : boolean
55
- } ) => {
56
- const messages = getMessages ( props . isAlbum ? 'album' : 'playlist' )
57
- const text =
58
- props . text ||
59
- ( props . isOwner ? messages . emptyPage . owner : messages . emptyPage . visitor )
57
+ }
58
+
59
+ const EmptyPage = ( props : EmptyPageProps ) => {
60
+ const { isAlbum , isOwner , text : textProp } = props
61
+ const messages = getMessages ( isAlbum ? 'album' : 'playlist' )
60
62
return (
61
- < div className = { styles . emptyWrapper } >
62
- < p className = { styles . emptyText } > { text } </ p >
63
- </ div >
63
+ < Flex p = '2xl' alignItems = 'center' direction = 'column' gap = 's' >
64
+ < Text variant = 'title' size = 'l' >
65
+ { textProp ?? isOwner
66
+ ? messages . emptyPage . ownerTitle
67
+ : messages . emptyPage . visitor }
68
+ </ Text >
69
+ { isOwner ? < Text size = 'l' > { messages . emptyPage . ownerCta } </ Text > : null }
70
+ </ Flex >
64
71
)
65
72
}
66
73
@@ -107,6 +114,7 @@ export type CollectionPageProps = {
107
114
) => void
108
115
onClickReposts ?: ( ) => void
109
116
onClickFavorites ?: ( ) => void
117
+ trackCount : number
110
118
}
111
119
112
120
const CollectionPage = ( {
@@ -134,7 +142,8 @@ const CollectionPage = ({
134
142
onReorderTracks,
135
143
onClickRemove,
136
144
onClickReposts,
137
- onClickFavorites
145
+ onClickFavorites,
146
+ trackCount
138
147
} : CollectionPageProps ) => {
139
148
const { status, metadata, user } = collection
140
149
@@ -147,7 +156,8 @@ const CollectionPage = ({
147
156
const queuedAndPlaying = playing && isQueued ( )
148
157
const queuedAndPreviewing = previewing && isQueued ( )
149
158
const tracksLoading =
150
- tracks . status === Status . LOADING || tracks . status === Status . IDLE
159
+ trackCount > 0 &&
160
+ ( tracks . status === Status . LOADING || tracks . status === Status . IDLE )
151
161
152
162
const coverArtSizes =
153
163
metadata && metadata ?. variant !== Variant . SMART
0 commit comments