Skip to content

Commit

Permalink
Merge pull request #172 from dorimu0/refact/component
Browse files Browse the repository at this point in the history
  • Loading branch information
Regulus0811 authored Jul 1, 2024
2 parents 8ca91ff + 0f64f61 commit 6379a49
Show file tree
Hide file tree
Showing 23 changed files with 124 additions and 113 deletions.
16 changes: 8 additions & 8 deletions src/app/classes/[cId]/[mId]/components/Attendance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const Attendance = () => {
<div className="w-full h-[500px]">
<div className="text-xl font-semibold text-center">Attendance</div>
<div className="text-lg font-semibold text-green-400 text-center">
출석률 : 100%
出席率 : 100%
</div>
<div className="p-5 overflow-scroll">
{AttendanceUsers.map((user, index) => (
Expand Down Expand Up @@ -92,9 +92,9 @@ const Attendance = () => {
onChange={handleSelectChange}
value={user.IsAttendance}
>
<option value="ATTENDANCE">출석</option>
<option value="TARDY">지각</option>
<option value="ABSENCE">결석</option>
<option value="ATTENDANCE">出席</option>
<option value="TARDY">遅刻</option>
<option value="ABSENCE">欠席</option>
</select>
<div>
<button
Expand All @@ -108,18 +108,18 @@ const Attendance = () => {
)
}
>
수정
修正
</button>
</div>
</div>
) : (
<div className="flex items-center">
<div>
{user.IsAttendance === 'ATTENDANCE'
? '출석'
? '出席'
: user.IsAttendance === 'TARDY'
? '지각'
: '결석'}
? '遅刻'
: '欠席'}
</div>
<span
className="px-2"
Expand Down
14 changes: 7 additions & 7 deletions src/app/classes/[cId]/[mId]/components/AttendanceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const AttendanceCard = ({cid}: {cid: number; uid: number}) => {
setIsOpen(true);
}}
>
출석부
出席簿
</button>
</div>
{isOpen ? (
Expand All @@ -58,7 +58,7 @@ const AttendanceCard = ({cid}: {cid: number; uid: number}) => {
className=" bg-white rounded-lg w-[500px] h-[630px] px-4 py-10 box-border"
id="modal-container"
>
<div className="text-center text-lg text-gray-500">출석부</div>
<div className="text-center text-lg text-gray-500">出席簿</div>
<div className="relative h-[calc(100%-28px)]">
{users.map((user, index) => (
<div
Expand All @@ -74,19 +74,19 @@ const AttendanceCard = ({cid}: {cid: number; uid: number}) => {
className="px-3 hover:bg-gray-200 border-s-2"
onClick={() => handleClickStatus(user.uid, 'ATTENDANCE')}
>
출석
出席
</button>
<button
className="px-2 hover:bg-gray-200 border-s-2"
onClick={() => handleClickStatus(user.uid, 'TARDY')}
>
지각
遅刻
</button>
<button
className="px-2 hover:bg-gray-200 border-s-2"
onClick={() => handleClickStatus(user.uid, 'ABSENCE')}
>
결석
欠席
</button>
</div>
</div>
Expand All @@ -98,13 +98,13 @@ const AttendanceCard = ({cid}: {cid: number; uid: number}) => {
setIsOpen(false);
}}
>
닫기
閉じる
</button>
<button
className="px-3 py-1 bg-blue-400 text-white rounded-lg"
onClick={handleClickSave}
>
저장
セーブ
</button>
</div>
</div>
Expand Down
24 changes: 12 additions & 12 deletions src/app/classes/[cId]/[mId]/components/AttendanceContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,18 +208,18 @@ const AttendanceContainer = () => {
setCurrentMonth(parseInt(e.target.value))
}
>
<option value="1">1월</option>
<option value="2">2월</option>
<option value="3">3월</option>
<option value="4">4월</option>
<option value="5">5월</option>
<option value="6">6월</option>
<option value="7">7월</option>
<option value="8">8월</option>
<option value="9">9월</option>
<option value="10">10월</option>
<option value="11">11월</option>
<option value="12">12월</option>
<option value="1">1月</option>
<option value="2">2月</option>
<option value="3">3月</option>
<option value="4">4月</option>
<option value="5">5月</option>
<option value="6">6月</option>
<option value="7">7月</option>
<option value="8">8月</option>
<option value="9">9月</option>
<option value="10">10月</option>
<option value="11">11月</option>
<option value="12">12月</option>
</select>
<button onClick={() => changeMonth(1)} className="px-2">
{'>'}
Expand Down
2 changes: 1 addition & 1 deletion src/app/classes/[cId]/[mId]/components/CalendarModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const CalendarModal = ({
className="bg-blue-500 text-white px-3 py-1 rounded-lg"
onClick={handleClickSave}
>
확인
確認
</button>
</div>
</div>
Expand Down
11 changes: 6 additions & 5 deletions src/app/classes/[cId]/[mId]/components/FeedbackContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const FeedbackContainer = (props: {cId: number}) => {
return (
<div className="">
<div className="flex justify-between items-center p-4">
<div className="text-gray-500 text-lg">피드백 요청</div>
<div className="text-gray-500 text-lg">フィードバックリクエスト</div>
{material ? (
<FeedbackForm
cId={props.cId}
Expand All @@ -37,18 +37,19 @@ const FeedbackContainer = (props: {cId: number}) => {
{feedbacks.length === 0 ? (
<div>
<div className="text-4xl p-6 font-bold">
아직 피드백이 없습니다.
まだフィードバックはありません。
</div>

<div className="text-3xl p-3 font-semibold">
피드백이 생성될 때까지 기다리거나 <br /> 관리자에게 문의하세요.
フィードバックが生成されるまで待ったり <br />{' '}
管理者にお問い合わせください。
</div>
<div className="h-20"></div>
</div>
) : (
<div>
<div className="text-3xl p-3 font-semibold">
이 자료에 대한 피드백
この資料へのフィードバック
</div>
<div>
<FeedbackList feedbacks={feedbacks} />
Expand All @@ -57,7 +58,7 @@ const FeedbackContainer = (props: {cId: number}) => {
)}
<div>
<div className="text-2xl font-semibold p-5">
사용자가 질문한 내용과 가장 관련성이 높은 페이지
ユーザーが質問した内容と最も関連性の高いページ
</div>
{material ? (
<FeedbackKeywordList cId={props.cId} mId={parseInt(material?.id)} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ const FeedbackKeywordList = ({cId, mId}: {cId: number; mId: number}) => {
))
)
) : (
<div className="text-blue-400">
현재 질문 데이터가 존재하지 않습니다.
</div>
<div className="text-blue-400">現在、質問データが存在しません。</div>
)}
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/classes/[cId]/[mId]/components/FeedbackList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const FeedbackList = ({feedbacks}: {feedbacks: feedback[]}) => {
className="bg-red-400 p-2 text-white"
onClick={() => handleClickDelete(feedback.id)}
>
삭제
削除
</button>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/app/classes/[cId]/[mId]/components/ManageContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import AttendanceContainer from './AttendanceContainer';
import '@/src/styles/variable.css';

const ManageContainer = (props: {cId: string}) => {
const tabs = ['자료', '퀴즈', '피드백', '출석'];
const tabs = ['資料', 'クイズ', 'フィードバック', '出席'];
const [activeTab, setActiveTab] = useState(tabs[0]);
const tabMapping = {
자료: <ManageMaterialContainer />,
퀴즈: <QuizContainer cId={parseInt(props.cId)} />,
피드백: <FeedbackContainer cId={parseInt(props.cId)} />,
출석: <AttendanceContainer />,
資料: <ManageMaterialContainer />,
クイズ: <QuizContainer cId={parseInt(props.cId)} />,
フィードバック: <FeedbackContainer cId={parseInt(props.cId)} />,
出席: <AttendanceContainer />,
};
return (
// 퀴즈
Expand Down
18 changes: 9 additions & 9 deletions src/app/classes/[cId]/[mId]/components/QuizList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const QuizList = (props: {cId: number; mId: number; mName: string}) => {
height={25}
alt="icon"
/>
<span>퀴즈 목록</span>
<span>クイズリスト</span>
</div>
{isSubmit ? null : (
<div className="w-6 h-6 flex justify-center items-center bg-blue-500 text-white text-xl font-medium rounded-lg ml-4">
Expand All @@ -118,7 +118,7 @@ const QuizList = (props: {cId: number; mId: number; mName: string}) => {
</div>
<div className={isShow ? '' : 'hidden'}>
<div className="flex items-center pl-[25px] py-2 ">
<span className="pr-2 font-semibold">마감 기한 :</span>
<span className="pr-2 font-semibold">締め切り :</span>
{isSubmit ? (
<div className="text-red-500 font-semibold">
{moment(deadLine).format('YYYY-MM-DD / HH:mm')}
Expand All @@ -133,7 +133,7 @@ const QuizList = (props: {cId: number; mId: number; mName: string}) => {
>
{deadLine
? moment(deadLine).format('YYYY-MM-DD / HH:mm')
: '마감기한을 설정해주세요'}
: '期限を設定してください'}
</button>
{isOpen ? (
<CalendarModal
Expand Down Expand Up @@ -194,10 +194,10 @@ const QuizList = (props: {cId: number; mId: number; mName: string}) => {
)
)}
<div className="font-semibold pt-2">
정답: {quiz.content.commentary.correctAnswer}
正解: {quiz.content.commentary.correctAnswer}
</div>
<p>
<span className="font-semibold">해설: </span>
<span className="font-semibold">解説: </span>
{quiz.content.commentary.content}
</p>
</div>
Expand All @@ -213,14 +213,14 @@ const QuizList = (props: {cId: number; mId: number; mName: string}) => {
className="py-2 px-4 bg-red-500 text-white rounded-3xl"
onClick={handleDeleteSet}
>
퀴즈 삭제
クイズの削除
</button>
) : (
<button
className="py-2 px-4 bg-blue-500 text-white rounded-3xl"
onClick={handleSubmitQuiz}
>
퀴즈 출제
クイズ出題
</button>
)}
</div>
Expand All @@ -238,7 +238,7 @@ const QuizList = (props: {cId: number; mId: number; mName: string}) => {
height={25}
alt="icon"
/>
<span>퀴즈 통계</span>
<span>クイズ統計</span>
</div>
</div>
</div>
Expand All @@ -250,7 +250,7 @@ const QuizList = (props: {cId: number; mId: number; mName: string}) => {
</div>
) : (
<div className="h-[100px] flex justify-center items-center text-2xl text-gray-300 font-normal">
아직 퀴즈가 출제되지 않았습니다.
まだクイズは出題されていません。
</div>
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/classes/[cId]/[mId]/components/QuizReport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const QuizReport = ({cId, mId}: {cId: number; mId: number}) => {
>
<div className="w-[200px] h-[200px] bg-white rounded-full flex justify-center items-center">
<span className="w-[15px] h-[15px] bg-green-400 rounded-full mr-1"></span>
응시현황
受験状況
</div>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/app/classes/[cId]/[mId]/components/QuizSet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const QuizSet = ({cId, mId}: {cId: number; mId: number}) => {
className="absolute top-0 left-[-30px] z-20"
></Image>
) : null}
<div className="text-lg font-medium p-1">질문</div>
<div className="text-lg font-medium p-1">質問</div>
<div className="border-2 p-5 rounded-lg leading-8">
{quiz.content.question}
</div>
Expand Down Expand Up @@ -231,13 +231,13 @@ const QuizSet = ({cId, mId}: {cId: number; mId: number}) => {
{isSubmit ? (
<div className="h-[250px] bg-gray-100 w-full p-5 border-2 rounded-lg leading-8 drop-shadow-md overflow-scroll">
<div className="font-semibold">
정답:{' '}
正解:{' '}
<span className="text-red-500 ">
{quiz.content.commentary.correctAnswer}
</span>
</div>
<div className="font-semibold pt-2">
해설:{' '}
解説:{' '}
<span className="font-medium">
{quiz.content.commentary.content}
</span>
Expand All @@ -253,7 +253,7 @@ const QuizSet = ({cId, mId}: {cId: number; mId: number}) => {
<SwiperSlide style={{width: 'auto'}}>
<div className="flex w-[750px] h-[800px] m-auto py-3 justify-center items-center">
<div className="w-[600px] h-[200px] bg-gray-200 rounded-lg p-3 flex">
<div className="font-bold h-[176px] mr-1">교수님의 말 : </div>
<div className="font-bold h-[176px] mr-1">教授の言葉 : </div>
<div className="grow">{feedback}</div>
</div>
</div>
Expand All @@ -266,7 +266,7 @@ const QuizSet = ({cId, mId}: {cId: number; mId: number}) => {
className="px-2 py-2 bg-blue-400 text-white rounded-lg"
onClick={handleSubmitAnswer}
>
제출하기
提出する
</button>
</div>
)}
Expand Down
10 changes: 6 additions & 4 deletions src/app/classes/[cId]/[mId]/components/UserContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import LiveClassViewer from './subComponents/LiveClassViewer';
const UserContainer = ({cId}: {cId: string}) => {
const material = useRecoilValue(materialState);
const user = useRecoilValue(userState);
const TABS = ['학습자료', '퀴즈', '온라인수업'];
const TABS = ['学習資料', 'クイズ', 'オンライン授業'];
const [activeTab, setActiveTab] = useState(TABS[0]);
const tabMapping = {
학습자료: <Material />,
퀴즈: <QuizSet cId={parseInt(cId)} mId={parseInt(material?.id || '0')} />,
온라인수업: <LiveClassViewer classId={parseInt(cId)} userId={user?.id} />,
学習資料: <Material />,
クイズ: <QuizSet cId={parseInt(cId)} mId={parseInt(material?.id || '0')} />,
オンライン授業: (
<LiveClassViewer classId={parseInt(cId)} userId={user?.id} />
),
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ import '@/src/styles/variable.css';
import ShowMain from '../chatComponents/page';

const SubContainer: React.FC = () => {
const TABS = ['프롬프트창', '저장목록'];
const TABS = ['プロンプト', 'セーブリスト'];
const [activeTab, setActiveTab] = useState(TABS[0]);
const [showMain, setShowMain] = useState(false);
const params = useParams<{cId: string}>();
const material = useRecoilValue(materialState);

const tabMapping = {
프롬프트창: (
プロンプト: (
<PromptChat
pId={material ? material.prompts[0]?.id : 0}
cId={parseInt(params.cId)}
/>
),
저장목록: (
セーブリスト: (
<Storage
pId={material ? material.prompts[0]?.id : 0}
cId={parseInt(params.cId)}
Expand Down
Loading

0 comments on commit 6379a49

Please sign in to comment.