From edb1120e205474b1f30720b839760a588576fc66 Mon Sep 17 00:00:00 2001 From: tatehito <48908346+Tatehito@users.noreply.github.com> Date: Thu, 8 Feb 2024 11:49:06 +0900 Subject: [PATCH] fix: Programming language name (#31) --- src/app/(withAuth)/courses/[courseId]/page.tsx | 9 +++++++-- src/problems/problemData.ts | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/app/(withAuth)/courses/[courseId]/page.tsx b/src/app/(withAuth)/courses/[courseId]/page.tsx index 658e10ea..5e40d815 100644 --- a/src/app/(withAuth)/courses/[courseId]/page.tsx +++ b/src/app/(withAuth)/courses/[courseId]/page.tsx @@ -17,7 +17,12 @@ import type { NextPage } from 'next'; import NextLink from 'next/link'; import React, { useEffect, useState } from 'react'; -import { courseIdToProgramIdLists, languageIds, programIdToName } from '../../../../problems/problemData'; +import { + courseIdToProgramIdLists, + languageIdToName, + languageIds, + programIdToName, +} from '../../../../problems/problemData'; import { getLanguageIdFromSessionStorage, setLanguageIdToSessionStorage } from '../../../lib/SessionStorage'; const CoursePage: NextPage<{ params: { courseId: string } }> = ({ params }) => { @@ -47,7 +52,7 @@ const CoursePage: NextPage<{ params: { courseId: string } }> = ({ params }) => { > {languageIds.map((languageId) => ( ))} diff --git a/src/problems/problemData.ts b/src/problems/problemData.ts index 766e6f83..f755cc16 100644 --- a/src/problems/problemData.ts +++ b/src/problems/problemData.ts @@ -7,6 +7,11 @@ export type ProgramId = (typeof programIds)[number]; export const languageIds = ['js', 'java']; export type LanguageId = (typeof languageIds)[number]; +export const languageIdToName: Record = { + js: 'JavaScript', + java: 'Java', +}; + export const courseIdToName: Record = { tuBeginner1: '初級プログラミングⅠ', tuBeginner2: '初級プログラミングⅡ',