Upgrade to Next.js 15.0.1 (#454)
This commit is contained in:
parent
00b125378c
commit
ac2659255e
9 changed files with 4320 additions and 3538 deletions
|
|
@ -12,18 +12,18 @@ export const PreviewAttachment = ({
|
|||
const { name, url, contentType } = attachment;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-2 max-w-16">
|
||||
(<div className="flex flex-col gap-2 max-w-16">
|
||||
<div className="h-20 w-16 bg-muted rounded-md relative flex flex-col items-center justify-center">
|
||||
{contentType ? (
|
||||
contentType.startsWith("image") ? (
|
||||
// NOTE: it is recommended to use next/image for images
|
||||
// eslint-disable-next-line @next/next/no-img-element
|
||||
<img
|
||||
(<img
|
||||
key={url}
|
||||
src={url}
|
||||
alt={name ?? "An image attachment"}
|
||||
className="rounded-md size-full object-cover"
|
||||
/>
|
||||
/>)
|
||||
) : (
|
||||
<div className=""></div>
|
||||
)
|
||||
|
|
@ -37,8 +37,7 @@ export const PreviewAttachment = ({
|
|||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="text-xs text-zinc-500 max-w-16 truncate">{name}</div>
|
||||
</div>
|
||||
</div>)
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,28 +1,28 @@
|
|||
"use client";
|
||||
'use client';
|
||||
|
||||
import { useTheme } from "next-themes";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useTheme } from 'next-themes';
|
||||
import { useEffect, useLayoutEffect, useState } from 'react';
|
||||
|
||||
export function ThemeToggle() {
|
||||
const { setTheme, theme } = useTheme();
|
||||
const [mounted, setMounted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
useLayoutEffect(() => {
|
||||
setMounted(true);
|
||||
}, []);
|
||||
|
||||
if (!mounted) {
|
||||
return null;
|
||||
return <div className="cursor-pointer" />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className="cursor-pointer"
|
||||
onClick={() => {
|
||||
setTheme(theme === "dark" ? "light" : "dark");
|
||||
setTheme(theme === 'dark' ? 'light' : 'dark');
|
||||
}}
|
||||
>
|
||||
{`Toggle ${theme === "light" ? "dark" : "light"} mode`}
|
||||
{`Toggle ${theme === 'light' ? 'dark' : 'light'} mode`}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue