forked from andrewngu/sound-redux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
162 additions
and
62 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 was deleted.
Oops, something went wrong.
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,17 @@ | ||
import React, {Component, PropTypes} from 'react'; | ||
|
||
class MobileNav extends Component { | ||
render() { | ||
const {playlist} = this.props; | ||
|
||
return ( | ||
<div className='mobile-nav'> | ||
<div className='mobile-nav-itm'> | ||
{'Hello'} | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default MobileNav; |
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,11 @@ | ||
import React, {Component, PropTypes} from 'react'; | ||
|
||
class MobilePlayer extends Component { | ||
render() { | ||
return ( | ||
<div></div> | ||
); | ||
} | ||
} | ||
|
||
export default MobilePlayer; |
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,24 @@ | ||
import React, {Component, PropTypes} from 'react'; | ||
import {getImageUrl} from '../utils/SongUtils'; | ||
|
||
class MobileSongListItem extends Component { | ||
render() { | ||
const {song, user} = this.props; | ||
|
||
return ( | ||
<div> | ||
<img src={getImageUrl(song.artwork_url)} /> | ||
<div> | ||
<div> | ||
{song.title} | ||
</div> | ||
<div> | ||
{user.username} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default MobileSongListItem; |
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,40 @@ | ||
import React, {Component, PropTypes} from 'react'; | ||
import {fetchSongsIfNeeded} from '../actions/playlists'; | ||
import MobileSongListItem from '../components/MobileSongListItem'; | ||
|
||
class MobileSongs extends Component { | ||
componentWillMount() { | ||
const {dispatch, playlist, playlists} = this.props; | ||
if (!(playlist in playlists) || playlists[playlist].items.length === 0) { | ||
dispatch(fetchSongsIfNeeded(playlist)); | ||
} | ||
} | ||
|
||
componentWillReceiveProps(nextProps) { | ||
const {dispatch, playlist, playlists} = this.props; | ||
if (playlist !== nextProps.playlist) { | ||
if (!(nextProps.playlist in playlists) || playlists[nextProps.playlist].items.length === 0) { | ||
dispatch(fetchSongsIfNeeded(nextProps.playlist)); | ||
} | ||
} | ||
} | ||
|
||
renderSongsListItems() { | ||
const {playlist, playlists, songs, users} = this.props; | ||
return playlists[playlist].items.map(songId => { | ||
const song = songs[songId]; | ||
const user = users[song.user_id]; | ||
return <MobileSongListItem song={song} user={user} /> | ||
}); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className='mobile-songs'> | ||
{this.renderSongsListItems()} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default MobileSongs; |
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
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
@import 'custom/custom'; | ||
@import 'mobile/mobile'; | ||
@import 'ionicons/ionicons'; |
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,5 @@ | ||
.mobile { | ||
display: flex; | ||
flex-direction: column; | ||
overflow: hidden; | ||
} |
Oops, something went wrong.