♻️ refactor(InvitationCard): restructure cards with title prop and clean up styling
- Move card titles (earnings, total revenue, invitations) to Card title prop for consistency - Remove custom color classes in favor of Semi-UI's built-in type system - Standardize Text component usage with strong and tertiary types - Improve code maintainability and visual consistency across all cards - Align structure with existing reward description card pattern
This commit is contained in:
@@ -18,8 +18,10 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Card, Avatar, Skeleton } from '@douyinfe/semi-ui';
|
||||
import { Card, Avatar, Skeleton, Tag } from '@douyinfe/semi-ui';
|
||||
import { VChart } from '@visactor/react-vchart';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const StatsCards = ({
|
||||
groupedStatsData,
|
||||
@@ -28,6 +30,8 @@ const StatsCards = ({
|
||||
CARD_PROPS,
|
||||
CHART_CONFIG
|
||||
}) => {
|
||||
const navigate = useNavigate();
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="mb-4">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
|
||||
@@ -72,7 +76,19 @@ const StatsCards = ({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{(loading || (item.trendData && item.trendData.length > 0)) && (
|
||||
{item.title === t('当前余额') ? (
|
||||
<Tag
|
||||
color="white"
|
||||
shape='circle'
|
||||
size="large"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
navigate('/console/topup');
|
||||
}}
|
||||
>
|
||||
{t('充值')}
|
||||
</Tag>
|
||||
) : (loading || (item.trendData && item.trendData.length > 0)) && (
|
||||
<div className="w-24 h-10">
|
||||
<VChart
|
||||
spec={getTrendSpec(item.trendData, item.trendColor)}
|
||||
|
||||
Reference in New Issue
Block a user