refactor: update style of website page card

This commit is contained in:
moonrailgun 2024-10-01 20:20:51 +08:00
parent 1337eaa2c0
commit b778f8c982
2 changed files with 14 additions and 17 deletions

View File

@ -13,10 +13,10 @@ import { createFileRoute } from '@tanstack/react-router';
export const Route = createFileRoute('/website/$websiteId/config')({
beforeLoad: routeAuthBeforeLoad,
component: WebsiteDetailComponent,
component: PageComponent,
});
function WebsiteDetailComponent() {
function PageComponent() {
const { websiteId } = Route.useParams<{ websiteId: string }>();
const workspaceId = useCurrentWorkspaceId();
const { data: website, isLoading } = trpc.website.info.useQuery({

View File

@ -6,17 +6,14 @@ import { Loading } from '@/components/Loading';
import { NotFoundTip } from '@/components/NotFoundTip';
import { Button } from '@/components/ui/button';
import { ScrollArea, ScrollBar } from '@/components/ui/scroll-area';
import { Separator } from '@/components/ui/separator';
import { WebsiteCodeBtn } from '@/components/website/WebsiteCodeBtn';
import { WebsiteLighthouseBtn } from '@/components/website/WebsiteLighthouseBtn';
import { WebsiteMetricsTable } from '@/components/website/WebsiteMetricsTable';
import { WebsiteOverview } from '@/components/website/WebsiteOverview';
import { WebsiteVisitorMapBtn } from '@/components/website/WebsiteVisitorMapBtn';
import { useGlobalRangeDate } from '@/hooks/useGlobalRangeDate';
import {
useCurrentWorkspaceId,
useHasAdminPermission,
useHasPermission,
} from '@/store/user';
import { useCurrentWorkspaceId, useHasAdminPermission } from '@/store/user';
import { routeAuthBeforeLoad } from '@/utils/route';
import { useTranslation } from '@i18next-toolkit/react';
import { createFileRoute, useNavigate } from '@tanstack/react-router';
@ -25,10 +22,10 @@ import { LuSettings } from 'react-icons/lu';
export const Route = createFileRoute('/website/$websiteId/')({
beforeLoad: routeAuthBeforeLoad,
component: WebsiteDetailComponent,
component: PageComponent,
});
function WebsiteDetailComponent() {
function PageComponent() {
const { websiteId } = Route.useParams<{ websiteId: string }>();
const { t } = useTranslation();
const workspaceId = useCurrentWorkspaceId();
@ -87,10 +84,10 @@ function WebsiteDetailComponent() {
/>
}
>
<ScrollArea className="h-full overflow-hidden p-4">
<ScrollArea className="h-full overflow-hidden">
<ScrollBar orientation="horizontal" />
<Card>
<Card bordered={false} className="bg-transparent">
<Card.Grid hoverable={false} className="!w-full">
<WebsiteOverview website={website} showDateFilter={true} />
</Card.Grid>
@ -120,7 +117,7 @@ function WebsiteDetailComponent() {
</Card.Grid>
<Card.Grid
hoverable={false}
className="!w-full sm:min-h-[470px] sm:!w-1/3"
className="!w-full sm:min-h-[470px] sm:!w-1/2 md:!w-1/3"
>
<WebsiteMetricsTable
websiteId={websiteId}
@ -132,7 +129,7 @@ function WebsiteDetailComponent() {
</Card.Grid>
<Card.Grid
hoverable={false}
className="!w-full sm:min-h-[470px] sm:!w-1/3"
className="!w-full sm:min-h-[470px] sm:!w-1/2 md:!w-1/3"
>
<WebsiteMetricsTable
websiteId={websiteId}
@ -144,7 +141,7 @@ function WebsiteDetailComponent() {
</Card.Grid>
<Card.Grid
hoverable={false}
className="!w-full sm:min-h-[470px] sm:!w-1/3"
className="!w-full sm:min-h-[470px] sm:!w-1/2 md:!w-1/3"
>
<WebsiteMetricsTable
websiteId={websiteId}
@ -156,7 +153,7 @@ function WebsiteDetailComponent() {
</Card.Grid>
<Card.Grid
hoverable={false}
className="!w-full sm:min-h-[470px] sm:!w-1/3"
className="!w-full sm:min-h-[470px] sm:!w-1/2 md:!w-1/3"
>
<WebsiteMetricsTable
websiteId={websiteId}
@ -168,7 +165,7 @@ function WebsiteDetailComponent() {
</Card.Grid>
<Card.Grid
hoverable={false}
className="!w-full sm:min-h-[470px] sm:!w-1/3"
className="!w-full sm:min-h-[470px] sm:!w-1/2 md:!w-1/3"
>
<WebsiteMetricsTable
websiteId={websiteId}
@ -184,7 +181,7 @@ function WebsiteDetailComponent() {
</Card.Grid>
<Card.Grid
hoverable={false}
className="!w-full sm:min-h-[470px] sm:!w-1/3"
className="!w-full sm:min-h-[470px] sm:!w-1/2 md:!w-1/3"
>
<WebsiteMetricsTable
websiteId={websiteId}