mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-07 10:16:38 +08:00
style(frontend): sync remaining glass UI theme files and cyberpunk theme
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import type { AnnouncementData } from "@/api";
|
||||
|
||||
import ReactMarkdown from "react-markdown";
|
||||
import remarkGfm from "remark-gfm";
|
||||
|
||||
import { Button } from "@/shadcn-bridge/heroui/button";
|
||||
import {
|
||||
Modal,
|
||||
@@ -7,8 +11,6 @@ import {
|
||||
ModalFooter,
|
||||
ModalHeader,
|
||||
} from "@/shadcn-bridge/heroui/modal";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
import remarkGfm from "remark-gfm";
|
||||
|
||||
interface AnnouncementModalProps {
|
||||
announcement: AnnouncementData;
|
||||
@@ -24,7 +26,11 @@ export const AnnouncementModal = ({
|
||||
onDontShowAgain,
|
||||
}: AnnouncementModalProps) => {
|
||||
return (
|
||||
<Modal isOpen={isOpen} onOpenChange={(open) => !open && onClose()} size="2xl">
|
||||
<Modal
|
||||
isOpen={isOpen}
|
||||
size="2xl"
|
||||
onOpenChange={(open) => !open && onClose()}
|
||||
>
|
||||
<ModalContent>
|
||||
<ModalHeader className="flex flex-col gap-1">平台公告</ModalHeader>
|
||||
<ModalBody>
|
||||
|
||||
@@ -50,7 +50,10 @@ export const FlowChartCard = ({
|
||||
) : (
|
||||
<div className="h-64 lg:h-80 w-full">
|
||||
<ResponsiveContainer height="100%" width="100%">
|
||||
<LineChart data={chartData} margin={{ top: 20, right: 0, left: -20, bottom: 0 }}>
|
||||
<LineChart
|
||||
data={chartData}
|
||||
margin={{ top: 20, right: 0, left: -20, bottom: 0 }}
|
||||
>
|
||||
<XAxis
|
||||
axisLine={false}
|
||||
dataKey="time"
|
||||
@@ -106,11 +109,7 @@ export const FlowChartCard = ({
|
||||
}}
|
||||
cursor={{ fill: "rgba(0, 122, 255, 0.05)" }}
|
||||
/>
|
||||
<Line
|
||||
dataKey="flow"
|
||||
stroke="#007aff"
|
||||
type="monotone"
|
||||
/>
|
||||
<Line dataKey="flow" stroke="#007aff" type="monotone" />
|
||||
</LineChart>
|
||||
</ResponsiveContainer>
|
||||
</div>
|
||||
|
||||
@@ -25,9 +25,7 @@ export const MetricCard = ({
|
||||
<p className="text-sm font-medium text-default-600 truncate">
|
||||
{title}
|
||||
</p>
|
||||
<div
|
||||
className={`p-2 rounded-xl flex-shrink-0 ${iconClassName}`}
|
||||
>
|
||||
<div className={`p-2 rounded-xl flex-shrink-0 ${iconClassName}`}>
|
||||
{icon}
|
||||
</div>
|
||||
</div>
|
||||
@@ -35,9 +33,7 @@ export const MetricCard = ({
|
||||
{value}
|
||||
</p>
|
||||
</div>
|
||||
<div className="mt-auto pt-4">
|
||||
{bottomContent}
|
||||
</div>
|
||||
<div className="mt-auto pt-4">{bottomContent}</div>
|
||||
</CardBody>
|
||||
</Card>
|
||||
);
|
||||
|
||||
@@ -349,17 +349,22 @@ export const useDashboardData = (): DashboardDataState => {
|
||||
|
||||
if (res.code === 0 && res.data && res.data.enabled === 1) {
|
||||
setAnnouncement(res.data);
|
||||
|
||||
|
||||
try {
|
||||
const storedTimeStr = localStorage.getItem("flvx_announcement_seen_time");
|
||||
const storedTimeStr = localStorage.getItem(
|
||||
"flvx_announcement_seen_time",
|
||||
);
|
||||
const storedTime = storedTimeStr ? parseInt(storedTimeStr, 10) : 0;
|
||||
const updateTime = res.data.update_time || 0;
|
||||
|
||||
|
||||
if (updateTime > storedTime) {
|
||||
setIsAnnouncementModalOpen(true);
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn("Failed to read localStorage for announcement state", err);
|
||||
console.warn(
|
||||
"Failed to read localStorage for announcement state",
|
||||
err,
|
||||
);
|
||||
setIsAnnouncementModalOpen(true);
|
||||
}
|
||||
} else {
|
||||
@@ -376,7 +381,10 @@ export const useDashboardData = (): DashboardDataState => {
|
||||
setIsAnnouncementModalOpen(false);
|
||||
if (announcement && announcement.update_time) {
|
||||
try {
|
||||
localStorage.setItem("flvx_announcement_seen_time", announcement.update_time.toString());
|
||||
localStorage.setItem(
|
||||
"flvx_announcement_seen_time",
|
||||
announcement.update_time.toString(),
|
||||
);
|
||||
} catch (err) {
|
||||
console.warn("Failed to set localStorage for announcement state", err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user