Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web): optimize title style #1516

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions web/src/pages/app/setting/AppMonitor/AreaCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { ChevronDownIcon } from "@chakra-ui/icons";
import { Menu, MenuButton, MenuItemOption, MenuList } from "@chakra-ui/react";
import clsx from "clsx";
import {
Area,
AreaChart,
Expand Down Expand Up @@ -65,7 +66,10 @@ export default function AreaCard(props: {
return (
<div className={className}>
<div className="mb-3 flex justify-between font-medium text-grayModern-900">
<span className="whitespace-nowrap">{title}</span>
<span className={clsx("flex items-center")}>
<div className="mr-2 h-3 w-1 whitespace-nowrap rounded-xl bg-primary-600" />
{title}
</span>
{setDataNumber && podsArray && podsArray.length > 0 && (
<Menu>
<MenuButton className="text-grayModern-600">
Expand All @@ -88,7 +92,7 @@ export default function AreaCard(props: {
)}
</div>
<ResponsiveContainer width="100%" height="100%">
<AreaChart data={chartData} margin={{ left: -30, top: 6 }} syncId="sync">
<AreaChart data={chartData} margin={{ left: -28, top: 6 }} syncId="sync">
<CartesianGrid stroke="#f5f5f5" vertical={false} />
<XAxis
dataKey="xData"
Expand Down
6 changes: 5 additions & 1 deletion web/src/pages/app/setting/AppMonitor/PieCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useMemo } from "react";
import { useTranslation } from "react-i18next";
import clsx from "clsx";
import { Cell, Legend, Pie, PieChart, ResponsiveContainer } from "recharts";

import { uniformCapacity } from "@/utils/format";
Expand Down Expand Up @@ -45,7 +46,10 @@ export default function PieCard(props: {

return (
<div className="mb-2 h-1/2 rounded-xl border border-grayModern-200 bg-[#F8FAFB] p-4">
<div className="font-medium text-grayModern-900">{title}</div>
<span className={clsx("flex items-center font-medium text-grayModern-900")}>
<div className="mr-2 h-3 w-1 whitespace-nowrap rounded-xl bg-primary-600" />
{title}
</span>
<ResponsiveContainer>
<PieChart>
<Pie
Expand Down