From ebb4dc301916d87cab1c7bd58948ea35d8839b87 Mon Sep 17 00:00:00 2001 From: phiko-misc Date: Tue, 24 Oct 2023 15:11:36 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=84=20refactor(prettier):=20auto=20for?= =?UTF-8?q?mat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/button/SimpleButton.tsx | 49 +++--- src/components/button/ThemeButton.tsx | 63 +++---- src/components/countdown/CountDown.tsx | 155 +++++++++--------- src/components/countdown/NumberBox.tsx | 49 +++--- .../icons/ChevronRightIcon copy.tsx | 29 ++-- src/components/icons/ChevronRightIcon.tsx | 29 ++-- src/components/icons/MoonIcon.tsx | 29 ++-- src/components/icons/SunIcon.tsx | 27 ++- src/components/layout/Layout.tsx | 32 ++-- src/components/snow.tsx | 31 ++-- src/core/utils.ts | 32 ++-- src/pages/[id].tsx | 97 ++++++----- src/pages/_app.tsx | 28 ++-- src/pages/_document.tsx | 4 +- src/pages/api/[id].tsx | 44 ++--- src/pages/calender.tsx | 76 +++++---- src/pages/index.tsx | 37 +++-- 17 files changed, 453 insertions(+), 358 deletions(-) diff --git a/src/components/button/SimpleButton.tsx b/src/components/button/SimpleButton.tsx index 8ac930d..2280700 100644 --- a/src/components/button/SimpleButton.tsx +++ b/src/components/button/SimpleButton.tsx @@ -4,30 +4,31 @@ import Link from "next/link"; import { ReactNode } from "react"; interface Props { - icon: ReactNode; - link?: string; - className?: string; - disabled?: boolean; + icon: ReactNode; + link?: string; + className?: string; + disabled?: boolean; } export default function SimpleButton(props: Props) { - return ( - - ) -} \ No newline at end of file + return ( + + ); +} diff --git a/src/components/button/ThemeButton.tsx b/src/components/button/ThemeButton.tsx index f574782..f9097a9 100644 --- a/src/components/button/ThemeButton.tsx +++ b/src/components/button/ThemeButton.tsx @@ -1,38 +1,39 @@ -import { useState, useEffect } from 'react' -import { useTheme } from 'next-themes' -import { SunIcon } from '@components/icons/SunIcon'; -import { MoonIcon } from '@components/icons/MoonIcon'; +import { useState, useEffect } from "react"; +import { useTheme } from "next-themes"; +import { SunIcon } from "@components/icons/SunIcon"; +import { MoonIcon } from "@components/icons/MoonIcon"; export default function ThemeSwitch() { - const [mounted, setMounted] = useState(false); - const { theme, setTheme } = useTheme(); + const [mounted, setMounted] = useState(false); + const { theme, setTheme } = useTheme(); - // useEffect only runs on the client, so now we can safely show the UI - useEffect(() => { - setMounted(true) - }, []) + // useEffect only runs on the client, so now we can safely show the UI + useEffect(() => { + setMounted(true); + }, []); - if (!mounted) { - return null - } + if (!mounted) { + return null; + } - function switchTheme() { - if (theme === 'light') { - setTheme('dark'); - } else { - setTheme('light'); - } + function switchTheme() { + if (theme === "light") { + setTheme("dark"); + } else { + setTheme("light"); } + } - return ( - - - ); -} \ No newline at end of file + return ( + + ); +} diff --git a/src/components/countdown/CountDown.tsx b/src/components/countdown/CountDown.tsx index 8874cb3..2232531 100644 --- a/src/components/countdown/CountDown.tsx +++ b/src/components/countdown/CountDown.tsx @@ -3,13 +3,12 @@ import { useEffect, useState } from "react"; import NumberBox from "./NumberBox"; interface time { - days: number | string; - hours: number | string; - minutes: number | string; - seconds: number | string; + days: number | string; + hours: number | string; + minutes: number | string; + seconds: number | string; } - /** * CountDown component * @returns {JSX.Element} The Countdown element @@ -19,81 +18,87 @@ interface time { * ``` */ export default function Countdown(): JSX.Element { - const toDay = dayjs(); - const christmasDate = dayjs(`${dayjs().get('year')}-12-24`); - const [timeBeforeChristmas, setTimeBeforeChristmas] = useState