add contests

This commit is contained in:
Виталий Лавшонок
2025-12-05 23:42:18 +03:00
parent 358c7def78
commit fd34761745
36 changed files with 2518 additions and 710 deletions

View File

@@ -4,19 +4,47 @@ import RightPanel from './RightPanel';
import Missions from './missions/Missions';
import Contests from './contests/Contests';
import ArticlesBlock from './articles/ArticlesBlock';
import { useAppDispatch } from '../../../redux/hooks';
import { useAppDispatch, useAppSelector } from '../../../redux/hooks';
import { useEffect } from 'react';
import { setMenuActivePage } from '../../../redux/slices/store';
import { useQuery } from '../../../hooks/useQuery';
import {
fetchProfile,
fetchProfileArticles,
fetchProfileContests,
fetchProfileMissions,
} from '../../../redux/slices/profile';
const Account = () => {
const dispatch = useAppDispatch();
const myname = useAppSelector((state) => state.auth.username);
const query = useQuery();
const username = query.get('username') ?? myname ?? '';
useEffect(() => {
dispatch(setMenuActivePage('account'));
}, []);
if (username == myname) dispatch(setMenuActivePage('account'));
dispatch(
fetchProfileMissions({
username: username,
recentPageSize: 1,
authoredPageSize: 100,
}),
);
dispatch(fetchProfileArticles({ username: username, pageSize: 100 }));
dispatch(
fetchProfileContests({
username: username,
pastPageSize: 100,
minePageSize: 100,
upcomingPageSize: 100,
}),
);
dispatch(fetchProfile(username));
}, [username]);
return (
<div className="h-full w-[calc(100%+250px)] box-border grid grid-cols-[1fr,520px] relative divide-x-[1px] divide-liquid-lighter">
<div className="h-full w-[calc(100%+250px)] box-border grid grid-cols-[1fr,430px] relative divide-x-[1px] divide-liquid-lighter">
<div className=" h-full min-h-0 flex flex-col">
<div className=" h-full grid grid-rows-[80px,1fr] ">
<div className="h-full w-full">