From 79e3dc98646f103ffd0199a7c780c89bb24296fe Mon Sep 17 00:00:00 2001 From: Primakov Alexandr Alexandrovich Date: Tue, 4 Nov 2025 11:55:09 +0300 Subject: [PATCH] Refactor Header and TaskWorkspace components to enhance UI and user feedback. Header now accepts chainName and taskProgress props for improved context display. TaskWorkspace updates include styling adjustments, conditional rendering for queue status, and feedback messages, streamlining user interaction during task processing. --- src/components/Header.tsx | 25 ++++-- src/components/personal/TaskWorkspace.tsx | 105 ++++++++++------------ src/pages/main/main.tsx | 28 +----- 3 files changed, 73 insertions(+), 85 deletions(-) diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 2976f08..61c0ccc 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -3,7 +3,12 @@ import { Box, Button, Flex, Heading, Text } from '@chakra-ui/react' import { useChallenge } from '../context/ChallengeContext' -export const Header = () => { +interface HeaderProps { + chainName?: string + taskProgress?: string +} + +export const Header = ({ chainName, taskProgress }: HeaderProps) => { const { nickname, logout } = useChallenge() if (!nickname) return null @@ -13,11 +18,21 @@ export const Header = () => { - Challenge Platform + {chainName || 'Challenge Platform'} - - {nickname} - + + + {nickname} + + {taskProgress && ( + <> + + + {taskProgress} + + + )} + - + )} {/* Результат проверки - требуется доработка */} {needsRevision && ( - - - ⚠️ - - Требуется доработка - - {finalSubmission?.feedback && ( - - - Комментарий проверяющего: + + + ⚠️ + + + + Требуется доработка - + + (попытка №{finalSubmission?.attemptNumber}) + + + {finalSubmission?.feedback && ( + {finalSubmission.feedback} - - )} - - Попытка №{finalSubmission?.attemptNumber} - - + )} + + )} - + Ваше решение