Add say form submit & popup entry

This commit is contained in:
2024-04-24 14:17:42 +08:00
parent 46d7d4b26f
commit 6632c839e4
5 changed files with 118 additions and 4 deletions
+5 -2
View File
@@ -1,6 +1,7 @@
import { useState } from "react";
import Read from "~components/biz/read";
import Toy from "~components/biz/toy";
import Say from "~components/biz/say";
import Message from "~components/ui/message";
import { clsn } from "~utils";
@@ -10,7 +11,7 @@ import styles from "./sidepanel.module.less";
const initialType = new URLSearchParams(location.search).get("type") || "read";
const tabItems = [
{ title: "在读", value: "read" },
{ title: "在看", value: "read" },
{ title: "手办", value: "toy" },
{ title: "语录", value: "say" },
];
@@ -22,7 +23,8 @@ function SidePanel() {
<div className={styles.root}>
<nav className={styles.nav}>
{tabItems.map((item) => (
<a className={clsn(type === item.value && styles.active)}
<a key={item.value}
className={clsn(type === item.value && styles.active)}
onClick={() => setType(item.value)}
>
{item.title}
@@ -31,6 +33,7 @@ function SidePanel() {
</nav>
{type === "read" && <Read />}
{type === "toy" && <Toy />}
{type === "say" && <Say />}
<Message />
</div>
);