generated from mateusfg7/nextjs-setup
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sync-branches: New code has just landed in main, so let's bring dev up to speed!
- Loading branch information
Showing
10 changed files
with
203 additions
and
49 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,6 +1,6 @@ | ||
{ | ||
"name": "mateusf.com", | ||
"version": "8.12.0", | ||
"version": "8.12.1", | ||
"homepage": "https://mateusf.com", | ||
"license": "GPL-3.0", | ||
"author": "Mateus Felipe Gonçalves (mateusfg7) <[email protected]>", | ||
|
This file was deleted.
Oops, something went wrong.
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,14 @@ | ||
import { Article } from '@phosphor-icons/react/dist/ssr' | ||
import { allPosts } from 'contentlayer/generated' | ||
|
||
import { Card } from '../card' | ||
|
||
export async function BlogPosts() { | ||
return ( | ||
<Card | ||
title="Blog posts" | ||
icon={<Article size="1em" weight="duotone" />} | ||
content={allPosts.length} | ||
/> | ||
) | ||
} |
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
49 changes: 49 additions & 0 deletions
49
src/app/about/statistics/components/spotify-dashboard/cards/top-track.tsx
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,49 @@ | ||
import Image from 'next/image' | ||
import { MusicNotes } from '@phosphor-icons/react/dist/ssr' | ||
|
||
import { placeholder } from '@/shared/lib/placeholder' | ||
import { getLastFmTopTracks, getTrackInfo } from '@/shared/lib/lastFm' | ||
|
||
export async function TopTrack() { | ||
const tracks = await getLastFmTopTracks('1month') | ||
|
||
const topTrack = await getTrackInfo({ | ||
artistName: tracks[0].artist.name, | ||
trackName: tracks[0].name | ||
}) | ||
const imageUrl = topTrack.album.image.filter( | ||
image => image.size === 'extralarge' | ||
)[0]['#text'] | ||
|
||
return ( | ||
<div className="flex h-full w-full items-center justify-between gap-2 rounded-3xl bg-neutral-200 p-4 leading-none dark:bg-neutral-950 md:p-7"> | ||
<div className="flex h-full flex-1 flex-col overflow-hidden"> | ||
<span className="inline-flex items-center gap-2 text-neutral-600"> | ||
<span>Top Played</span> | ||
<MusicNotes size="1em" weight="duotone" /> | ||
</span> | ||
<span className="text-xs text-neutral-500 dark:text-neutral-700"> | ||
From last month | ||
</span> | ||
<span className="flex h-full items-center"> | ||
<a | ||
href={topTrack.url} | ||
target="_blank" | ||
title={`${topTrack.name} - ${topTrack.artist['#text']}`} | ||
className="block w-full overflow-hidden text-ellipsis whitespace-nowrap text-xl hover:underline md:text-3xl" | ||
> | ||
{topTrack.name} - {topTrack.artist.name} | ||
</a> | ||
</span> | ||
</div> | ||
<Image | ||
src={imageUrl} | ||
alt="Artist Image" | ||
width={300} | ||
height={300} | ||
placeholder={placeholder(96, 96) as `data:image/${string}`} | ||
className="w-11 rounded-xl md:w-24 md:rounded-3xl" | ||
/> | ||
</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
6 changes: 5 additions & 1 deletion
6
src/app/about/statistics/components/spotify-dashboard/skeleton/index.tsx
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
19 changes: 19 additions & 0 deletions
19
src/app/about/statistics/components/spotify-dashboard/skeleton/top-track-skeleton.tsx
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 { MusicNotes } from '@phosphor-icons/react/dist/ssr' | ||
|
||
export function TopTrackSkeleton() { | ||
return ( | ||
<div className="flex h-full w-full items-center justify-between gap-2 rounded-3xl bg-neutral-200 p-4 leading-none dark:bg-neutral-950 md:p-7"> | ||
<div className="flex h-full w-full flex-col gap-1"> | ||
<span className="inline-flex items-center gap-2 text-neutral-600"> | ||
<span>Top Played</span> | ||
<MusicNotes size="1em" weight="duotone" /> | ||
</span> | ||
|
||
<div className="flex h-full items-center"> | ||
<div className="h-9 w-2/3 animate-pulse rounded-3xl bg-neutral-400 dark:bg-neutral-800" /> | ||
</div> | ||
</div> | ||
<div className="h-11 w-14 animate-pulse rounded-xl bg-neutral-400 dark:bg-neutral-800 md:h-24 md:w-28 md:rounded-3xl" /> | ||
</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