add contests
This commit is contained in:
@@ -5,7 +5,6 @@ import { cn } from '../../../../lib/cn';
|
||||
import MissionsBlock from './MissionsBlock';
|
||||
import {
|
||||
deleteMission,
|
||||
fetchMyMissions,
|
||||
setMissionsStatus,
|
||||
} from '../../../../redux/slices/missions';
|
||||
import ConfirmModal from '../../../../components/modal/ConfirmModal';
|
||||
@@ -43,14 +42,16 @@ const Item: FC<ItemProps> = ({
|
||||
|
||||
const Missions = () => {
|
||||
const dispatch = useAppDispatch();
|
||||
const missions = useAppSelector((state) => state.missions.missions);
|
||||
const status = useAppSelector((state) => state.missions.statuses.fetchMy);
|
||||
|
||||
const [modalDeleteTask, setModalDeleteTask] = useState<boolean>(false);
|
||||
const [taskdeleteId, setTaskDeleteId] = useState<number>(0);
|
||||
|
||||
const { data: missionData } = useAppSelector(
|
||||
(state) => state.profile.missions,
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(setMenuActiveProfilePage('missions'));
|
||||
dispatch(fetchMyMissions());
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -66,42 +67,39 @@ const Missions = () => {
|
||||
</div>
|
||||
<div className="flex flex-row justify-between items-start">
|
||||
<div className="flex gap-[10px]">
|
||||
<Item count={14} totalCount={123} title="Задачи" />
|
||||
<Item
|
||||
count={missionData?.summary?.total?.solved ?? 0}
|
||||
totalCount={
|
||||
missionData?.summary?.total?.total ?? 0
|
||||
}
|
||||
title={
|
||||
missionData?.summary?.total?.label ??
|
||||
'Задачи'
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex gap-[20px]">
|
||||
<Item
|
||||
count={14}
|
||||
totalCount={123}
|
||||
title="Easy"
|
||||
color="green"
|
||||
/>
|
||||
<Item
|
||||
count={14}
|
||||
totalCount={123}
|
||||
title="Medium"
|
||||
color="orange"
|
||||
/>
|
||||
<Item
|
||||
count={14}
|
||||
totalCount={123}
|
||||
title="Hard"
|
||||
color="red"
|
||||
/>
|
||||
{missionData?.summary?.buckets?.map((bucket) => (
|
||||
<Item
|
||||
key={bucket.key}
|
||||
count={bucket.solved}
|
||||
totalCount={bucket.total}
|
||||
title={bucket.label}
|
||||
color={
|
||||
bucket.key === 'easy'
|
||||
? 'green'
|
||||
: bucket.key === 'medium'
|
||||
? 'orange'
|
||||
: 'red'
|
||||
}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-[24px] font-bold text-liquid-white">
|
||||
Компетенции
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap gap-[10px]">
|
||||
<Item count={14} totalCount={123} title="Массивы" />
|
||||
<Item count={14} totalCount={123} title="Списки" />
|
||||
<Item count={14} totalCount={123} title="Стэк" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="p-[20px]">
|
||||
<MissionsBlock
|
||||
missions={missions ?? []}
|
||||
missions={missionData?.authored.items ?? []}
|
||||
title="Мои миссии"
|
||||
setTastDeleteId={setTaskDeleteId}
|
||||
setDeleteModalActive={setModalDeleteTask}
|
||||
|
||||
Reference in New Issue
Block a user