From 69d62b153ac77c6a982635080ec82a497007a7f0 Mon Sep 17 00:00:00 2001 From: Ryan Freeman Date: Sun, 28 May 2023 21:15:39 +0100 Subject: [PATCH] disabled statsfm & moved common components --- components/{ => common}/Container.tsx | 0 components/{ => common}/Footer.tsx | 2 +- components/{ => common}/Header.tsx | 8 +++--- components/layouts/ArticleLayout.tsx | 2 +- components/layouts/SimpleLayout.tsx | 2 +- lib/dashboard.ts | 38 +++++++++++++-------------- pages/_app.tsx | 4 +-- pages/about.tsx | 2 +- pages/index.tsx | 2 +- 9 files changed, 30 insertions(+), 30 deletions(-) rename components/{ => common}/Container.tsx (100%) rename components/{ => common}/Footer.tsx (97%) rename components/{ => common}/Header.tsx (97%) diff --git a/components/Container.tsx b/components/common/Container.tsx similarity index 100% rename from components/Container.tsx rename to components/common/Container.tsx diff --git a/components/Footer.tsx b/components/common/Footer.tsx similarity index 97% rename from components/Footer.tsx rename to components/common/Footer.tsx index b6af417..0070c40 100644 --- a/components/Footer.tsx +++ b/components/common/Footer.tsx @@ -1,7 +1,7 @@ import React from 'react' import {OuterContainer, InnerContainer} from './Container' import {NavLink} from '@/components/ui/Navigation' -import {SpotifyPlayer} from './ui/SpotifyPlayer' +import {SpotifyPlayer} from '@/components/ui/SpotifyPlayer' import {SocialLink} from '@/components/ui/SocialLink' import {GitHubIcon, LinkedInIcon, TwitterIcon} from '@/components/icons/SocialIcons' diff --git a/components/Header.tsx b/components/common/Header.tsx similarity index 97% rename from components/Header.tsx rename to components/common/Header.tsx index c2b77f0..980c1c8 100644 --- a/components/Header.tsx +++ b/components/common/Header.tsx @@ -1,10 +1,10 @@ import {useRouter} from 'next/router' import {useEffect, useRef} from 'react' import {Container} from './Container' -import {MobileNavigation, DesktopNavigation} from './ui/Navigation' -import {Avatar, AvatarContainer} from './ui/Avatar' -import {MoonIcon} from './icons/MoonIcon' -import {SunIcon} from './icons/SunIcon' +import {MobileNavigation, DesktopNavigation} from '@/components/ui/Navigation' +import {Avatar, AvatarContainer} from '@/components/ui/Avatar' +import {MoonIcon} from '@/components/icons/MoonIcon' +import {SunIcon} from '@/components/icons/SunIcon' function ModeToggle() { function disableTransitionsTemporarily() { diff --git a/components/layouts/ArticleLayout.tsx b/components/layouts/ArticleLayout.tsx index 9938d2b..8a15351 100644 --- a/components/layouts/ArticleLayout.tsx +++ b/components/layouts/ArticleLayout.tsx @@ -2,7 +2,7 @@ import React, {ReactNode} from 'react' import * as process from 'process' import Head from 'next/head' import Link from 'next/link' -import {Container} from '@/components/Container' +import {Container} from '@/components/common/Container' import {Prose} from '@/components/ui/Prose' import {Views} from '@/components/ui/Views' import {ArrowDownIcon} from '@/components/icons/ArrowDownIcon' diff --git a/components/layouts/SimpleLayout.tsx b/components/layouts/SimpleLayout.tsx index 9f32750..d65f16d 100644 --- a/components/layouts/SimpleLayout.tsx +++ b/components/layouts/SimpleLayout.tsx @@ -1,5 +1,5 @@ import {ReactNode} from 'react' -import {Container} from '@/components/Container' +import {Container} from '@/components/common/Container' import {twMerge} from 'tailwind-merge' type SimpleLayout = { diff --git a/lib/dashboard.ts b/lib/dashboard.ts index 866fcf3..cc7d318 100644 --- a/lib/dashboard.ts +++ b/lib/dashboard.ts @@ -26,27 +26,27 @@ export async function getDashboardData(context: GetServerSidePropsContext) { const totalArticles = (await getAllArticles()).length const topArtist = await getTopArtist() const {genre} = await getTopGenre() - const {hoursListened, minutesListened, streams} = await getStats() + // const {hoursListened, minutesListened, streams} = await getStats() const metrics: Metric[] = [ - { - title: "Streams", - value: +streams, - group: "Spotify", - href: "https://open.spotify.com/?" - }, - { - title: "Hours listened", - value: +hoursListened, - group: "Spotify", - href: "https://open.spotify.com/?" - }, - { - title: "Minutes listened", - value: +minutesListened, - group: "Spotify", - href: "https://open.spotify.com/?" - }, + // { + // title: "Streams", + // value: +streams, + // group: "Spotify", + // href: "https://open.spotify.com/?" + // }, + // { + // title: "Hours listened", + // value: +hoursListened, + // group: "Spotify", + // href: "https://open.spotify.com/?" + // }, + // { + // title: "Minutes listened", + // value: +minutesListened, + // group: "Spotify", + // href: "https://open.spotify.com/?" + // }, { title: "Top genre", value: genre, diff --git a/pages/_app.tsx b/pages/_app.tsx index 9d0e7e1..e2ba7cd 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -4,8 +4,8 @@ import NProgress from 'nprogress' import {createBrowserSupabaseClient} from '@supabase/auth-helpers-nextjs' import {SessionContextProvider, Session} from '@supabase/auth-helpers-react' import {useEffect, useState} from 'react' -import {Header} from '@/components/Header' -import {Footer} from '@/components/Footer' +import {Header} from '@/components/common/Header' +import {Footer} from '@/components/common/Footer' import '../styles/nprogress.css' import '../styles/tailwind.css' diff --git a/pages/about.tsx b/pages/about.tsx index e9cfae2..2952469 100644 --- a/pages/about.tsx +++ b/pages/about.tsx @@ -4,7 +4,7 @@ import Head from 'next/head' import Link from 'next/link' import clsx from 'clsx' -import {Container} from '@/components/Container' +import {Container} from '@/components/common/Container' import { GitHubIcon, LinkedInIcon, diff --git a/pages/index.tsx b/pages/index.tsx index 1c61e5a..2fbe8db 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -3,7 +3,7 @@ import Head from 'next/head' import {GetStaticProps} from 'next' import {Card} from '@/components/ui/Card' import {Resume} from '@/components/ui/Resume' -import {Container} from '@/components/Container' +import {Container} from '@/components/common/Container' import { GitHubIcon, LinkedInIcon,