Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Feat: #BBB-14 알고리즘 문제 피드백 모달 구현" #29

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions app/study/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ export default function StudyPage() {
}
return (
<div className="flex space-x-4 justify-center">
<StudyDashBoard
details={details}
studyId={Number(studyId)}
round={round}
setRound={setRound}
/>
<StudyDashBoard details={details} round={round} setRound={setRound} />
<StudyAbout details={details} users={round.users} />
</div>
);
Expand Down
42 changes: 8 additions & 34 deletions components/study/dashboard/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,64 +14,38 @@ import {
TableRow
} from '@/components/ui/table/table';
import getRound from '@/lib/api/study/get-round';
import { userState } from '@/recoil/userAtom';
import {
AlgorithmProblemInfo,
AlgorithmRound,
StudyDetails
} from '@/types/study/study-detail';
import { AlgorithmRound, StudyDetails } from '@/types/study/study-detail';
import { useParams } from 'next/navigation';
import { useRecoilState } from 'recoil';
import FeedbackDialog from '../feedback-dialog';

export default function StudyDashBoard({
details,
studyId,
round,
setRound
}: {
details: StudyDetails;
studyId: number;
round: AlgorithmRound;
setRound: (round: AlgorithmRound) => void;
}) {
return (
<div className="mt-5 bg-background rounded-lg border p-6 w-full max-w-4xl h-full">
<DashBoardHeader round={round} setRound={setRound} details={details} />
<DashBoardBody round={round} studyId={studyId} />
<DashBoardBody round={round} />
</div>
);
}

function DashBoardBody({
round,
studyId
}: {
round: AlgorithmRound;
studyId: number;
}) {
const [my, _] = useRecoilState(userState);
const myTasks = round.users[my!.id].tasks;
function DashBoardBody({ round }: { round: AlgorithmRound }) {
return (
<div className="overflow-auto rounded-lg border">
<Table>
<TableHeader>
<TableRow>
<TableHead className="text-center">스터디원</TableHead>
{Object.entries(round.problems).map(
([problemId, problem]: [string, AlgorithmProblemInfo], index) => (
<TableHead key={index} className="text-center">
<p>{problem.title}</p>

{myTasks[Number(problemId)] && (
<FeedbackDialog
problem={{ ...problem, problemId: Number(problemId) }}
studyId={studyId}
></FeedbackDialog>
)}
</TableHead>
)
)}
{Object.values(round.problems).map((problem, index) => (
<TableHead key={index} className="text-center">
{problem.title}
</TableHead>
))}
</TableRow>
</TableHeader>
<TableBody>
Expand Down
7 changes: 2 additions & 5 deletions components/study/dashboard/row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import {
StudyMemberInfo
} from '@/types/study/study-detail';

import { userState } from '@/recoil/userAtom';
import { useState } from 'react';
import { useRecoilState } from 'recoil';

export function Row({
userId,
Expand All @@ -25,7 +23,6 @@ export function Row({
// await refreshSolveTF(userId);
setIsLoading(false);
};
const [my, _] = useRecoilState(userState);

return (
<TableRow>
Expand All @@ -35,11 +32,11 @@ export function Row({
<RefreshIcon className={isLoading ? 'animate-spin' : ''} />
</Button>
</TableCell>
{Object.entries(problems).map(([key, problem]) => (
{Object.entries(problems).map(([key, value]) => (
<TableCell key={key} className="text-center">
{user.tasks[Number(key)] ? (
<div className="flex items-center justify-center">
<CheckIcon className="w-5 h-5" />
<CheckIcon className="w-5 h-5 text-primary" />
</div>
) : (
<div className="flex items-center justify-center">
Expand Down
196 changes: 0 additions & 196 deletions components/study/feedback-dialog.tsx

This file was deleted.

30 changes: 0 additions & 30 deletions components/ui/checkbox/checkbox.tsx

This file was deleted.

Loading
Loading