新建信件按钮
This commit is contained in:
parent
78514cb093
commit
7170501f59
|
|
@ -1,10 +1,14 @@
|
|||
import { Button } from "antd";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
export function Header() {
|
||||
const navigate = useNavigate();
|
||||
return (
|
||||
<header className="bg-gradient-to-r from-primary-500/80 to-primary-400 p-6 rounded-t-xl">
|
||||
<div className="flex flex-col space-y-6">
|
||||
{/* 主标题区域 */}
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold tracking-wider text-white">
|
||||
<div className="flex items-center justify-between ">
|
||||
<h1 className="text-3xl font-bold tracking-wider text-white m-0">
|
||||
我的悄悄话
|
||||
</h1>
|
||||
{/* <p className="mt-2 text-blue-100 text-lg">
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import { useState, useEffect, useMemo } from "react";
|
||||
import { Input, Pagination, Empty, Spin, Radio, Space, Tag } from "antd";
|
||||
import { Input, Pagination, Empty, Spin, Radio, Space, Tag, Button } from "antd";
|
||||
import { api, RouterInputs } from "@nice/client";
|
||||
import { LetterCard } from "../LetterCard";
|
||||
import { NonVoid } from "@nice/utils";
|
||||
import { SearchOutlined, FilterOutlined } from "@ant-design/icons";
|
||||
import debounce from "lodash/debounce";
|
||||
import { postDetailSelect } from "@nice/common";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
export default function LetterList({
|
||||
params,
|
||||
|
|
@ -17,7 +18,7 @@ export default function LetterList({
|
|||
const [keyword, setKeyword] = useState<string | undefined>("");
|
||||
const [currentPage, setCurrentPage] = useState(1);
|
||||
const [selectedCategory, setSelectedCategory] = useState<string>("all");
|
||||
|
||||
const navigate = useNavigate();
|
||||
const { data: categoriesData } = api.term.findMany.useQuery({
|
||||
where: {
|
||||
taxonomy: {
|
||||
|
|
@ -56,12 +57,12 @@ export default function LetterList({
|
|||
],
|
||||
...(selectedCategory !== "all"
|
||||
? {
|
||||
terms: {
|
||||
some: {
|
||||
id: selectedCategory,
|
||||
},
|
||||
terms: {
|
||||
some: {
|
||||
id: selectedCategory,
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
...params?.where,
|
||||
},
|
||||
|
|
@ -124,6 +125,13 @@ export default function LetterList({
|
|||
</Radio.Button>
|
||||
))}
|
||||
</Radio.Group>
|
||||
<Button
|
||||
type="primary"
|
||||
size="large"
|
||||
onClick={() => navigate("/editor")}
|
||||
className="flex items-center justify-center">
|
||||
添加信件
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<Space direction="vertical" className="w-full" size="middle">
|
||||
|
|
|
|||
Loading…
Reference in New Issue