fix: build errors (#145)

This commit is contained in:
Zdeněk Janeček 2023-05-13 09:00:47 +02:00 committed by GitHub
parent d0a73a7cbc
commit 0f58c44261
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View file

@ -7,7 +7,7 @@ import { useMemo, useState, useEffect } from "react"
import Badge from "../badge" import Badge from "../badge"
const CreatedAgoBadge = ({ createdAt }: { createdAt: string | Date }) => { const CreatedAgoBadge = ({ createdAt }: { createdAt: string | Date }) => {
const createdDate = new Date(createdAt) const createdDate = useMemo(() => new Date(createdAt), [createdAt])
const [time, setTimeAgo] = useState(timeAgo(createdDate)) const [time, setTimeAgo] = useState(timeAgo(createdDate))
const { setToast } = useToasts() const { setToast } = useToasts()

View file

@ -1,6 +1,6 @@
"use client" "use client"
import { useSelectedLayoutSegment, useSelectedLayoutSegments } from "next/navigation" import { useSelectedLayoutSegments } from "next/navigation"
import FadeIn from "@components/fade-in" import FadeIn from "@components/fade-in"
import { setDriftTheme } from "src/app/lib/set-theme" import { setDriftTheme } from "src/app/lib/set-theme"
import { import {
@ -47,12 +47,14 @@ export function HeaderButtons({
}) { }) {
const { isAdmin, userId } = useSessionSWR() const { isAdmin, userId } = useSessionSWR()
const { resolvedTheme } = useTheme(); const { resolvedTheme } = useTheme();
return getButtons({ return <>
{getButtons({
isAuthenticated, isAuthenticated,
theme: resolvedTheme ? resolvedTheme : initialTheme, theme: resolvedTheme ? resolvedTheme : initialTheme,
isAdmin, isAdmin,
userId userId
}) })}
</>
} }
function NavButton(tab: Tab) { function NavButton(tab: Tab) {