From 835d7ff43d77a236443929e52b75da6a2ecc9d9c Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Wed, 31 Jan 2024 00:02:36 +0800 Subject: [PATCH] feat: add visitor map entry button in country list --- src/client/components/website/MetricsTable.tsx | 2 +- src/client/pages/Website/Detail.tsx | 15 +++++++++++++-- src/client/pages/Website/Map.tsx | 15 +++++++++++++-- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/client/components/website/MetricsTable.tsx b/src/client/components/website/MetricsTable.tsx index 96ed53e..1e8c931 100644 --- a/src/client/components/website/MetricsTable.tsx +++ b/src/client/components/website/MetricsTable.tsx @@ -41,7 +41,7 @@ export const MetricsTable: React.FC = React.memo((props) => { { title: title[0], dataIndex: 'x', - render: (val) => val ?? (None), + render: (val) => val ?? (None), }, { title: title[1], diff --git a/src/client/pages/Website/Detail.tsx b/src/client/pages/Website/Detail.tsx index 48a95ae..3fd2418 100644 --- a/src/client/pages/Website/Detail.tsx +++ b/src/client/pages/Website/Detail.tsx @@ -1,6 +1,6 @@ -import { Card } from 'antd'; +import { Button, Card } from 'antd'; import React from 'react'; -import { useParams } from 'react-router'; +import { useNavigate, useParams } from 'react-router'; import { trpc } from '../../api/trpc'; import { ErrorTip } from '../../components/ErrorTip'; import { Loading } from '../../components/Loading'; @@ -9,6 +9,7 @@ import { MetricsTable } from '../../components/website/MetricsTable'; import { WebsiteOverview } from '../../components/website/WebsiteOverview'; import { useGlobalRangeDate } from '../../hooks/useGlobalRangeDate'; import { useCurrentWorkspaceId } from '../../store/user'; +import { RightOutlined } from '@ant-design/icons'; export const WebsiteDetail: React.FC = React.memo(() => { const { websiteId } = useParams(); @@ -18,6 +19,7 @@ export const WebsiteDetail: React.FC = React.memo(() => { websiteId: websiteId!, }); const { startDate, endDate } = useGlobalRangeDate(); + const navigate = useNavigate(); if (!websiteId) { return ; @@ -93,6 +95,15 @@ export const WebsiteDetail: React.FC = React.memo(() => { startAt={startAt} endAt={endAt} /> + { const { websiteId } = useParams(); @@ -15,6 +17,7 @@ export const WebsiteVisitorMapPage: React.FC = React.memo(() => { workspaceId, websiteId: websiteId!, }); + const navigate = useNavigate(); if (!websiteId) { return ; @@ -30,7 +33,15 @@ export const WebsiteVisitorMapPage: React.FC = React.memo(() => { return (
-
+
+