Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
feat : Class/Function Implementation problem only requires file
Browse files Browse the repository at this point in the history
  • Loading branch information
kasterra committed May 26, 2024
1 parent 043c761 commit 2fff37a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,7 @@ const ProblemAddModal = ({
postClassImplementationProblem(
file,
memory,
mainFile
? { ...mainFileObj, language }
: {
content: codeString,
name: `Main.${getCodeFileExtension(language)}`,
language,
},
{ ...mainFileObj, language },
language,
practiceId,
time,
Expand Down Expand Up @@ -256,25 +250,13 @@ const ProblemAddModal = ({
<option value="plaintext">Text</option>
</select>
<span>언어에 맞는 Main 파일을 준비해 주세요.</span>
<span>
직접 입력하거나(이 경우엔 파일 이름은
"Main.언어에_맞는_확장자"로 설정됨) 파일을 업로드 해주세요
</span>
<SingleFileInput
title="Main 파일"
name="main"
onFileUpload={(file) => {
setMainFile(file);
}}
/>
{!mainFile && (
<CodeBlock
height={500}
language={language}
value={codeString}
onChange={setCodeString}
/>
)}
</div>
) : null}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,6 @@ const ProblemEditModal = ({ isOpen, onClose, editingProblemId }: Props) => {
undefined,
mainFile
? { ...mainFileObj, language }
: codeString
? {
content: codeString,
name: `Main.${getCodeFileExtension(language)}`,
language,
}
: prevProblemInfo!.prepared_main
? {
...prevProblemInfo!.prepared_main.code,
Expand Down Expand Up @@ -307,10 +301,6 @@ const ProblemEditModal = ({ isOpen, onClose, editingProblemId }: Props) => {
<option value="plaintext">Text</option>
</select>
<span>언어에 맞는 Main 파일을 준비해 주세요.</span>
<span>
직접 입력하거나(이 경우엔 파일 이름은
"Main.언어에_맞는_확장자"로 설정됨) 파일을 업로드 해주세요
</span>
{prevProblemInfo!.prepared_main && (
<>
<h4>기존 main 파일</h4>
Expand Down Expand Up @@ -345,14 +335,6 @@ const ProblemEditModal = ({ isOpen, onClose, editingProblemId }: Props) => {
setMainFile(file);
}}
/>
{!mainFile && (
<CodeBlock
height={500}
language={language}
value={codeString}
onChange={setCodeString}
/>
)}
</div>
) : null}
</div>
Expand Down

0 comments on commit 2fff37a

Please sign in to comment.