mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-15 10:25:55 -07:00
feat: improve rewind page (#130)
* add timeframe selectors for rewind * alter rewind nav to default to monthly rewind * fix rewind default page * remove superfluous parameters
This commit is contained in:
parent
ddb0becc0f
commit
62267652ba
4 changed files with 197 additions and 38 deletions
|
|
@ -8,9 +8,16 @@ interface Props {
|
|||
}
|
||||
|
||||
export default function Rewind(props: Props) {
|
||||
const artistimg = props.stats.top_artists[0].image;
|
||||
const albumimg = props.stats.top_albums[0].image;
|
||||
const trackimg = props.stats.top_tracks[0].image;
|
||||
const artistimg = props.stats.top_artists[0]?.image;
|
||||
const albumimg = props.stats.top_albums[0]?.image;
|
||||
const trackimg = props.stats.top_tracks[0]?.image;
|
||||
if (
|
||||
!props.stats.top_artists[0] ||
|
||||
!props.stats.top_albums[0] ||
|
||||
!props.stats.top_tracks[0]
|
||||
) {
|
||||
return <p>Not enough data exists to create a Rewind for this period :(</p>;
|
||||
}
|
||||
return (
|
||||
<div className="flex flex-col gap-7">
|
||||
<h2>{props.stats.title}</h2>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue