This commit is contained in:
skidoodle 2024-10-29 09:15:26 +01:00
parent 5d7918636c
commit db560d1133
5 changed files with 8 additions and 8 deletions

View file

@ -40,7 +40,7 @@ export const NowPlayingCard = () => {
const spotify = useSpotify(); const spotify = useSpotify();
const progressPercentage = useMemo(() => { const progressPercentage = useMemo(() => {
if (spotify && spotify.is_playing && spotify.item) { if (spotify?.is_playing && spotify.item) {
return (spotify.progress_ms / spotify.item.duration_ms) * 100; return (spotify.progress_ms / spotify.item.duration_ms) * 100;
} }
return 0; return 0;
@ -102,7 +102,7 @@ export const NowPlayingCard = () => {
animate={{ width: `${progressPercentage}%` }} animate={{ width: `${progressPercentage}%` }}
transition={{ duration: 0.3, ease: "easeInOut" }} transition={{ duration: 0.3, ease: "easeInOut" }}
> >
<div className="bg-[#1DB954] h-1 rounded-full"></div> <div className="bg-[#1DB954] h-1 rounded-full" />
</motion.div> </motion.div>
</div> </div>
</div> </div>

View file

@ -2,7 +2,7 @@
import * as React from "react"; import * as React from "react";
import { ThemeProvider as NextThemesProvider } from "next-themes"; import { ThemeProvider as NextThemesProvider } from "next-themes";
import { type ThemeProviderProps } from "next-themes/dist/types"; import type { ThemeProviderProps } from "next-themes/dist/types";
export function ThemeProvider({ children, ...props }: ThemeProviderProps) { export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
return <NextThemesProvider {...props}>{children}</NextThemesProvider>; return <NextThemesProvider {...props}>{children}</NextThemesProvider>;

View file

@ -1,6 +1,6 @@
import type { Metadata } from "next"; import type { Metadata } from "next";
import Script from "next/script"; import Script from "next/script";
import { ReactNode } from "react"; import type { ReactNode } from "react";
import { Albert_Sans } from "next/font/google"; import { Albert_Sans } from "next/font/google";
import { ThemeProvider } from "@/components/ThemeProvider"; import { ThemeProvider } from "@/components/ThemeProvider";
import age from "@/utils"; import age from "@/utils";
@ -26,12 +26,12 @@ export default function RootLayout({
children: ReactNode; children: ReactNode;
}>) { }>) {
return ( return (
<html lang="zxx" suppressHydrationWarning> <html lang="en" suppressHydrationWarning>
<Script <Script
defer defer
src="https://analytics.albert.lol/script.js" src="https://analytics.albert.lol/script.js"
data-website-id="2c900d5e-c577-4824-ad37-0cdf68383c42" data-website-id="2c900d5e-c577-4824-ad37-0cdf68383c42"
></Script> />
<body className={`${albert_sans.variable} font-sans antialiased`}> <body className={`${albert_sans.variable} font-sans antialiased`}>
<ThemeProvider attribute="class" defaultTheme="system" enableSystem> <ThemeProvider attribute="class" defaultTheme="system" enableSystem>
{children} {children}

View file

@ -1,4 +1,4 @@
import { ReactNode } from "react"; import type { ReactNode } from "react";
export type IconType = { export type IconType = {
children: ReactNode; children: ReactNode;