-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* first commit * fixed: filter & songlist
- Loading branch information
1 parent
25b6e98
commit 15fe269
Showing
8 changed files
with
172 additions
and
69 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 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,11 +1,11 @@ | ||
const FilterButtonAlbum = ({albumFilterFunc, setPop, isPopped}) => { | ||
const FilterButtonAlbum = ({ albumFilterFunc, setPopAlbum, isPoppedAlbum }) => { | ||
|
||
function booleanValuefunc() { | ||
setPopAlbum(!isPoppedAlbum) | ||
albumFilterFunc(isPoppedAlbum); | ||
} | ||
|
||
|
||
return ( | ||
<button onClick={() => albumFilterFunc(setPop(!isPopped)) }> | ||
FilterButtonAlbum | ||
</button> | ||
) | ||
} | ||
return <button onClick={() => booleanValuefunc()}>FilterButtonAlbum</button>; | ||
}; | ||
|
||
export default FilterButtonAlbum; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import SongList from "../../components/SongsList"; | ||
import styles from "./styles.module.scss"; | ||
import StarRating from '../../components/StarRating'; | ||
|
||
export const getStaticProps = async (context) => { | ||
const id = context.params.id; | ||
const res = await fetch( | ||
`https://edgemony-backend.herokuapp.com/playlist/${id}` | ||
); | ||
const data = await res.json(); | ||
|
||
return { | ||
props: { playlist: data }, | ||
}; | ||
}; | ||
|
||
export const getStaticPaths = async () => { | ||
const res = await fetch(`https://edgemony-backend.herokuapp.com/playlist/`); | ||
const data = await res.json(); | ||
|
||
const paths = data.map((playlist) => { | ||
return { | ||
params: { id: playlist.id.toString() }, | ||
}; | ||
}); | ||
|
||
return { | ||
paths, | ||
fallback: false, | ||
}; | ||
}; | ||
|
||
export default function PlaylistId({ playlist }) { | ||
return ( | ||
<> | ||
<div className={styles.hero} > | ||
<div className={styles.all}> | ||
<div className={styles.img_container}> | ||
<img src={playlist.cover} /> | ||
</div> | ||
<div className={styles.info}> | ||
<h1>{playlist.title}</h1> | ||
<p> | ||
{playlist.artist} ft. {playlist.featuring.join(", ")} | ||
</p> | ||
<p>{playlist.year}</p> | ||
<p>{playlist.genres.join(" ")}</p> | ||
<StarRating playlist={playlist}/> | ||
</div> | ||
</div> | ||
</div> | ||
<SongList playlist={playlist}/> | ||
</> | ||
); | ||
} |
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,13 @@ | ||
.hero { | ||
|
||
.all { | ||
display: flex; | ||
gap: 20px; | ||
} | ||
|
||
.img_container { | ||
background-color: red; | ||
width: 200px; | ||
height: 200px; | ||
} | ||
} |