refactor(layout, i18n, admin): 优化布局结构与多语言支持
调整 AdminShell 组件的子组件顺序,提升代码可读性。更新 admin-breadcrumb 组件,简化导航标签翻译逻辑,确保多语言支持的一致性。重构 admin-language-switcher 组件,优化语言切换的用户体验,增强界面交互性。更新多语言配置,新增登录界面的副标题,提升用户体验。
This commit is contained in:
@@ -175,12 +175,14 @@ export function PlayBreakdownChart({
|
||||
formatMoney,
|
||||
currency,
|
||||
playLabel,
|
||||
compact = false,
|
||||
}: {
|
||||
rows: AdminDashboardAnalyticsPlayRow[];
|
||||
metric: DashboardAnalyticsMetric;
|
||||
formatMoney: MoneyFormatter;
|
||||
currency: string | null;
|
||||
playLabel: (code: string, dimension: number) => string;
|
||||
compact?: boolean;
|
||||
}): ReactElement {
|
||||
const { t } = useTranslation("dashboard");
|
||||
const activeMetric = metric === "overview" ? "bet" : metric;
|
||||
@@ -216,19 +218,21 @@ export function PlayBreakdownChart({
|
||||
return <DashboardChartEmpty message={t("analytics.noPlayData")} />;
|
||||
}
|
||||
|
||||
const chartHeight = Math.min(480, Math.max(180, rows.length * 36 + 48));
|
||||
const chartHeight = compact
|
||||
? Math.max(160, rows.length * 32 + 24)
|
||||
: Math.min(480, Math.max(180, rows.length * 36 + 48));
|
||||
|
||||
return (
|
||||
<ChartContainer
|
||||
config={chartConfig}
|
||||
className="aspect-auto w-full"
|
||||
className="aspect-auto w-full min-w-0"
|
||||
style={{ height: chartHeight }}
|
||||
>
|
||||
<BarChart
|
||||
accessibilityLayer
|
||||
layout="vertical"
|
||||
data={chartData}
|
||||
margin={{ top: 4, right: 16, bottom: 4, left: 4 }}
|
||||
margin={{ top: 4, right: 8, bottom: 4, left: 0 }}
|
||||
>
|
||||
<XAxis type="number" hide />
|
||||
<ChartTooltip
|
||||
@@ -255,7 +259,7 @@ export function PlayBreakdownChart({
|
||||
/>
|
||||
}
|
||||
/>
|
||||
<Bar dataKey="value" radius={4} barSize={14}>
|
||||
<Bar dataKey="value" radius={4} barSize={compact ? 12 : 14}>
|
||||
{chartData.map((entry) => (
|
||||
<Cell key={entry.id} fill={entry.fill} />
|
||||
))}
|
||||
@@ -263,10 +267,13 @@ export function PlayBreakdownChart({
|
||||
<YAxis
|
||||
type="category"
|
||||
dataKey="label"
|
||||
width={100}
|
||||
width={compact ? 76 : 100}
|
||||
tickLine={false}
|
||||
axisLine={false}
|
||||
tick={{ fontSize: 11 }}
|
||||
tick={{ fontSize: 10 }}
|
||||
tickFormatter={(value) =>
|
||||
typeof value === "string" && value.length > 10 ? `${value.slice(0, 10)}…` : String(value)
|
||||
}
|
||||
/>
|
||||
</BarChart>
|
||||
</ChartContainer>
|
||||
|
||||
Reference in New Issue
Block a user