mnoga che sdelal
This commit is contained in:
@ -3,6 +3,7 @@ import { Box, Typography } from '@mui/material';
|
||||
import CustomTooltip from './Notifications/CustomTooltip';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { fetchCoins } from '../api';
|
||||
import type { SxProps, Theme } from '@mui/material/styles';
|
||||
|
||||
interface CoinsDisplayProps {
|
||||
// Основные пропсы
|
||||
@ -23,6 +24,8 @@ interface CoinsDisplayProps {
|
||||
// Стилизация
|
||||
backgroundColor?: string;
|
||||
textColor?: string;
|
||||
|
||||
sx?: SxProps<Theme>;
|
||||
}
|
||||
|
||||
export default function CoinsDisplay({
|
||||
@ -44,6 +47,8 @@ export default function CoinsDisplay({
|
||||
// Стилизация
|
||||
backgroundColor = 'rgba(0, 0, 0, 0.2)',
|
||||
textColor = 'white',
|
||||
|
||||
sx,
|
||||
}: CoinsDisplayProps) {
|
||||
const [coins, setCoins] = useState<number>(externalValue || 0);
|
||||
const [isLoading, setIsLoading] = useState<boolean>(false);
|
||||
@ -142,6 +147,8 @@ export default function CoinsDisplay({
|
||||
cursor: showTooltip ? 'help' : 'default',
|
||||
opacity: isLoading ? 0.7 : 1,
|
||||
transition: 'opacity 0.2s ease',
|
||||
|
||||
...sx,
|
||||
}}
|
||||
onClick={username ? handleRefresh : undefined}
|
||||
title={username ? 'Нажмите для обновления' : undefined}
|
||||
|
||||
Reference in New Issue
Block a user