Skip to content
Merged
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
10 changes: 5 additions & 5 deletions src/Components/Tabs/ErrorReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export default function ErrorReport() {
const [questionName, setQuestionName] = useState("");
const [detailContent, setDetailContent] = useState("");

const isQuestionNameUnvisible = errorCategory === "" || errorCategory === "error-notCopied";
const isDetailContentUnvisible =
errorCategory === "" || (errorCategory === "error-wrongAnswer" && questionName === "");
const isQuestionNameVisible = errorCategory !== "" && errorCategory !== "error-notCopied";
const isDetailContentVisible =
errorCategory !== "" && (errorCategory !== "error-wrongAnswer" || questionName !== "");
const isSubmitBtnDisabled = errorCategory === "error-other" && detailContent === "";

function handleOtherErrorBtnClick() {
Expand Down Expand Up @@ -79,7 +79,7 @@ export default function ErrorReport() {
<Label htmlFor="error-other">기타</Label>
</StepByStepInputItem>

{isQuestionNameUnvisible ? null : (
{isQuestionNameVisible && (
<StepByStepInputItem>
<InlineText>문제 이름: </InlineText>
<TextInput
Expand All @@ -96,7 +96,7 @@ export default function ErrorReport() {
</StepByStepInputItem>
)}

{isDetailContentUnvisible ? null : (
{isDetailContentVisible && (
<>
<StepByStepInputItem>
<InlineText>내용: </InlineText>
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Tabs/SolutionReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function SolutionReport() {
const [questionName, setQuestionName] = useState("");
const [detailContent, setDetailContent] = useState("");

const isDetailContentUnvisible = questionName === "";
const isDetailContentVisible = questionName !== "";
const isSubmitBtnDisabled = detailContent === "";

function handleOtherSolutionBtnClick() {
Expand Down Expand Up @@ -61,7 +61,7 @@ export default function SolutionReport() {
</DataList>
</StepByStepInputItem>

{isDetailContentUnvisible ? null : (
{isDetailContentVisible && (
<>
<StepByStepInputItem>
<InlineText>기여자 등록: </InlineText>
Expand Down