Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[#15] 제보사이트 - 코드 리뷰 반영 #16

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

Merged
merged 1 commit into from
Jul 2, 2022
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