diff --git a/src/App.js b/src/App.js
index bc4d145..e80aafa 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,10 +1,14 @@
+import styled from "styled-components";
+
import Contents from "./Components/Contents";
export default function App() {
return (
<>
-
๐ค ํ๋ก๊ทธ๋๋จธ์ค JS ์ ๋ต ํต๊ณผ๊ธฐ
+ Codestin Search App
>
);
}
+
+const Title = styled.h1``;
diff --git a/src/Components/Contents.js b/src/Components/Contents.js
index 4fe1bb1..ef40d11 100644
--- a/src/Components/Contents.js
+++ b/src/Components/Contents.js
@@ -1,4 +1,5 @@
import { BrowserRouter, Routes, Route, Link } from "react-router-dom";
+import styled from "styled-components";
import Introduction from "./Tabs/Introduction";
import ErrorReport from "./Tabs/ErrorReport";
@@ -7,17 +8,17 @@ import SolutionReport from "./Tabs/SolutionReport";
export default function TabNavigation() {
return (
-
- -
+
+
์๊ฐ
-
- -
+
+
์ค๋ฅ ์ ๋ณด
-
- -
+
+
์ ๋ต ์ ๋ณด
-
-
+
+
}>
}>
@@ -26,3 +27,7 @@ export default function TabNavigation() {
);
}
+
+const TabList = styled.ul``;
+
+const TabItem = styled.li``;
diff --git a/src/Components/Tabs/ErrorReport.js b/src/Components/Tabs/ErrorReport.js
index 10d9d9a..a9ebb43 100644
--- a/src/Components/Tabs/ErrorReport.js
+++ b/src/Components/Tabs/ErrorReport.js
@@ -1,91 +1,120 @@
import { useState } from "react";
+import {
+ TabWrapper,
+ BlockText,
+ Button,
+ StepByStepInputItem,
+ InlineText,
+ RadioInput,
+ Label,
+ TextInput,
+ DataList,
+ Option,
+ TextArea,
+} from "./Style/StyledComponent";
export default function ErrorReport() {
const [submitted, setSubmitted] = useState(false);
- const [errorCategory, setErrorCategory] = useState(-1);
+ const [errorCategory, setErrorCategory] = useState("");
const [questionName, setQuestionName] = useState("");
- const [detailInput, setDetailInput] = useState("");
+ const [detailContent, setDetailContent] = useState("");
+
+ const isQuestionNameUnvisible = errorCategory === "" || errorCategory === "error-notCopied";
+ const isDetailContentUnvisible =
+ errorCategory === "" || (errorCategory === "error-wrongAnswer" && questionName === "");
+ const isSubmitBtnDisabled = errorCategory === "error-other" && detailContent === "";
+
+ function handleOtherErrorBtnClick() {
+ setSubmitted(false);
+ setErrorCategory("");
+ setQuestionName("");
+ setDetailContent("");
+ }
+
+ function handleErrorCategoryClick(e) {
+ setErrorCategory(e.target.id);
+ }
+
+ function handleQuestionNameInput(e) {
+ setQuestionName(e.target.value);
+ }
+
+ function handleDetailContentInput(e) {
+ setDetailContent(e.target.value);
+ }
+
+ function handleSubmitBtnClick() {
+ setSubmitted(true);
+ }
return submitted ? (
-
-
์ ๋ณดํด์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค.
-
-
+
+ ์ ๋ณดํด์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค.
+
+
) : (
-
+
);
}
diff --git a/src/Components/Tabs/Introduction.js b/src/Components/Tabs/Introduction.js
index 9246900..17d1b77 100644
--- a/src/Components/Tabs/Introduction.js
+++ b/src/Components/Tabs/Introduction.js
@@ -1,8 +1,5 @@
+import { TabWrapper } from "./Style/StyledComponent";
+
export default function Introduction() {
- return (
-
-
IntroductionTab
- {/* IntroductionTab content will go here */}
-
- );
+ return {/* IntroductionTab content will go here */};
}
diff --git a/src/Components/Tabs/SolutionReport.js b/src/Components/Tabs/SolutionReport.js
index a26cdca..5281a5a 100644
--- a/src/Components/Tabs/SolutionReport.js
+++ b/src/Components/Tabs/SolutionReport.js
@@ -1,62 +1,91 @@
import { useState } from "react";
+import styled from "styled-components";
+
+import {
+ TabWrapper,
+ BlockText,
+ Button,
+ StepByStepInputItem,
+ InlineText,
+ TextInput,
+ DataList,
+ Option,
+ TextArea,
+} from "./Style/StyledComponent";
export default function SolutionReport() {
const [submitted, setSubmitted] = useState(false);
const [questionName, setQuestionName] = useState("");
- const [detailInput, setDetailInput] = useState("");
+ const [detailContent, setDetailContent] = useState("");
+
+ const isDetailContentUnvisible = questionName === "";
+ const isSubmitBtnDisabled = detailContent === "";
+
+ function handleOtherSolutionBtnClick() {
+ setSubmitted(false);
+ setQuestionName("");
+ setDetailContent("");
+ }
+
+ function handleQuestionNameInput(e) {
+ setQuestionName(e.target.value);
+ }
+
+ function handleDetailContentInput(e) {
+ setDetailContent(e.target.value);
+ }
+
+ function handleSubmitBtnClick() {
+ setSubmitted(true);
+ }
return submitted ? (
-
-
์ ๋ณดํด์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค.
-
-
+
+ ์ ๋ณดํด์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค.
+
+
) : (
-
-
- ๋ฌธ์ ์ด๋ฆ:
-
+
+ ๋ฌธ์ ์ด๋ฆ:
+ setQuestionName(e.target.value)}
+ onInput={handleQuestionNameInput}
defaultValue={questionName}
/>
-
-
-
- {questionName === "" ? null : (
+
+
+
+ {isDetailContentUnvisible ? null : (
<>
-
- ๊ธฐ์ฌ์ ๋ฑ๋ก:
-
-
-
- ๋ด์ฉ:
-
-
-
+
+
>
)}
-
+
);
}
+
+const GitHubLoginBtn = styled.button``;
diff --git a/src/Components/Tabs/Style/StyledComponent.js b/src/Components/Tabs/Style/StyledComponent.js
new file mode 100644
index 0000000..c2da699
--- /dev/null
+++ b/src/Components/Tabs/Style/StyledComponent.js
@@ -0,0 +1,27 @@
+// Tabs์์ ๊ณตํต์ ์ผ๋ก ์ฌ์ฉ๋๋ ๋ถ๋ถ์ ์ํด ํด๋๊ตฌ์กฐ๋ฅผ ์ด๋ ๊ฒ ๋ง๋ค์๋๋ฐ, ๋ญ๊ฐ ์ด์ํ๋ค์..
+
+import styled from "styled-components";
+
+export const TabWrapper = styled.div``;
+
+export const BlockText = styled.p``;
+
+export const Button = styled.button``;
+
+export const StepByStepInputItem = styled.div``;
+
+export const InlineText = styled.span``;
+
+export const RadioInput = styled.input``;
+
+export const Label = styled.label``;
+
+export const TextInput = styled.input``;
+
+export const DataList = styled.datalist``;
+
+export const Option = styled.option``;
+
+export const DetailContentWrapper = styled.div``;
+
+export const TextArea = styled.textarea``;
diff --git a/src/recoil/atom 2.js b/src/recoil/atom 2.js
deleted file mode 100644
index 9e958b5..0000000
--- a/src/recoil/atom 2.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import { atom } from "recoil";
-
-export const tabNoState = atom({
- key: "tabNoState",
- default: 0,
-});
diff --git a/src/recoil/atom.js b/src/recoil/atom.js
deleted file mode 100644
index 9e958b5..0000000
--- a/src/recoil/atom.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import { atom } from "recoil";
-
-export const tabNoState = atom({
- key: "tabNoState",
- default: 0,
-});