Merge branch 'feat/VersionsExplorer' of https://git.popa-popa.ru/DIKER/popa-launcher into feat/VersionsExplorer

This commit is contained in:
2025-07-21 17:02:29 +05:00
7 changed files with 150 additions and 19 deletions

View File

@ -107,6 +107,16 @@ export default function CapeCard({
color={actionButton.color as 'primary' | 'success' | 'error'}
onClick={() => onAction(capeId)}
disabled={actionDisabled}
sx={{
borderRadius: '20px',
p: '5px 25px',
color: 'white',
backgroundColor: 'rgb(0, 134, 0)',
'&:hover': {
backgroundColor: 'rgba(0, 134, 0, 0.5)',
},
fontFamily: 'Benzin-Bold',
}}
>
{actionButton.text}
</Button>

View File

@ -34,6 +34,7 @@ export default function TopBar({ onRegister, username }: TopBarProps) {
const navigate = useNavigate();
const [coins, setCoins] = useState<number>(0);
const [value, setValue] = useState(0);
const [activePage, setActivePage] = useState('versions');
const handleChange = (event: React.SyntheticEvent, newValue: number) => {
setValue(newValue);
@ -60,7 +61,18 @@ export default function TopBar({ onRegister, username }: TopBarProps) {
return 'Запуск';
}
if (isVersionsExplorerPage) {
return 'Версии';
if (activePage === 'versions') {
return 'Версии';
}
if (activePage === 'profile') {
return 'Профиль';
}
if (activePage === 'shop') {
return 'Магазин';
}
if (activePage === 'marketplace') {
return 'Рынок';
}
}
return 'Неизвестная страница';
};
@ -122,7 +134,6 @@ export default function TopBar({ onRegister, username }: TopBarProps) {
{(isLaunchPage || isRegistrationPage) && (
<Button
variant="outlined"
color="primary"
onClick={() => handleLaunchPage()}
sx={{
width: '3em',
@ -138,42 +149,95 @@ export default function TopBar({ onRegister, username }: TopBarProps) {
</Button>
)}
{!isLaunchPage && !isRegistrationPage && !isLoginPage && (
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
<Box
sx={{
borderBottom: 1,
borderColor: 'transparent',
'& .MuiTabs-indicator': {
backgroundColor: 'rgba(255, 77, 77, 1)',
},
}}
>
<Tabs
value={value}
onChange={handleChange}
aria-label="basic tabs example"
disableRipple={true}
>
<Tab
label="Версии"
disableRipple={true}
onClick={() => {
setActivePage('versions');
}}
sx={{
color: 'white',
fontFamily: 'Benzin-Bold',
fontSize: '0.7em',
'&.Mui-selected': {
color: 'rgba(255, 77, 77, 1)',
},
'&:hover': {
color: 'rgb(199, 199, 199)',
},
transition: 'all 0.3s ease',
}}
/>
<Tab
label="Профиль"
disableRipple={true}
onClick={() => {
setActivePage('profile');
}}
sx={{
color: 'white',
fontFamily: 'Benzin-Bold',
fontSize: '0.7em',
'&.Mui-selected': {
color: 'rgba(255, 77, 77, 1)',
},
'&:hover': {
color: 'rgb(199, 199, 199)',
},
transition: 'all 0.3s ease',
}}
/>
<Tab
label="Магазин"
disableRipple={true}
onClick={() => {
setActivePage('shop');
}}
sx={{
color: 'white',
fontFamily: 'Benzin-Bold',
fontSize: '0.7em',
'&.Mui-selected': {
color: 'rgba(255, 77, 77, 1)',
},
'&:hover': {
color: 'rgb(199, 199, 199)',
},
transition: 'all 0.3s ease',
}}
/>
<Tab
label="Рынок"
disableRipple={true}
onClick={() => {
setActivePage('marketplace');
}}
sx={{
color: 'white',
fontFamily: 'Benzin-Bold',
fontSize: '0.7em',
'&.Mui-selected': {
color: 'rgba(255, 77, 77, 1)',
},
'&:hover': {
color: 'rgb(199, 199, 199)',
},
transition: 'all 0.3s ease',
}}
/>
</Tabs>
@ -193,7 +257,10 @@ export default function TopBar({ onRegister, username }: TopBarProps) {
WebkitAppRegion: 'drag',
}}
>
<Typography variant="h6" sx={{ color: 'white' }}>
<Typography
variant="h6"
sx={{ color: 'white', fontFamily: 'Benzin-Bold' }}
>
{getPageTitle()}
</Typography>
</Box>

View File

@ -221,9 +221,18 @@ export default function Marketplace() {
</Typography>
<Button
variant="contained"
color="primary"
onClick={checkPlayerStatus}
sx={{ mt: 2 }}
sx={{
mt: '1%',
borderRadius: '20px',
p: '10px 25px',
color: 'white',
backgroundColor: 'rgb(255, 77, 77)',
'&:hover': {
backgroundColor: 'rgba(255, 77, 77, 0.5)',
},
fontFamily: 'Benzin-Bold',
}}
>
Проверить снова
</Button>

View File

@ -167,7 +167,9 @@ export default function Profile() {
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
gap: 2,
gap: '100px',
width: '100%',
justifyContent: 'center',
}}
>
{loading ? (
@ -185,6 +187,20 @@ export default function Profile() {
}}
>
{/* Используем переработанный компонент SkinViewer */}
<Typography
sx={{
fontFamily: 'Benzin-Bold',
alignSelf: 'center',
justifySelf: 'center',
textAlign: 'center',
width: '100%',
mb: '5vw',
fontSize: '3vw',
color: 'white',
}}
>
{username}
</Typography>
<SkinViewer
width={300}
height={400}
@ -195,7 +211,13 @@ export default function Profile() {
/>
</Paper>
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
<Box
sx={{
display: 'flex',
flexDirection: 'column',
gap: 2,
}}
>
<Box
sx={{
width: '100%',
@ -284,9 +306,17 @@ export default function Profile() {
)}
<Button
sx={{ color: 'white' }}
sx={{
color: 'white',
borderRadius: '20px',
p: '10px 25px',
backgroundColor: 'rgb(0, 134, 0)',
'&:hover': {
backgroundColor: 'rgba(0, 134, 0, 0.5)',
},
fontFamily: 'Benzin-Bold',
}}
variant="contained"
color="primary"
fullWidth
onClick={handleUploadSkin}
disabled={uploadStatus === 'loading' || !skinFile}

View File

@ -83,9 +83,10 @@ export default function Shop() {
gap: '2vw',
justifyContent: 'center',
alignItems: 'center',
width: '100%',
height: '100%',
}}
>
<Typography variant="h4">Shop</Typography>
{loading ? (
<Typography>Загрузка...</Typography>
) : (
@ -93,9 +94,11 @@ export default function Shop() {
sx={{
display: 'flex',
flexDirection: 'column',
flexWrap: 'wrap',
alignContent: 'flex-start',
width: '90%',
height: '80%',
gap: '2vw',
justifyContent: 'center',
alignItems: 'center',
}}
>
<Typography variant="h6">Доступные плащи</Typography>