File tree Expand file tree Collapse file tree
packages/web/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { getErrorMessage } from '@audius/common/utils'
99import {
1010 Button ,
1111 Flex ,
12+ IconImage ,
1213 IconPlaylists ,
1314 Modal ,
1415 ModalContent ,
@@ -149,6 +150,7 @@ export const CreatePlaylistModal = () => {
149150 imageProcessingError = { imageProcessingError }
150151 size = 'small'
151152 isUpload
153+ iconPlaceholder = { < IconImage size = '4xl' color = 'subdued' /> }
152154 />
153155 </ Flex >
154156 < TextInput
Original file line number Diff line number Diff line change 1+ import { ReactNode } from 'react'
2+
13export type UploadArtworkProps = {
24 className ?: string
35 artworkUrl ?: string
@@ -12,6 +14,8 @@ export type UploadArtworkProps = {
1214 isImageAutogenerated ?: boolean
1315 size : 'small' | 'large'
1416 isUpload ?: boolean
17+ /** Rendered centered over the gray empty state when no artwork is set. */
18+ iconPlaceholder ?: ReactNode
1519}
1620
1721declare const UploadArtwork = ( props : UploadArtworkProps ) => JSX . Element
Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ const UploadArtwork = ({
2121 onRemoveArtwork,
2222 defaultPopupOpen = false ,
2323 isImageAutogenerated = false ,
24- isUpload = false
24+ isUpload = false ,
25+ iconPlaceholder
2526} ) => {
2627 const [ processing , setProcessing ] = useState ( false )
2728 const [ showTip , setShowTip ] = useState ( false )
@@ -63,11 +64,14 @@ const UploadArtwork = ({
6364 className = { styles . artworkWrapper }
6465 style = { {
6566 backgroundImage : `url(${
66- artworkUrl || ( processing ? '' : placeholderArt )
67+ artworkUrl || ( processing || iconPlaceholder ? '' : placeholderArt )
6768 } )`
6869 } }
6970 >
7071 { processing ? < LoadingSpinner className = { styles . overlay } /> : null }
72+ { ! artworkUrl && ! processing && iconPlaceholder ? (
73+ < div className = { styles . iconPlaceholder } > { iconPlaceholder } </ div >
74+ ) : null }
7175 </ div >
7276 < div className = { styles . button } >
7377 < Toast
Original file line number Diff line number Diff line change 5353.overlay > div {
5454 width : 56px !important ;
5555}
56+
57+ .iconPlaceholder {
58+ position : absolute;
59+ inset : 0 ;
60+ display : flex;
61+ align-items : center;
62+ justify-content : center;
63+ pointer-events : none;
64+ }
You can’t perform that action at this time.
0 commit comments