-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xings music libary #95
Open
xingyin2024
wants to merge
9
commits into
Technigo:main
Choose a base branch
from
xingyin2024:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b365eed
add readme, update App and add necessary components
xingyin2024 774fd9d
update the font style and icon place and size
xingyin2024 7d058f8
update color of icons
xingyin2024 3d37b86
update font style and card structure
xingyin2024 59d314a
create - add spotify logo and adjust the font size
xingyin2024 5443ce5
update - add netlify link
xingyin2024 6956364
create - add AlbumList to cleaner App component
xingyin2024 1bc72de
update - fix the white border of page and modify the style for album …
xingyin2024 25fb3f7
update - simplify style for album container
xingyin2024 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 |
---|---|---|
@@ -1,13 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Music Releases</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.jsx"></script> | ||
</body> | ||
</html> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Xings Spotify Music Releases</title> | ||
<!-- https://xingsmusiclibary.netlify.app --> | ||
</head> | ||
|
||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.jsx"></script> | ||
</body> | ||
|
||
</html> |
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,6 +1,5 @@ | ||
## Netlify link | ||
Add your Netlify link here. | ||
PS. Don't forget to add it in your readme as well. | ||
https://xingsmusiclibary.netlify.app | ||
|
||
## Collaborators | ||
Add any collaborators here, as well as in the title of the PR. | ||
chatGpt :> |
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,7 +1,20 @@ | ||
import data from "./data.json"; | ||
import Header from "./components/Header"; | ||
import Footer from "./components/Footer"; | ||
import { AlbumList } from "./components/AlbumList"; | ||
|
||
|
||
import './index.css'; | ||
|
||
|
||
console.log(data); | ||
|
||
export const App = () => { | ||
return <div>Find me in src/app.jsx!</div>; | ||
return ( | ||
<div className="App"> | ||
<Header /> | ||
<AlbumList albums={data.albums.items}/> | ||
<Footer /> | ||
</div> | ||
); | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,50 @@ | ||
import PropTypes from 'prop-types'; | ||
import { ArtistName } from './ArtistName'; | ||
import { CoverImage } from './CoverImage'; | ||
import { AlbumName } from './AlbumName'; | ||
|
||
export const Album = ({ album }) => { | ||
return ( | ||
<div className="album-card"> | ||
<CoverImage imageUrl={album.images[0].url} /> | ||
<div className="album-info"> | ||
<div className="album-name"> | ||
<AlbumName name={album.name} url={album.external_urls.spotify} /> | ||
</div> | ||
<div className="artist-name"> | ||
{album.artists.map((artist, index) => ( | ||
<ArtistName | ||
key={artist.id} | ||
name={artist.name} | ||
url={artist.external_urls.spotify} | ||
isLast={index === album.artists.length - 1} | ||
/> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
Album.propTypes = { | ||
album: PropTypes.shape({ | ||
name: PropTypes.string.isRequired, | ||
images: PropTypes.arrayOf( | ||
PropTypes.shape({ | ||
url: PropTypes.string.isRequired, | ||
}) | ||
).isRequired, | ||
external_urls: PropTypes.shape({ | ||
spotify: PropTypes.string.isRequired, | ||
}).isRequired, | ||
artists: PropTypes.arrayOf( | ||
PropTypes.shape({ | ||
name: PropTypes.string.isRequired, | ||
external_urls: PropTypes.shape({ | ||
spotify: PropTypes.string.isRequired, | ||
}).isRequired, | ||
}) | ||
).isRequired, | ||
}).isRequired, | ||
}; | ||
|
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,16 @@ | ||
import PropTypes from 'prop-types'; | ||
import { Album } from './Album'; | ||
|
||
export const AlbumList = ({ albums }) => { | ||
return ( | ||
<div className="album-container"> | ||
{albums.map((album) => ( | ||
<Album key={album.id} album={album} /> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
AlbumList.propTypes = { | ||
albums: PropTypes.arrayOf(PropTypes.object).isRequired, | ||
}; | ||
Comment on lines
+14
to
+16
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. Again, prop types is nice to understand. But we haven't really gone thru it yet. |
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,20 @@ | ||
import PropTypes from 'prop-types'; | ||
|
||
export const AlbumName = ({ name, url }) => { | ||
return ( | ||
<a | ||
href={url} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
className="album-name" | ||
> | ||
{name} | ||
</a> | ||
); | ||
}; | ||
|
||
AlbumName.propTypes = { | ||
name: PropTypes.string.isRequired, | ||
url: PropTypes.string.isRequired, | ||
}; | ||
|
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,23 @@ | ||
import PropTypes from 'prop-types'; | ||
|
||
export const ArtistName = ({ name, url, isLast }) => { | ||
return ( | ||
<> | ||
<a | ||
href={url} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
className="artist-name" | ||
> | ||
{name} | ||
</a> | ||
{!isLast && ', '} | ||
</> | ||
); | ||
}; | ||
|
||
ArtistName.propTypes = { | ||
name: PropTypes.string.isRequired, | ||
url: PropTypes.string.isRequired, | ||
isLast: PropTypes.bool.isRequired, | ||
}; |
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,28 @@ | ||
import PropTypes from 'prop-types'; | ||
import dotsIcon from '../assets/icons/dots.svg'; | ||
import heartIcon from '../assets/icons/heart.svg'; | ||
import playIcon from '../assets/icons/play.svg'; | ||
|
||
export const CoverImage = ({ imageUrl }) => { | ||
return ( | ||
<div className="cover-image-wrapper"> | ||
<img src={imageUrl} alt="Album cover" className="cover-image" /> | ||
<div className="hover-buttons"> | ||
<button className="hover-button"> | ||
<img src={heartIcon} alt="Favorite" className="heartIcon" /> | ||
</button> | ||
<button className="hover-button"> | ||
<img src={playIcon} alt="Play" className="playIcon" /> | ||
</button> | ||
<button className="hover-button"> | ||
<img src={dotsIcon} alt="More options" className="dotsIcon" /> | ||
</button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
CoverImage.propTypes = { | ||
imageUrl: PropTypes.string.isRequired, | ||
}; | ||
|
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,10 @@ | ||
const Footer = () => { | ||
return ( | ||
<footer> | ||
<p>© 2024 XingS Music APP. All rights reserved.</p> | ||
<p>Source from Spotify API</p> | ||
</footer> | ||
); | ||
}; | ||
|
||
export default Footer; |
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,15 @@ | ||
import spotifyIcon from '../assets/icons/spotify.svg'; | ||
|
||
const Header = () => { | ||
return ( | ||
<header> | ||
<h1 className="header"> | ||
<img src={spotifyIcon} alt="Spotify Logo" className="spotifyIcon" /> | ||
New albums and single releases | ||
</h1> | ||
<p>Find you next Favorite</p> | ||
</header> | ||
); | ||
}; | ||
|
||
export default Header; |
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.
Do you understand this part? We have not gone through it. It's important that you understand the code, even though you've gotten help from your collaborator. :)