Merge pull request #3 from sigonasr2/front-end

Fix minor bugs, add price.
master
sigonasr2 4 years ago committed by GitHub
commit 760c4d9c62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .gitignore
  2. 19
      itunes/src/App.js

1
.gitignore vendored

@ -0,0 +1 @@
node_modules

@ -26,6 +26,19 @@ const MediaContainer = (props) => {
//console.log(setPreview+","+sourceUrl)
setPreview(sourceUrl);
}
function formatDate(date) {
var d = new Date(date),
month = '' + (d.getMonth() + 1),
day = '' + d.getDate(),
year = d.getFullYear();
if (month.length < 2)
month = '0' + month;
if (day.length < 2)
day = '0' + day;
return [year, month, day].join('-');
}
return (
<div>
@ -35,7 +48,9 @@ const MediaContainer = (props) => {
<div className="row">
<div className="offset-md-2 col-md-6">
<h4>{media.trackName}</h4>
<b>{media.artistName} </b>: <span>{media.collectionName} </span>
<b>{media.artistName} </b>: <span>{media.collectionName}
<br/><br/>${media.trackPrice}<br/>{media.longDescription}
</span>
</div>
<div className="col-md-3 text-center">
<img className="shadow" src={media.artworkUrl100} alt={media.artistName}/>
@ -83,7 +98,7 @@ const App = () => {
</div>
</div>
<MediaContainer data={(searchQuery.length>0)?currentData.filter((song)=>{
return (song.trackName.toLowerCase().includes(searchQuery.toLowerCase())||song.collectionName.toLowerCase().includes(searchQuery.toLowerCase())||song.artistName.toLowerCase().includes(searchQuery.toLowerCase()))
return (song.trackName && song.trackName.toLowerCase().includes(searchQuery.toLowerCase())||song.collectionName && song.collectionName.toLowerCase().includes(searchQuery.toLowerCase())||song.artistName && song.artistName.toLowerCase().includes(searchQuery.toLowerCase()))
}):currentData} setPreview={setPreview}/>
<PreviewWindow src={currentPreview}/>
</div>

Loading…
Cancel
Save