BLOG-16 fix: build failed

This commit is contained in:
SquidSpirit 2025-01-18 03:55:52 +08:00
parent e12d815440
commit 389d4ef4a9
2 changed files with 9 additions and 7 deletions

View File

@ -1,10 +1,12 @@
import Link from "next/link";
export default function Navbar() { export default function Navbar() {
return ( return (
<div className="border-b border-gray-300"> <div className="border-b border-gray-300">
<div className="mx-auto flex h-[--tool-bar-height] max-w-screen-xl flex-row items-center justify-between px-4 md:px-6"> <div className="mx-auto flex h-[--tool-bar-height] max-w-screen-xl flex-row items-center justify-between px-4 md:px-6">
<a className="text-2xl font-black text-gray-800" href="/"> <Link className="text-2xl font-black text-gray-800" href="/">
</a> </Link>
<div className="flex flex-row items-center gap-x-6"> <div className="flex flex-row items-center gap-x-6">
<Action label="首頁" link="/" isSelected={true} /> <Action label="首頁" link="/" isSelected={true} />
</div> </div>
@ -18,12 +20,12 @@ function Action(props: { label: string; link: string; isSelected: boolean }) {
<div <div
className={`rounded px-1.5 ${props.isSelected ? "bg-blue-600" : "bg-transparent"}`} className={`rounded px-1.5 ${props.isSelected ? "bg-blue-600" : "bg-transparent"}`}
> >
<a <Link
className={`font-extrabold ${props.isSelected ? "text-white" : "text-gray-800"}`} className={`font-extrabold ${props.isSelected ? "text-white" : "text-gray-800"}`}
href={props.link} href={props.link}
> >
{props.label} {props.label}
</a> </Link>
</div> </div>
); );
} }

View File

@ -9,12 +9,12 @@ import { tagStartedAction, tagStoppedAction } from "../../presenter/tagSlice";
export default function SelfTags() { export default function SelfTags() {
return ( return (
<Provider store={tagStore}> <Provider store={tagStore}>
<_SelfTags /> <SelfTagsProvided />
</Provider> </Provider>
); );
} }
function _SelfTags() { function SelfTagsProvided() {
const tags = useTagSelector((state) => state.tag.tags); const tags = useTagSelector((state) => state.tag.tags);
const dispatch = useTagDispatch(); const dispatch = useTagDispatch();
@ -26,7 +26,7 @@ function _SelfTags() {
dispatch(tagStoppedAction()); dispatch(tagStoppedAction());
setIsTagsVisible(false); setIsTagsVisible(false);
}; };
}, []); }, [dispatch]);
useEffect(() => { useEffect(() => {
if (tags.length === 0) return; if (tags.length === 0) return;