db_kyc_project/frontend/src/shared/Pages/ClickerPage/ClickerPage.tsx
2024-11-18 16:33:44 +03:00

38 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React, { useEffect, useState } from 'react';
import styles from './clickerpage.module.css';
import { ClickerBtn } from '../../Clicker/ClickerBtn';
import { Profile } from '../../Clicker/Profile';
import { ETextStyles } from '../../texts';
import { SectionsBlock } from '../../Clicker/SectionsBlock';
import { ClickerFooter } from '../../Clicker/ClickerFooter';
import { StyleElements } from '../../Clicker/StyleElements';
interface IClickerPageInterface {
name: string,
points: number,
energy: number,
img: string
}
export function ClickerPage({ name, points, img, energy }: IClickerPageInterface) {
const styleIndex = Number(localStorage.getItem('selectedStyle'));
const [coins, setCoins] = useState(points);
return (
<div className={styles.container}>
<div className={styles.records}>
<Profile name={name} points={coins} className={styles.profile} img={img}/>
<h1 style={ETextStyles.RwSb24100} className={styles.title}>Мои рекорды</h1>
<SectionsBlock />
</div>
<div className={styles.clicker}>
<ClickerBtn coins={coins} setCoins={setCoins} energy={energy}/>
</div>
<ClickerFooter />
{styleIndex != 0 && <div>
<StyleElements styleIndex={styleIndex}/>
</div>}
</div>
);
}