This repository has been archived by the owner on Oct 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
[C-2911] Update new select page of the upload flow #3910
Merged
Merged
Changes from all commits
Commits
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { HarmonyButton, HarmonyButtonType, IconTrash } from '@audius/stems' | ||
import numeral from 'numeral' | ||
|
||
import iconFileAiff from 'assets/img/iconFileAiff.svg' | ||
import iconFileFlac from 'assets/img/iconFileFlac.svg' | ||
import iconFileMp3 from 'assets/img/iconFileMp3.svg' | ||
import iconFileOgg from 'assets/img/iconFileOgg.svg' | ||
import iconFileUnknown from 'assets/img/iconFileUnknown.svg' | ||
import iconFileWav from 'assets/img/iconFileWav.svg' | ||
import { Text } from 'components/typography' | ||
|
||
import styles from './TrackPreview.module.css' | ||
|
||
const fileTypeIcon = (type: string) => { | ||
switch (type) { | ||
case 'audio/mpeg': | ||
case 'audio/mp3': | ||
return iconFileMp3 | ||
case 'audio/aiff': | ||
return iconFileAiff | ||
case 'audio/flac': | ||
return iconFileFlac | ||
case 'audio/ogg': | ||
return iconFileOgg | ||
case 'audio/wav': | ||
return iconFileWav | ||
default: | ||
return iconFileUnknown | ||
} | ||
} | ||
|
||
type TrackPreviewProps = { | ||
fileType: string | ||
trackTitle: string | ||
fileSize: number | ||
index: number | ||
displayIndex: boolean | ||
onRemove: () => void | ||
} | ||
|
||
export const TrackPreviewNew = (props: TrackPreviewProps) => { | ||
const { | ||
displayIndex = false, | ||
index, | ||
fileType = 'audio/mp3', | ||
trackTitle = 'Untitled', | ||
fileSize, | ||
onRemove | ||
} = props | ||
|
||
const fileExtension = fileType.split('/')[1] ?? null | ||
|
||
return ( | ||
<div className={styles.trackPreviewNew}> | ||
{displayIndex ? ( | ||
<Text className={styles.indexText} size='small'> | ||
{index + 1} | ||
</Text> | ||
) : null} | ||
<img | ||
className={styles.trackPreviewImage} | ||
src={fileTypeIcon(fileType)} | ||
alt='File type icon' | ||
/> | ||
<Text className={styles.titleText} size='small'> | ||
{trackTitle} | ||
{fileExtension ? `.${fileExtension}` : null} | ||
</Text> | ||
<Text className={styles.fileSizeText} size='small' color='neutralLight2'> | ||
{numeral(fileSize).format('0.0 b')} | ||
</Text> | ||
<HarmonyButton | ||
variant={HarmonyButtonType.PLAIN} | ||
iconRight={IconTrash} | ||
onClick={onRemove} | ||
className={styles.removeButton} | ||
/> | ||
</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 |
---|---|---|
|
@@ -59,3 +59,43 @@ | |
.tabSlider { | ||
margin-bottom: 15px; | ||
} | ||
|
||
.containerNew { | ||
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. same here, but whatever you think is easiest to reason about, whether these are in a new file so its easy to remove the old code eventually. 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. yea i've been updating things with the thought that we would remove old stuff later |
||
display: flex; | ||
flex-direction: column; | ||
/* TODO: KJ - Figure out if we need this */ | ||
max-height: 600px; | ||
width: 100%; | ||
user-select: none; | ||
border-radius: 8px; | ||
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.08), | ||
0px 0px 4px 0px rgba(0, 0, 0, 0.04); | ||
} | ||
|
||
.infoContainerNew { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
width: 100%; | ||
padding: 16px; | ||
background-color: var(--background-surface-1); | ||
} | ||
|
||
.headerContainerNew { | ||
border-bottom: 1px solid var(--border-strong); | ||
border-radius: 8px 8px 0 0; | ||
} | ||
|
||
.footerContainerNew { | ||
border-top: 1px solid var(--border-strong); | ||
border-radius: 0 0 8px 8px; | ||
} | ||
|
||
.tracksContainerNew { | ||
display: flex; | ||
padding: 16px 0; | ||
flex-direction: column; | ||
background-color: var(--background-white); | ||
/* TODO: KJ - Figure out if we need this */ | ||
/* max-height: 467px; */ | ||
} |
Oops, something went wrong.
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.
would we want to split up the css files too?