Skip to content

Commit

Permalink
Merge pull request #43 from kyan/tracklist_size
Browse files Browse the repository at this point in the history
Update tracklist size for played items
  • Loading branch information
whomwah authored Feb 6, 2018
2 parents 56e0ca5 + e268c4f commit b9b3f5a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ exports[`Tracklist render renders the as expected 1`] = `
ui={true}
/>
</span>
<ListContent>
<ListContent
className=""
>
<ListHeader
as="h3"
>
Expand Down Expand Up @@ -67,7 +69,9 @@ exports[`Tracklist render renders the as expected 1`] = `
</RevealContent>
</Reveal>
</a>
<ListContent>
<ListContent
className=""
>
<ListHeader
as="h5"
>
Expand Down
12 changes: 10 additions & 2 deletions frontend/src/components/tracklist/index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
.current-track {
border-left: 4px solid #21ba45;
padding-left: 3px;
padding-left: 5px;
}

.track-info {
font-size: 80%;
}

.ui.list>.item .track-info .header {
font-size: 1.2em;
margin-bottom: 0.2em;
}
18 changes: 15 additions & 3 deletions frontend/src/components/tracklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ const trackStartTime = (time, isCurrent) => {
return <List.Header as='h5'>{dateformat(new Date(time), 'h:MM')}</List.Header>
}

const trackHeading = (track) => (
<List.Header as='h3'>{track.name}</List.Header>
)

const trackDescription = (track) => (
<List.Description>
{track.artist.name} <small>({millisToMinutesAndSeconds(track.length)})</small>
</List.Description>
)

const listItems = (tracks, images, currentTrack, onRemoveTrack) => {
let time

Expand All @@ -81,10 +91,12 @@ const listItems = (tracks, images, currentTrack, onRemoveTrack) => {
key={`${index}-${track.uri}`}
>
{imageChooser(track, images, isCurrent, onRemoveTrack)}
<List.Content>
<List.Content
className={classnames({'track-info': !time})}
>
{trackStartTime(time, isCurrent)}
<List.Header as='h3'>{track.name}</List.Header>
<List.Description>{track.artist.name} <small>({millisToMinutesAndSeconds(track.length)})</small></List.Description>
{trackHeading(track)}
{trackDescription(track)}
</List.Content>
</List.Item>
)
Expand Down

0 comments on commit b9b3f5a

Please sign in to comment.