mirror of
https://github.com/theoludwig/theoludwig.git
synced 2026-08-25 09:21:33 +02:00
build(deps): update latest
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Link } from "@repo/i18n/routing"
|
||||
import { Link } from "@repo/i18n/navigation"
|
||||
import { useTranslations } from "next-intl"
|
||||
import Image from "next/image"
|
||||
import { BirthDate } from "../Home/About/AboutList/BirthDate.tsx"
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { Meta, StoryObj } from "@storybook/nextjs"
|
||||
import { expect, fn, userEvent, within } from "storybook/test"
|
||||
import { FaCheck } from "react-icons/fa"
|
||||
|
||||
import type { ButtonLinkProps } from "./Button.tsx"
|
||||
import { Button } from "./Button.tsx"
|
||||
|
||||
const meta = {
|
||||
@@ -133,10 +132,10 @@ export const LinkWithIcons: Story = {
|
||||
render: (args) => {
|
||||
return (
|
||||
<ButtonContainer>
|
||||
<Button leftIcon={<FaCheck size={18} />} {...(args as ButtonLinkProps)}>
|
||||
<Button leftIcon={<FaCheck size={18} />} {...args}>
|
||||
Link Left Icon
|
||||
</Button>
|
||||
<Button rightIcon={<FaCheck size={18} />} {...(args as ButtonLinkProps)}>
|
||||
<Button rightIcon={<FaCheck size={18} />} {...args}>
|
||||
Link Right Icon
|
||||
</Button>
|
||||
</ButtonContainer>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { classNames } from "@repo/config-tailwind/classNames"
|
||||
import { Link as NextLink } from "@repo/i18n/routing"
|
||||
import { Link as NextLink } from "@repo/i18n/navigation"
|
||||
|
||||
import { Spinner } from "../Spinner/Spinner.tsx"
|
||||
import { Ripple } from "./Ripple.tsx"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { classNames } from "@repo/config-tailwind/classNames"
|
||||
import { Link as NextLink } from "@repo/i18n/routing"
|
||||
import { Link as NextLink } from "@repo/i18n/navigation"
|
||||
import { FiExternalLink } from "react-icons/fi"
|
||||
|
||||
export interface LinkProps extends React.ComponentProps<typeof NextLink> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import { useRouter } from "@repo/i18n/routing"
|
||||
import { useRouter } from "@repo/i18n/navigation"
|
||||
import { useTranslations } from "next-intl"
|
||||
import { useEffect, useTransition } from "react"
|
||||
import { Button } from "../../Design/Button/Button.tsx"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client"
|
||||
|
||||
import { classNames } from "@repo/config-tailwind/classNames"
|
||||
import { usePathname, useRouter } from "@repo/i18n/routing"
|
||||
import { usePathname, useRouter } from "@repo/i18n/navigation"
|
||||
import { LOCALES } from "@repo/utils/constants"
|
||||
import { useLocale } from "next-intl"
|
||||
import { useEffect, useRef } from "react"
|
||||
|
||||
@@ -4,7 +4,7 @@ import { classNames } from "@repo/config-tailwind/classNames"
|
||||
import type { Theme } from "@repo/utils/constants"
|
||||
import { THEME_DEFAULT } from "@repo/utils/constants"
|
||||
import { ThemeProvider as NextThemeProvider, useTheme as useNextTheme } from "next-themes"
|
||||
import { useEffect, useState } from "react"
|
||||
import { useSyncExternalStore } from "react"
|
||||
|
||||
export interface ThemeProviderProps extends React.PropsWithChildren {
|
||||
forcedTheme?: Theme
|
||||
@@ -30,13 +30,19 @@ export interface UseThemeOutput {
|
||||
toggleTheme: () => void
|
||||
}
|
||||
|
||||
const subscribeToNothing = (): (() => void) => {
|
||||
return () => {}
|
||||
}
|
||||
const getClientSnapshot = (): boolean => {
|
||||
return true
|
||||
}
|
||||
const getServerSnapshot = (): boolean => {
|
||||
return false
|
||||
}
|
||||
|
||||
export const useTheme = (): UseThemeOutput => {
|
||||
const { setTheme, theme: themeData } = useNextTheme()
|
||||
const [isMounted, setIsMounted] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
setIsMounted(true)
|
||||
}, [])
|
||||
const isMounted = useSyncExternalStore(subscribeToNothing, getClientSnapshot, getServerSnapshot)
|
||||
|
||||
const theme = isMounted ? (themeData as Theme) : THEME_DEFAULT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user