-
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
Music Release Project #105
Open
gittebe
wants to merge
22
commits into
Technigo:main
Choose a base branch
from
gittebe: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 18 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
213eaf7
- added Album component and css
gittebe b769cfa
- added artist component
gittebe aa7bf93
- added component cover image
gittebe f762f06
- added the icons
gittebe 3a647b7
- css
gittebe 6d66c76
- css
gittebe 8e5662d
- defractured: dotsbutton, heartbutton and playbutton
gittebe f87a1d4
- CSS
gittebe 1494791
- hover effect
gittebe 3fde8bf
- hover effect of images and buttons
gittebe 25ac5ff
- linked album with external url
gittebe 16b2b47
- added links artists
gittebe 92820d5
- worked on CSS
gittebe b525581
- added url to play button with onClick; deleted link of coverimage
gittebe 9bce540
- css
gittebe 2f5c896
- css
gittebe 4b50764
- added sidebar
gittebe 0cac192
- added live view link
gittebe 5a3cd2e
- cleaned the code
gittebe c1f4497
- cleaned code and added README
gittebe de83afe
- updated README
gittebe 4968f3b
- updated README
gittebe 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
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,13 @@ | ||
import data from "./data.json"; | ||
import stretchgoals from "./stretch-goal.json" | ||
import { Album } from "./components/Album" | ||
|
||
console.log(data); | ||
console.log(stretchgoals) | ||
|
||
export const App = () => { | ||
return <div>Find me in src/app.jsx!</div>; | ||
return ( | ||
<> | ||
<Album /> | ||
</>) | ||
}; |
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,32 @@ | ||
import { albums } from "../data.json" | ||
import { AlbumName } from "./AlbumName" | ||
import { ArtistName } from "./ArtistName" | ||
import { CoverImage } from "./CoverImage" | ||
import { Header } from "./Header" | ||
import { Sidebar } from "./Sidebar" | ||
|
||
// Album | ||
export const Album = () => { | ||
return ( | ||
<> | ||
<Header /> | ||
<div className="main-container"> | ||
<div className="album-container"> | ||
{albums.items.map((album) => ( | ||
<div key={album.id} className="album-card"> | ||
<CoverImage | ||
coverImg={album.images.length > 0 ? album.images[0].url : 'fallback-image-url.jpg'} | ||
albumUrl={album.external_urls.spotify} | ||
/> | ||
<div className="album-info"> | ||
<AlbumName name={album.name} albumUrl={album.external_urls.spotify} /> | ||
<ArtistName artists={album.artists} artistsUrl={album.external_urls.spotify} /> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
<Sidebar /> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import PropTypes from 'prop-types' | ||
|
||
// Album Name | ||
export const AlbumName = ({ name, albumUrl }) => { | ||
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. Good practise to only pass along the data that this component needs to know about. |
||
return ( | ||
<div> | ||
<a | ||
href={albumUrl} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
className='album-name-a'> | ||
<h2 className="album-name">{name}</h2> | ||
</a> | ||
</div> | ||
) | ||
} | ||
|
||
|
||
// Define PropTypes for AlbumName | ||
AlbumName.propTypes = { | ||
name: PropTypes.string.isRequired, | ||
albumUrl: 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,40 @@ | ||
import PropTypes from 'prop-types' | ||
|
||
|
||
// Artist Name | ||
export const ArtistName = ({ artists }) => { | ||
return ( | ||
<div className='artists-container'> | ||
{artists.map((artist, index) => { | ||
let separator = ", "; | ||
if (artists.length === 2 && index === 0) { | ||
separator = " & "; | ||
} else if (index === artists.length - 2) { | ||
separator = " & "; | ||
} else if (index === artists.length - 1) { | ||
separator = ""; | ||
} | ||
|
||
|
||
return ( | ||
<span key={artist.id}> | ||
<a href={artist.external_urls.spotify} target="_blank" rel="noopener noreferrer" className='artist-name-a'> | ||
<h3 className='artist-name'>{artist.name + separator}</h3> | ||
</a> | ||
</span> | ||
) | ||
})} | ||
</div> | ||
) | ||
} | ||
|
||
|
||
ArtistName.propTypes = { | ||
artists: PropTypes.arrayOf( | ||
PropTypes.shape({ | ||
id: PropTypes.string.isRequired, | ||
name: PropTypes.string.isRequired, | ||
}) | ||
).isRequired, | ||
artistsUrl: 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,27 @@ | ||
import PropTypes from "prop-types" | ||
import { DotsButton } from "./DotsButton" | ||
import { HeartButton } from "./HeartButton" | ||
import { PlayButton } from "./PlayButton" | ||
|
||
|
||
export const CoverImage = ({ coverImg, albumUrl }) => { | ||
return ( | ||
<div className="cover-image-container"> | ||
<div className="cover-image"> | ||
<img className="cover-image-img" alt="Album Cover" src={coverImg} /> | ||
<div className="icon-container"> | ||
<HeartButton /> | ||
<PlayButton albumUrl={albumUrl} /> | ||
<DotsButton /> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
) | ||
} | ||
|
||
CoverImage.propTypes = { | ||
coverImg: PropTypes.string.isRequired, | ||
albumUrl: 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,11 @@ | ||
import dotsIcon from "../assets/icons/dots.svg" | ||
|
||
export const DotsButton = () => { | ||
return ( | ||
<span> | ||
<button type="button" aria-label="link to artist" className="dots-button"> | ||
<img src={dotsIcon} className="dots-icon" /> | ||
</button> | ||
</span> | ||
) | ||
} |
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 @@ | ||
|
||
|
||
export const Header = () => { | ||
return ( | ||
<header> | ||
<h1> | ||
New Vibes | ||
</h1> | ||
</header> | ||
) | ||
} |
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 heartIcon from "../assets/icons/heart.svg" | ||
|
||
export const HeartButton = () => { | ||
return ( | ||
<span className="heart-button-container"> | ||
<button type="button" aria-label="like" className="heart-button"> | ||
<img src={heartIcon} className="heart-icon" /> | ||
</button> | ||
</span> | ||
) | ||
} |
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,19 @@ | ||
import playIcon from "../assets/icons/play.svg" | ||
import PropTypes from "prop-types" | ||
|
||
export const PlayButton = ({ albumUrl }) => { | ||
const handlePlayClick = () => { | ||
window.open(albumUrl, "_blank", "noopener,noreferrer") | ||
} | ||
return ( | ||
<span className="play-button-container"> | ||
<button type="button" aria-label="play" className="play-button" onClick={handlePlayClick}> | ||
<img src={playIcon} className="play-icon" /> | ||
</button> | ||
</span> | ||
) | ||
} | ||
|
||
PlayButton.propTypes = { | ||
albumUrl: 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,18 @@ | ||
import { playlists } from "../stretch-goal.json" | ||
import { SidebarAlbum } from "./SidebarAlbum"; | ||
|
||
export const Sidebar = () => { | ||
return ( | ||
<div className="sidebar"> | ||
<h2 className="sidebar-header">Editor's Picks</h2> | ||
<div> | ||
{playlists.items.map((item) => ( | ||
<SidebarAlbum | ||
key={item.id} | ||
sidebarImg={item.images.length > 0 ? item.images[0].url : 'fallback-image-url.jpg'} | ||
/> | ||
))} | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import PropTypes from "prop-types" | ||
export const SidebarAlbum = ({ sidebarImg }) => { | ||
return ( | ||
<> | ||
<section className="sidebar-album-container"> | ||
<div className="cover-image-sidebar"> | ||
<img className="cover-image-sidebar-img" alt="Single Cover" src={sidebarImg} /> | ||
</div> | ||
</section> | ||
</> | ||
) | ||
} | ||
|
||
SidebarAlbum.propTypes = { | ||
sidebarImg: PropTypes.string.isRequired, | ||
} |
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.
great to use a fallback image