Skip to content
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

Upgrade to Next.js 13.4 #26

Merged
merged 32 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5f5dc01
fix: remove useless nested anchor tags
Bartek532 Jul 1, 2023
ce13bc9
fix: config things
Bartek532 Jul 1, 2023
18ddc4e
fix: layout view
Bartek532 Jul 1, 2023
d1ed3ec
feat: include env variables validation
Bartek532 Jul 2, 2023
4beed9f
feat: move pages to app dir
Bartek532 Jul 2, 2023
c50f39b
feat: move fetching spotify track to server component
Bartek532 Jul 2, 2023
74d7872
fix: minor cleanups
Bartek532 Jul 2, 2023
924cb73
feat: optimize fonts
Bartek532 Jul 2, 2023
3ed644a
fix: more lint fixes
Bartek532 Jul 2, 2023
670a9b5
fix: minor fixes in about view
Bartek532 Jul 2, 2023
33ae4eb
fix: minor things in projects/posts
Bartek532 Jul 2, 2023
7ac6864
feat: adjust eslint config
Bartek532 Jul 3, 2023
88991d9
feat: move sending emails from contact form to server action
Bartek532 Jul 3, 2023
ef6fb5f
fix: renames
Bartek532 Jul 3, 2023
be69467
fix: mdx components
Bartek532 Jul 3, 2023
edcec9d
feat: migrate from supabase to vercel kv in tracking views
Bartek532 Jul 3, 2023
651dd8a
fix: move mailer integration to server action
Bartek532 Jul 3, 2023
3ee0a3b
feat: move seo things to app dir
Bartek532 Jul 4, 2023
bea4111
fix: remove deprecated pages dir
Bartek532 Jul 4, 2023
2fd2421
fix: remove vercel kv lib as it's bugged now
Bartek532 Jul 5, 2023
aa26fdb
fix: minor fixes
Bartek532 Jul 5, 2023
73928f3
feat: add google analytics tracking
Bartek532 Jul 5, 2023
484fcf3
feat: add some workflows
Bartek532 Jul 5, 2023
f24594c
fix: scripts fixes
Bartek532 Jul 5, 2023
4e32ca1
chore: update deps
Bartek532 Jul 5, 2023
ce871d1
fix: minor build fixes
Bartek532 Jul 5, 2023
2bb0219
fix: standarize envs
Bartek532 Jul 5, 2023
8a0b792
fix: minor deploy fixes
Bartek532 Jul 5, 2023
1fe8c45
fix: paths
Bartek532 Jul 5, 2023
1df994e
fix: analysis workflow
Bartek532 Jul 5, 2023
e3029d2
fix: scrolling issues on mdx
Bartek532 Jul 6, 2023
86030d4
fix: spotify track fetching
Bartek532 Jul 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: spotify track fetching
  • Loading branch information
Bartek532 committed Jul 6, 2023
commit 86030d47653694189a86b4fc931028c1f9669027
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"trailingComma": "all",
"tabWidth": 2,
"useTabs": false,
"printWidth": 100
"printWidth": 80
}
2 changes: 1 addition & 1 deletion components/mdx/info/Info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const Info = memo<InfoProps>(({ resource }) => {
return (
<>
<div className={styles.info}>
<motion.div className={styles.breadcrumbs} animate={{ x: [-100, 0], opacity: [0, 1] }}>
<motion.div className={styles.breadcrumbs} animate={{ x: [-70, 0], opacity: [0.5, 1] }}>
<Breadcrumbs
routes={getBreadcrumbs(
resource.type,
Expand Down
37 changes: 22 additions & 15 deletions components/tile/spotify/api/spotify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,31 @@ export const fetchLastTrack = async () => {
},
);

const currentlyPlayingData: unknown = await currentlyPlayingResponse.json();

if (isCurrentlyPlayingPayload(currentlyPlayingData)) {
return {
track: currentlyPlayingData.item,
status: currentlyPlayingData.is_playing ? TRACK_STATUS.ONLINE : TRACK_STATUS.OFFLINE,
};
if (currentlyPlayingResponse.status === 200) {
const currentlyPlayingData: unknown = await currentlyPlayingResponse.json();

if (isCurrentlyPlayingPayload(currentlyPlayingData)) {
return {
track: currentlyPlayingData.item,
status: currentlyPlayingData.is_playing ? TRACK_STATUS.ONLINE : TRACK_STATUS.OFFLINE,
};
}
}

const recentlyPlayedData = await fetch(`https://api.spotify.com/v1/me/player/recently-played`, {
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
},
next: {
revalidate: 60,
const recentlyPlayedResponse = await fetch(
`https://api.spotify.com/v1/me/player/recently-played`,
{
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
},
next: {
revalidate: 60,
},
},
});
);

const recentlyPlayedData: unknown = await recentlyPlayedResponse.json();

if (!isRecentlyPlayedPayload(recentlyPlayedData)) {
throw new Error("Unexpected error occured!");
Expand Down