After doing some design on some icons

This commit is contained in:
Your Name 2026-07-01 15:24:58 +02:00
parent 6c4650ccf3
commit b0630d9364
13 changed files with 272 additions and 241 deletions

View File

@ -17,7 +17,6 @@ import {
} from '@mui/material';
import ArrowBackRoundedIcon from '@mui/icons-material/ArrowBackRounded';
import CandlestickChartRoundedIcon from '@mui/icons-material/CandlestickChartRounded';
import RefreshRoundedIcon from '@mui/icons-material/RefreshRounded';
import { useEffect, useMemo, useRef, useState } from 'react';
import { Link as RouterLink } from 'react-router-dom';
import { useTheme } from '@mui/material/styles';
@ -44,6 +43,7 @@ import { usePaginatedCandleChart } from './hooks/usePaginatedCandleChart';
import type { CandleDirection, StakeAccountKind } from './types';
import { extractGameApiError } from './utils/extractGameApiError';
import { useAuth } from '../../shared/auth/AuthContext';
import { PageHeader, RefreshIconButton } from '../../shared/components/PageHeader';
const BALANCES_VISIBLE_STORAGE_KEY = 'prediqo-candle-balances-visible';
@ -484,31 +484,30 @@ export function CandlePredictPage() {
return (
<Box sx={{ minWidth: 0 }}>
<Stack
direction={{ xs: 'column', sm: 'row' }}
spacing={1.5}
sx={{ alignItems: { sm: 'center' }, mb: 2.5 }}
>
<IconButton component={RouterLink} to="/home" aria-label="Back to home">
<ArrowBackRoundedIcon />
</IconButton>
<Box sx={{ flex: 1, minWidth: 0 }}>
<PageHeader
leading={
<IconButton component={RouterLink} to="/home" aria-label="Back to home" sx={{ flexShrink: 0 }}>
<ArrowBackRoundedIcon />
</IconButton>
}
icon={<CandlestickChartRoundedIcon color="primary" sx={{ fontSize: 36 }} />}
title={
<Stack direction="row" spacing={1} sx={{ alignItems: 'center', flexWrap: 'wrap' }}>
<CandlestickChartRoundedIcon color="primary" />
<Typography variant="h4" sx={{ fontWeight: 900, fontSize: { xs: '1.5rem', sm: '2rem' } }}>
Candle Predict
</Typography>
<Chip size="small" label={interval.label} color="primary" />
</Stack>
<Typography sx={{ opacity: 0.7, mt: 0.5 }}>
}
subtitle={
<>
Prédisez si la prochaine bougie sera baissière (<strong>Short ↓</strong>) ou haussière (
<strong>Long ↑</strong>), puis attendez le résultat de la manche.
</Typography>
</Box>
<IconButton onClick={() => void refresh()} aria-label="Refresh">
<RefreshRoundedIcon />
</IconButton>
</Stack>
</>
}
mb={2.5}
actions={<RefreshIconButton label="Refresh game" onClick={() => void refresh()} />}
/>
<StakeWalletBalanceBar
mainLabel={walletLabels.main}

View File

@ -418,14 +418,15 @@ export function RecentPredictionsPanel({
return (
<Paper sx={{ p: 2, borderRadius: 3, minWidth: 0 }}>
<Stack
direction={{ xs: 'column', sm: 'row' }}
direction="row"
spacing={1}
sx={{ alignItems: { sm: 'center' }, justifyContent: 'space-between', mb: 1.5 }}
useFlexGap
sx={{ alignItems: 'center', justifyContent: 'space-between', mb: 1.5, flexWrap: 'wrap' }}
>
<Typography variant="h6" sx={{ fontWeight: 900 }}>
<Typography variant="h6" sx={{ fontWeight: 900, flex: '1 1 auto', minWidth: 0 }}>
Recent predictions
</Typography>
<Typography variant="caption" sx={{ opacity: 0.65 }}>
<Typography variant="caption" sx={{ opacity: 0.65, flexShrink: 0 }}>
{total} total · {PREDICTIONS_PAGE_SIZE} per page
</Typography>
</Stack>

View File

@ -106,11 +106,12 @@ export function StakeWalletBalanceBar({
}}
>
<Stack
direction={{ xs: 'column', sm: 'row' }}
direction="row"
spacing={1}
sx={{ alignItems: { sm: 'center' }, justifyContent: 'space-between', mb: 1.5 }}
useFlexGap
sx={{ alignItems: 'center', justifyContent: 'space-between', mb: 1.5, flexWrap: 'nowrap' }}
>
<Typography variant="subtitle2" sx={{ fontWeight: 800 }}>
<Typography variant="subtitle2" sx={{ fontWeight: 800, flex: 1, minWidth: 0 }}>
Vos portefeuilles de mise
</Typography>
<Tooltip title={balancesVisible ? 'Masquer les soldes' : 'Afficher les soldes'}>
@ -118,6 +119,7 @@ export function StakeWalletBalanceBar({
size="small"
onClick={onToggleVisibility}
aria-label={balancesVisible ? 'Masquer les soldes' : 'Afficher les soldes'}
sx={{ flexShrink: 0 }}
>
{balancesVisible ? (
<VisibilityOffRoundedIcon fontSize="small" />

View File

@ -28,13 +28,13 @@ import {
import AddRoundedIcon from '@mui/icons-material/AddRounded';
import DeleteOutlineRoundedIcon from '@mui/icons-material/DeleteOutlineRounded';
import EditRoundedIcon from '@mui/icons-material/EditRounded';
import RefreshRoundedIcon from '@mui/icons-material/RefreshRounded';
import CampaignRoundedIcon from '@mui/icons-material/CampaignRounded';
import SportsEsportsRoundedIcon from '@mui/icons-material/SportsEsportsRounded';
import CandlestickChartRoundedIcon from '@mui/icons-material/CandlestickChartRounded';
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import { useMemo, useState } from 'react';
import { api } from '../../shared/services/api';
import { PageHeader, RefreshIconButton } from '../../shared/components/PageHeader';
import type { Advertisement, AdvertisementInput, Game, GameImplementationOption, GameInput } from '../home/types';
import { hasWebImplementation } from '../games/registry';
import { CandlePredictConfigPanel } from './CandlePredictConfigPanel';
@ -228,23 +228,11 @@ export function CatalogAdminPage() {
return (
<Box sx={{ minWidth: 0 }}>
<Stack
direction={{ xs: 'column', sm: 'row' }}
spacing={1.5}
sx={{ alignItems: { sm: 'flex-end' }, mb: 2 }}
>
<Box sx={{ flex: 1 }}>
<Typography variant="h4" sx={{ fontWeight: 900 }}>
Catalog
</Typography>
<Typography sx={{ opacity: 0.7, mt: 0.5 }}>
Manage games and dynamic home-page promotions.
</Typography>
</Box>
<IconButton onClick={refresh} aria-label="Refresh">
<RefreshRoundedIcon />
</IconButton>
</Stack>
<PageHeader
title="Catalog"
subtitle="Manage games and dynamic home-page promotions."
actions={<RefreshIconButton label="Refresh catalog" onClick={refresh} />}
/>
<Tabs value={tab} onChange={(_, v) => setTab(v)} sx={{ mb: 2 }} variant="scrollable" scrollButtons="auto">
<Tab value="games" icon={<SportsEsportsRoundedIcon />} iconPosition="start" label="Games" />

View File

@ -8,10 +8,9 @@ import {
Select,
Stack,
TextField,
Typography,
} from '@mui/material';
import RefreshRoundedIcon from '@mui/icons-material/RefreshRounded';
import FileDownloadRoundedIcon from '@mui/icons-material/FileDownloadRounded';
import { PageHeader, RefreshIconButton } from '../../../shared/components/PageHeader';
import type { DashboardFilters, DatePreset, GameKey } from '../types';
const DATE_PRESETS: { value: DatePreset; label: string }[] = [
@ -59,40 +58,30 @@ export function DashboardFiltersBar({
mb: 3,
}}
>
<Stack
direction={{ xs: 'column', lg: 'row' }}
spacing={2}
sx={{ alignItems: { lg: 'center' }, justifyContent: 'space-between' }}
>
<Box>
<Typography variant="h4" sx={{ fontWeight: 900, fontSize: { xs: '1.5rem', md: '2rem' } }}>
Dashboard Administrateur
</Typography>
<Typography sx={{ opacity: 0.7, mt: 0.5 }}>
Vue analytique de la plateforme — {periodLabel ?? 'période sélectionnée'}
</Typography>
</Box>
<Stack direction="row" spacing={1} sx={{ flexWrap: 'wrap' }}>
<Button
variant="outlined"
size="small"
startIcon={<RefreshRoundedIcon />}
onClick={onRefresh}
disabled={loading || disableActions}
>
Actualiser
</Button>
<Button
variant="outlined"
size="small"
startIcon={<FileDownloadRoundedIcon />}
onClick={onExport}
disabled={loading || disableActions}
>
Exporter
</Button>
</Stack>
</Stack>
<PageHeader
title="Dashboard Administrateur"
subtitle={`Vue analytique de la plateforme — ${periodLabel ?? 'période sélectionnée'}`}
mb={0}
actions={
<>
<RefreshIconButton
label="Actualiser le dashboard"
onClick={onRefresh}
disabled={loading || disableActions}
/>
<Button
variant="outlined"
size="small"
startIcon={<FileDownloadRoundedIcon />}
onClick={onExport}
disabled={loading || disableActions}
sx={{ flexShrink: 0 }}
>
Exporter
</Button>
</>
}
/>
<Stack direction={{ xs: 'column', md: 'row' }} spacing={2} sx={{ mt: 2.5, flexWrap: 'wrap' }}>
<FormControl size="small" sx={{ minWidth: { xs: '100%', sm: 200 }, width: { xs: '100%', sm: 'auto' } }}>

View File

@ -5,7 +5,6 @@ import {
Alert,
Box,
Chip,
IconButton,
Paper,
Skeleton,
Snackbar,
@ -14,7 +13,6 @@ import {
alpha,
} from '@mui/material';
import HomeRoundedIcon from '@mui/icons-material/HomeRounded';
import RefreshRoundedIcon from '@mui/icons-material/RefreshRounded';
import BoltRoundedIcon from '@mui/icons-material/BoltRounded';
import EmojiEventsRoundedIcon from '@mui/icons-material/EmojiEventsRounded';
import GridViewRoundedIcon from '@mui/icons-material/GridViewRounded';
@ -23,6 +21,7 @@ import { useNavigate } from 'react-router-dom';
import { GameCard } from './components/GameCard';
import { PromoCarousel } from './components/PromoCarousel';
import { PromoStrip } from './components/PromoStrip';
import { PageHeader, RefreshIconButton } from '../../shared/components/PageHeader';
import { useGames, useHeroAdvertisements, useStripAdvertisements } from './hooks/useCatalog';
import type { Game } from './types';
@ -65,33 +64,19 @@ export function HomePage() {
return (
<Box sx={{ minWidth: 0 }}>
<Stack
direction={{ xs: 'column', md: 'row' }}
spacing={1.5}
sx={{ alignItems: { md: 'flex-end' }, mb: 2.5 }}
>
<Box sx={{ flex: 1, minWidth: 0 }}>
<Stack direction="row" spacing={1} sx={{ alignItems: 'center', flexWrap: 'wrap' }}>
<HomeRoundedIcon color="primary" />
<Typography
variant="h4"
sx={{
fontWeight: 900,
letterSpacing: 0.2,
fontSize: { xs: '1.65rem', sm: '2.125rem' },
}}
>
Play & Predict
</Typography>
</Stack>
<Typography sx={{ opacity: 0.7, mt: 0.5, maxWidth: 640 }}>
Explore live prediction games, grab limited-time promos, and compete for rewards.
</Typography>
</Box>
<IconButton onClick={refreshAll} aria-label="Refresh catalog" disabled={loading}>
<RefreshRoundedIcon />
</IconButton>
</Stack>
<PageHeader
icon={<HomeRoundedIcon color="primary" sx={{ fontSize: 36 }} />}
title="Play & Predict"
subtitle="Explore live prediction games, grab limited-time promos, and compete for rewards."
mb={2.5}
actions={
<RefreshIconButton
label="Refresh catalog"
onClick={() => void refreshAll()}
disabled={loading}
/>
}
/>
{(gamesQ.isError || heroQ.isError) && (
<Alert severity="warning" sx={{ mb: 2, borderRadius: 2 }}>

View File

@ -11,7 +11,6 @@ import {
CardContent,
Chip,
Divider,
IconButton,
Paper,
Skeleton,
Snackbar,
@ -21,13 +20,13 @@ import {
Typography,
} from '@mui/material';
import PersonRoundedIcon from '@mui/icons-material/PersonRounded';
import RefreshRoundedIcon from '@mui/icons-material/RefreshRounded';
import EditRoundedIcon from '@mui/icons-material/EditRounded';
import SecurityRoundedIcon from '@mui/icons-material/SecurityRounded';
import BadgeRoundedIcon from '@mui/icons-material/BadgeRounded';
import dayjs from 'dayjs';
import { useState } from 'react';
import { useAuth } from '../../shared/auth/AuthContext';
import { PageHeader, PageSectionHeader, RefreshIconButton } from '../../shared/components/PageHeader';
import { ProfileEditForm } from './components/ProfileEditForm';
import { ChangePasswordForm } from './components/ChangePasswordForm';
import { TwoFactorPanel } from './components/TwoFactorPanel';
@ -53,26 +52,19 @@ export function ProfilePage() {
return (
<Box sx={{ minWidth: 0 }}>
<Stack
direction={{ xs: 'column', md: 'row' }}
spacing={1.5}
sx={{ alignItems: { md: 'flex-end' }, mb: 2.5 }}
>
<Box sx={{ flex: 1 }}>
<Stack direction="row" spacing={1} sx={{ alignItems: 'center' }}>
<PersonRoundedIcon color="primary" />
<Typography variant="h4" sx={{ fontWeight: 900, letterSpacing: 0.2 }}>
Profile
</Typography>
</Stack>
<Typography sx={{ opacity: 0.7, mt: 0.5 }}>
View and manage your personal information and account security.
</Typography>
</Box>
<IconButton onClick={refresh} aria-label="Refresh profile" disabled={profileQ.isLoading}>
<RefreshRoundedIcon />
</IconButton>
</Stack>
<PageHeader
icon={<PersonRoundedIcon color="primary" sx={{ fontSize: 36 }} />}
title="Profile"
subtitle="View and manage your personal information and account security."
mb={2.5}
actions={
<RefreshIconButton
label="Refresh profile"
onClick={() => void refresh()}
disabled={profileQ.isLoading}
/>
}
/>
{profileQ.isError && (
<Alert severity="error" sx={{ mb: 2, borderRadius: 2 }}>
@ -167,23 +159,21 @@ export function ProfilePage() {
>
<Card sx={{ borderRadius: 3 }}>
<CardContent sx={{ p: 2.5 }}>
<Stack
direction={{ xs: 'column', sm: 'row' }}
sx={{ alignItems: { sm: 'center' }, mb: 2, gap: 1 }}
>
<Typography variant="h6" sx={{ fontWeight: 800, flex: 1 }}>
Personal information
</Typography>
{profile && !editing && (
<Button
size="small"
startIcon={<EditRoundedIcon />}
onClick={() => setEditing(true)}
>
Edit
</Button>
)}
</Stack>
<PageSectionHeader
title="Personal information"
actions={
profile && !editing ? (
<Button
size="small"
startIcon={<EditRoundedIcon />}
onClick={() => setEditing(true)}
sx={{ flexShrink: 0 }}
>
Edit
</Button>
) : undefined
}
/>
{profileQ.isLoading ? (
<Stack spacing={1.5}>
{Array.from({ length: 5 }).map((_, i) => (

View File

@ -19,7 +19,6 @@ import {
} from '@mui/material';
import GroupAddRoundedIcon from '@mui/icons-material/GroupAddRounded';
import ContentCopyRoundedIcon from '@mui/icons-material/ContentCopyRounded';
import RefreshRoundedIcon from '@mui/icons-material/RefreshRounded';
import TableChartRoundedIcon from '@mui/icons-material/TableChartRounded';
import AccountTreeRoundedIcon from '@mui/icons-material/AccountTreeRounded';
import { useState } from 'react';
@ -29,6 +28,7 @@ import { ReferralTableView } from './components/ReferralTableView';
import { ReferralTreeView } from './components/ReferralTreeView';
import { ReferralCommissionsPanel } from './components/ReferralCommissionsPanel';
import { useReferralCommissions, useReferralDashboard } from './hooks/useReferralDashboard';
import { PageHeader, RefreshIconButton } from '../../shared/components/PageHeader';
const USDT_DECIMALS = 6;
@ -92,20 +92,18 @@ export function ReferralPage() {
return (
<Box sx={{ minWidth: 0 }}>
<Stack direction="row" spacing={1.5} sx={{ alignItems: 'center', mb: 2, flexWrap: 'wrap' }} useFlexGap>
<GroupAddRoundedIcon color="primary" sx={{ fontSize: 36 }} />
<Box sx={{ flex: 1, minWidth: 200 }}>
<Typography variant="h4" sx={{ fontWeight: 900 }}>
Referral program
</Typography>
<Typography variant="body2" color="text.secondary">
Build your network and earn commissions on your referrals&apos; activity.
</Typography>
</Box>
<IconButton aria-label="Refresh" onClick={() => void refreshAll()} disabled={dashQ.isFetching}>
<RefreshRoundedIcon />
</IconButton>
</Stack>
<PageHeader
icon={<GroupAddRoundedIcon color="primary" sx={{ fontSize: 36 }} />}
title="Referral program"
subtitle="Build your network and earn commissions on your referrals' activity."
actions={
<RefreshIconButton
label="Refresh referral data"
onClick={() => void refreshAll()}
disabled={dashQ.isFetching}
/>
}
/>
{dashQ.isError && <Alert severity="error">Failed to load referral dashboard.</Alert>}

View File

@ -32,7 +32,6 @@ import {
Typography,
} from '@mui/material';
import SecurityRoundedIcon from '@mui/icons-material/SecurityRounded';
import RefreshRoundedIcon from '@mui/icons-material/RefreshRounded';
import PlayArrowRoundedIcon from '@mui/icons-material/PlayArrowRounded';
import DownloadRoundedIcon from '@mui/icons-material/DownloadRounded';
import NotificationsActiveRoundedIcon from '@mui/icons-material/NotificationsActiveRounded';
@ -40,6 +39,7 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import { useState, useEffect } from 'react';
import { useSearchParams } from 'react-router-dom';
import { api } from '../../shared/services/api';
import { PageHeader, RefreshIconButton } from '../../shared/components/PageHeader';
import { ScrollableTable } from '../../shared/components/ScrollableTable';
import { humanToRaw } from '../wallet/utils/walletFormat';
@ -439,51 +439,58 @@ export function SecurityAdminPage() {
return (
<Box sx={{ minWidth: 0 }}>
<Stack direction="row" spacing={1.5} sx={{ alignItems: 'center', flexWrap: 'wrap', mb: 2 }}>
<SecurityRoundedIcon color="warning" />
<Typography variant="h4" sx={{ fontWeight: 900, flex: 1 }}>
Security
</Typography>
{creditSuccess && (
<Alert severity="success" onClose={() => setCreditSuccess(null)} sx={{ flex: '1 1 100%' }}>
{creditSuccess}
</Alert>
)}
<Button
variant="outlined"
startIcon={<RefreshRoundedIcon />}
onClick={() => {
void alertsQ.refetch();
void notificationsQ.refetch();
void creditsQ.refetch();
void tamperEventsQ.refetch();
}}
>
Refresh
</Button>
<PageHeader
icon={<SecurityRoundedIcon color="warning" sx={{ fontSize: 36 }} />}
title="Security"
actions={
<RefreshIconButton
label="Refresh security data"
onClick={() => {
void alertsQ.refetch();
void notificationsQ.refetch();
void creditsQ.refetch();
void tamperEventsQ.refetch();
}}
/>
}
/>
{creditSuccess && (
<Alert severity="success" onClose={() => setCreditSuccess(null)} sx={{ mb: 2 }}>
{creditSuccess}
</Alert>
)}
<Stack direction="row" spacing={1} useFlexGap sx={{ flexWrap: 'wrap', mb: 2 }}>
<Button
variant="contained"
color="warning"
size="small"
startIcon={<PlayArrowRoundedIcon />}
disabled={integrityMut.isPending}
onClick={() => integrityMut.mutate()}
sx={{ width: { xs: '100%', sm: 'auto' } }}
>
Run integrity check
</Button>
<Button
variant="contained"
color="error"
size="small"
startIcon={<PlayArrowRoundedIcon />}
disabled={tamperCheckMut.isPending}
onClick={() => tamperCheckMut.mutate()}
sx={{ width: { xs: '100%', sm: 'auto' } }}
>
Process DB tamper events
</Button>
<Button
variant="outlined"
color="warning"
size="small"
disabled={dismissSpuriousMut.isPending}
onClick={() => dismissSpuriousMut.mutate()}
sx={{ width: { xs: '100%', sm: 'auto' } }}
>
Dismiss false alerts
</Button>

View File

@ -22,10 +22,10 @@ import {
Typography,
} from '@mui/material';
import AccountBalanceWalletRoundedIcon from '@mui/icons-material/AccountBalanceWalletRounded';
import RefreshRoundedIcon from '@mui/icons-material/RefreshRounded';
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import { useState } from 'react';
import { api } from '../../shared/services/api';
import { PageHeader, RefreshIconButton } from '../../shared/components/PageHeader';
import { ScrollableTable } from '../../shared/components/ScrollableTable';
type WalletType = {
@ -142,26 +142,19 @@ export function TreasuryAdminPage() {
return (
<Box sx={{ minWidth: 0 }}>
<Stack
direction={{ xs: 'column', sm: 'row' }}
spacing={1}
sx={{ alignItems: { sm: 'center' }, mb: 2, flexWrap: 'wrap' }}
>
<AccountBalanceWalletRoundedIcon color="primary" />
<Typography variant="h4" sx={{ fontWeight: 900, flex: 1, fontSize: { xs: '1.65rem', sm: '2.125rem' } }}>
Treasury
</Typography>
<Button
startIcon={<RefreshRoundedIcon />}
onClick={() => {
void overviewQ.refetch();
void sweepsQ.refetch();
}}
sx={{ alignSelf: { xs: 'stretch', sm: 'auto' } }}
>
Refresh
</Button>
</Stack>
<PageHeader
icon={<AccountBalanceWalletRoundedIcon color="primary" sx={{ fontSize: 36 }} />}
title="Treasury"
actions={
<RefreshIconButton
label="Refresh treasury"
onClick={() => {
void overviewQ.refetch();
void sweepsQ.refetch();
}}
/>
}
/>
{overviewQ.isError && (
<Alert severity="error" sx={{ mb: 2 }}>

View File

@ -31,7 +31,6 @@ import {
Typography,
useMediaQuery,
} from '@mui/material';
import RefreshRoundedIcon from '@mui/icons-material/RefreshRounded';
import ContentCopyRoundedIcon from '@mui/icons-material/ContentCopyRounded';
import ExpandMoreRoundedIcon from '@mui/icons-material/ExpandMoreRounded';
import ExpandLessRoundedIcon from '@mui/icons-material/ExpandLessRounded';
@ -43,6 +42,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import dayjs from 'dayjs';
import { api } from '../../shared/services/api';
import { PageHeader, RefreshIconButton } from '../../shared/components/PageHeader';
import {
DataGrid,
GridToolbarColumnsButton,
@ -1081,19 +1081,11 @@ export function UserManagementPage() {
return (
<Grid container spacing={2.5} sx={{ minWidth: 0, overflowX: 'hidden' }}>
<Grid size={{ xs: 12 }}>
<Stack direction={{ xs: 'column', md: 'row' }} spacing={1} sx={{ alignItems: { md: 'flex-end' } }}>
<Box sx={{ flex: 1 }}>
<Typography variant="h4" sx={{ fontWeight: 900, letterSpacing: 0.2 }}>
Users
</Typography>
<Typography sx={{ opacity: 0.7, mt: 0.5 }}>
Advanced user table — filter, sort, select multiple users, and run batch actions.
</Typography>
</Box>
<IconButton onClick={() => q.refetch()} aria-label="Refresh" size="small">
<RefreshRoundedIcon fontSize="small" />
</IconButton>
</Stack>
<PageHeader
title="Users"
subtitle="Advanced user table — filter, sort, select multiple users, and run batch actions."
actions={<RefreshIconButton label="Refresh users" onClick={() => void q.refetch()} />}
/>
</Grid>
{selectedIds.length > 0 && (

View File

@ -6,7 +6,6 @@ import {
Box,
Button,
Chip,
IconButton,
Paper,
Skeleton,
Snackbar,
@ -19,10 +18,10 @@ import AccountBalanceWalletRoundedIcon from '@mui/icons-material/AccountBalanceW
import CallReceivedRoundedIcon from '@mui/icons-material/CallReceivedRounded';
import SendRoundedIcon from '@mui/icons-material/SendRounded';
import SouthWestRoundedIcon from '@mui/icons-material/SouthWestRounded';
import RefreshRoundedIcon from '@mui/icons-material/RefreshRounded';
import { useQuery } from '@tanstack/react-query';
import { useMemo, useState } from 'react';
import { api } from '../../shared/services/api';
import { PageHeader, RefreshIconButton } from '../../shared/components/PageHeader';
import { BonusWalletCard } from './components/BonusWalletCard';
import { TestWalletCard } from './components/TestWalletCard';
import { MainAssetCard } from './components/MainAssetCard';
@ -80,26 +79,23 @@ export function WalletPage() {
return (
<Box sx={{ minWidth: 0 }}>
<Stack
direction={{ xs: 'column', md: 'row' }}
spacing={1.5}
sx={{ alignItems: { md: 'flex-end' }, mb: 2.5 }}
>
<Box sx={{ flex: 1 }}>
<Stack direction="row" spacing={1} sx={{ alignItems: 'center' }}>
<AccountBalanceWalletRoundedIcon color="primary" />
<Typography variant="h4" sx={{ fontWeight: 900, letterSpacing: 0.2 }}>
Wallet
</Typography>
</Stack>
<Typography sx={{ opacity: 0.7, mt: 0.5 }}>
<PageHeader
icon={<AccountBalanceWalletRoundedIcon color="primary" sx={{ fontSize: 36 }} />}
title="Wallet"
subtitle={
<>
Deposit <b>USDT (TRC20)</b> on TRON to fund your account and play Candle Predict.
</Typography>
</Box>
<IconButton onClick={refreshAll} aria-label="Refresh wallet" disabled={loading}>
<RefreshRoundedIcon />
</IconButton>
</Stack>
</>
}
mb={2.5}
actions={
<RefreshIconButton
label="Refresh wallet"
onClick={() => void refreshAll()}
disabled={loading}
/>
}
/>
{balancesQ.isError && (
<Alert severity="error" sx={{ mb: 2, borderRadius: 2 }}>

View File

@ -0,0 +1,91 @@
import RefreshRoundedIcon from '@mui/icons-material/RefreshRounded';
import { Box, IconButton, Stack, Typography } from '@mui/material';
import type { ReactNode } from 'react';
export type PageHeaderProps = {
icon?: ReactNode;
title: ReactNode;
subtitle?: ReactNode;
/** Control before the page icon (e.g. back button). */
leading?: ReactNode;
/** Right-side actions (refresh, export, etc.). */
actions?: ReactNode;
mb?: number;
};
/** Page title row — keeps actions aligned on the right on small screens (Referral-style). */
export function PageHeader({ icon, title, subtitle, leading, actions, mb = 2 }: PageHeaderProps) {
return (
<Stack
direction="row"
spacing={1.5}
useFlexGap
sx={{ alignItems: 'center', mb, flexWrap: 'wrap' }}
>
{leading}
{icon}
<Box sx={{ flex: '1 1 auto', minWidth: { xs: 0, sm: 200 } }}>
{typeof title === 'string' ? (
<Typography
variant="h4"
sx={{ fontWeight: 900, fontSize: { xs: '1.5rem', sm: '2.125rem' }, letterSpacing: 0.2 }}
>
{title}
</Typography>
) : (
title
)}
{subtitle != null &&
(typeof subtitle === 'string' ? (
<Typography variant="body2" color="text.secondary" sx={{ mt: 0.5 }}>
{subtitle}
</Typography>
) : (
subtitle
))}
</Box>
{actions != null && (
<Stack direction="row" spacing={0.5} useFlexGap sx={{ flexShrink: 0, alignItems: 'center', flexWrap: 'wrap' }}>
{actions}
</Stack>
)}
</Stack>
);
}
type RefreshIconButtonProps = {
onClick: () => void;
disabled?: boolean;
label?: string;
};
export function RefreshIconButton({ onClick, disabled, label = 'Refresh' }: RefreshIconButtonProps) {
return (
<IconButton aria-label={label} onClick={onClick} disabled={disabled} sx={{ flexShrink: 0 }}>
<RefreshRoundedIcon />
</IconButton>
);
}
type PageSectionHeaderProps = {
title: string;
actions?: ReactNode;
mb?: number;
};
/** Section title inside a card — title and actions stay on one row when possible. */
export function PageSectionHeader({ title, actions, mb = 2 }: PageSectionHeaderProps) {
return (
<Stack
direction="row"
spacing={1}
useFlexGap
sx={{ alignItems: 'center', mb, flexWrap: 'wrap' }}
>
<Typography variant="h6" sx={{ fontWeight: 800, flex: '1 1 auto', minWidth: 0 }}>
{title}
</Typography>
{actions != null && <Box sx={{ flexShrink: 0 }}>{actions}</Box>}
</Stack>
);
}