sungjin

Release 1.0 version

......@@ -17,21 +17,13 @@
*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.
*** https://www.markdownguide.org/basic-syntax/#reference-style-links
-->
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]
<!-- PROJECT LOGO -->
<br />
<div align="center">
<a href="https://github.com/github_username/repo_name">
<img src="images/logo.png" alt="Logo" width="80" height="80">
<a href="http://khuhub.khu.ac.kr/2021105619/learn_in_web">
<img src="logo.svg" alt="Logo" width="80" height="80">
</a>
<h3 align="center">Learn In Web</h3>
......@@ -81,7 +73,7 @@
<!-- ABOUT THE PROJECT -->
## About The Project
[![Product Name Screen Shot][product-screenshot]](https://example.com)
[![Product Name Screen Shot][product-screenshot]](https://code.sungjin.dev)
This project allows users to run codes and study without any IDE. This project focusd on schools, and students for study.
......@@ -179,7 +171,7 @@ _For Demo, please see my demo website [Demo](https://code.sungjin.dev/)_
- [ ] English
- [ ] Japanese
- [ ] View code run time
- [ ] Custom Input
- [ ] Add competition between users with runtime.
See the [open issues](https://github.com/othneildrew/Best-README-Template/issues) for a full list of proposed features (and known issues).
......@@ -209,7 +201,7 @@ Don't forget to give the project a star! Thanks again!
<!-- LICENSE -->
## License
Distributed under the MIT License. See `LICENSE.txt` for more information.
Distributed under the MIT License.
<p align="right">(<a href="#top">back to top</a>)</p>
......@@ -226,29 +218,8 @@ Project Link: [http://khuhub.khu.ac.kr/2021105619/learn_in_web](http://khuhub.kh
<!-- ACKNOWLEDGMENTS -->
## Acknowledgments
* []()
* []()
* []()
<p align="right">(<a href="#top">back to top</a>)</p>
<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
[contributors-shield]: https://img.shields.io/github/contributors/github_username/repo_name.svg?style=for-the-badge
[contributors-url]: https://github.com/github_username/repo_name/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/github_username/repo_name.svg?style=for-the-badge
[forks-url]: https://github.com/github_username/repo_name/network/members
[stars-shield]: https://img.shields.io/github/stars/github_username/repo_name.svg?style=for-the-badge
[stars-url]: https://github.com/github_username/repo_name/stargazers
[issues-shield]: https://img.shields.io/github/issues/github_username/repo_name.svg?style=for-the-badge
[issues-url]: https://github.com/github_username/repo_name/issues
[license-shield]: https://img.shields.io/github/license/github_username/repo_name.svg?style=for-the-badge
[license-url]: https://github.com/github_username/repo_name/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/linkedin_username
[product-screenshot]: images/screenshot.png
[product-screenshot]: screenshot.png
......
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M2 5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5zm3.293 1.293a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-3 3a1 1 0 0 1-1.414-1.414L7.586 10 5.293 7.707a1 1 0 0 1 0-1.414zM11 12a1 1 0 1 0 0 2h3a1 1 0 1 0 0-2h-3z" clip-rule="evenodd"/></svg>
\ No newline at end of file
......@@ -15,9 +15,7 @@ export const login = async (email, password) => {
if (response == undefined || (response.status !== 200 && response.status !== 201)) {
throw alert('Login failed!');
}
console.log(response.data.access_token)
useSession.accessToken = response.data.access_token;
console.log("로그인" + useSession.accessToken);
return response.data;
}
......@@ -65,7 +63,6 @@ export const refreshToken = async () => {
}
export const validateToken = async () => {
console.log(useSession.accessToken);
if(useSession.accessToken == undefined){
return false;
}
......
export const SERVER_BASE_URL = 'https://do.sungjin.dev';
\ No newline at end of file
export const SERVER_BASE_URL = 'LOCAL_SERVER_BASE_URL';
\ No newline at end of file
......
......@@ -55,7 +55,6 @@ export const getPostsByDifficulty = async (difficulty) => {
if (response.status !== 200) {
throw new Error('Failed to get posts!');
}
console.log(response.data);
return response.data;
}
......
......@@ -3,9 +3,6 @@ import router from "next/router"
import { Button } from "semantic-ui-react"
export default function Nav() {
const moverun = () => {
router.push("/run")
}
const movenew = () => {
router.push("/new")
......@@ -24,9 +21,6 @@ export default function Nav() {
<nav className="navbar">
<div className="flex px-10 sm:px-20 text-2xl whitespace-nowrap
space-x-10 sm:space-x-20">
<Button onClick={moverun} className="cursor-pointer transition
duration-100 transform hover:scale-125 hover:text-black
active:text-white">테스트</Button>
<Button onClick={movelow} className="cursor-pointer transition
duration-100 transform hover:scale-125 hover:text-black
active:text-white">난이도 </Button>
......
......@@ -12,7 +12,6 @@ export default function Popular() {
}, []);
const DateType = (date) => {
console.log(date);
const dateObj = new Date(date);
const month = dateObj.toLocaleString("default", { month: "long" });
const day = dateObj.getDate();
......
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
export default function handler(req, res) {
res.status(200).json({ name: 'John Doe' })
}
......@@ -12,7 +12,6 @@ export default function Popular() {
}, []);
const DateType = (date) => {
console.log(date);
const dateObj = new Date(date);
const month = dateObj.toLocaleString("default", { month: "long" });
const day = dateObj.getDate();
......
......@@ -12,7 +12,6 @@ export default function Popular() {
}, []);
const DateType = (date) => {
console.log(date);
const dateObj = new Date(date);
const month = dateObj.toLocaleString("default", { month: "long" });
const day = dateObj.getDate();
......
......@@ -12,7 +12,6 @@ export default function Popular() {
}, []);
const DateType = (date) => {
console.log(date);
const dateObj = new Date(date);
const month = dateObj.toLocaleString("default", { month: "long" });
const day = dateObj.getDate();
......
......@@ -32,7 +32,6 @@ export default function New() {
const testoutput = form.testoutput.value.split("\n");
const difficulty = form.level.value;
const post = await newPost(title, explain, example, testinput, testoutput, difficulty);
console.log(post);
router.push("/");
};
return (
......
......@@ -22,7 +22,6 @@ export default function Post() {
if (!router.isReady) return;
const { id } = router.query
getPostbyId(id).then(res => {
console.log(res);
setPost(res)
})
}, [router.isReady]);
......@@ -36,13 +35,14 @@ export default function Post() {
const [comment, setComment] = useState("");
const addComment = async () => {
console.log("comment is " + comment);
const { id } = router.query
await createComment(id, comment)
await createComment(id, comment);
getPostbyId(id).then(res => {
setPost(res)
})
}
const displayComment = () => {
console.log(post.comments);
if (post.comments != undefined) {
return post.comments.map(comment => (
<div className="flex w-full border-carbon border-4 rounded-xl my-2">
......@@ -66,15 +66,12 @@ export default function Post() {
return;
}
var result = await run(code, value);
console.log(result);
setAnswer(`출력 : ${result}`);
}
const testinput = () => {
const insert = post.testinput;
console.log("insert = " + insert);
if (insert === [""] || insert === undefined) {
console.log("없음");
return <div></div>
}
return <div>
......@@ -87,9 +84,7 @@ export default function Post() {
const testoutput = () => {
const insert = post.testoutput;
console.log("insert = " + insert);
if (insert === [""] || insert === undefined) {
console.log("없음");
return <div></div>
}
return <div>
......
import "@uiw/react-textarea-code-editor/dist.css";
import dynamic from "next/dynamic";
import { useState } from "react";
import { Button } from "semantic-ui-react";
import { run } from "../api/runner/runner";
import { useRouter } from "next/dist/client/router";
const CodeEditor = dynamic(
() => import("@uiw/react-textarea-code-editor").then((mod) => mod.default),
{ ssr: false }
);
export default function Run() {
const router = useRouter();
const [value, setValue] = useState("c");
const [code, setCode] = useState("");
const [answer, setAnswer] = useState("");
const runCode = async function () {
var result = await run(code, value);
console.log(result);
setAnswer(result);
}
return (<div>
<select value={value} onChange={(e) => setValue(e.target.value)}>
<option value="c">c</option>
<option value="cpp">cpp</option>
<option value="js">javascript</option>
</select>
<CodeEditor
value={code}
language={value}
placeholder="Please Enter the Code."
onChange={(e) => setCode(e.target.value)}
padding={15}
style={{
fontSize: 12,
backgroundColor: "#f5f5f5",
fontFamily:
"ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace"
}}
/>
<Button onClick={runCode}>Run</Button>
<div>{answer}</div>
</div>);
}
\ No newline at end of file
import { searchPost } from "../api/post/post";
import { useState } from "react";
import { SearchIcon } from "@heroicons/react/outline";
import { Link } from "@nextui-org/react";
export default function Search() {
const handleSubmit = async (e) => {
e.preventDefault();
const search = await searchPost(e.target.search.value);
console.log(search)
setResult(search);
}
......@@ -24,9 +24,9 @@ export default function Search() {
<h1 className="text-2xl font-bold">Search Result</h1>
{result.map((post) => {
return (
<div>
<h2>{post.title}</h2>
</div>
<Link href={`/post/${post.id}`}>
<h2 className="text-xl">{post.title}</h2>
</Link>
)
})}
</div>
......
......@@ -32,7 +32,6 @@ export default function Signup() {
const email = form.email.value;
const password = form.password.value;
const passwordConfirm = form.passwordConfirm.value;
console.log(name, email, password, passwordConfirm);
if (password !== passwordConfirm) {
alert("Passwords do not match");
return;
......