-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
마크다운 에디터 구현을 위한 초기 세팅 (이슈 #7)
- Loading branch information
Showing
9 changed files
with
202 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from "react"; | ||
|
||
const AttCorrection = () => { | ||
return <div>AttCorrection</div>; | ||
}; | ||
|
||
export default AttCorrection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from "react"; | ||
|
||
const AttRecognition = () => { | ||
return <div>AttRecognition</div>; | ||
}; | ||
|
||
export default AttRecognition; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import React from "react"; | ||
import { useState } from "react"; | ||
import WikiEdit from "./WikiEdit"; | ||
|
||
interface ValueState { | ||
id: number; | ||
title: string; | ||
content: string; | ||
} | ||
|
||
const Attendance = () => { | ||
//수정 창 열고 닫기 | ||
const [isOpen, setIsOpen] = useState<boolean>(false); | ||
const [value, setValue] = useState<ValueState>({ | ||
id: 1, | ||
title: " 제목입니다", | ||
content: "내용임", | ||
}); | ||
|
||
//제목, 내용 상태관리 | ||
const [title, setTitle] = useState<string>("제목"); | ||
const [content, setContent] = useState<string>("글 내용"); | ||
|
||
// 타이핑 하는 값 받아오기 | ||
const handleTitleChange = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
setTitle(e.target.value); | ||
console.log(e.target.value); | ||
}; | ||
|
||
const handleContentChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => { | ||
setContent(e.target.value); | ||
console.log(e.target.value); | ||
}; | ||
|
||
// 수정 완료 버튼 함수 | ||
const handleSubmitBtn = () => { | ||
const updatedValue = { ...value, title, content }; | ||
setValue(updatedValue); | ||
setIsOpen(false); | ||
console.log(isOpen); | ||
}; | ||
|
||
if (!!isOpen) | ||
return ( | ||
<WikiEdit | ||
handleTitleChange={handleTitleChange} | ||
title={title} | ||
content={content} | ||
handleSubmitBtn={handleSubmitBtn} | ||
handleContentChange={handleContentChange} | ||
/> | ||
); | ||
return ( | ||
<> | ||
<main className="main-container"> | ||
<button onClick={() => setIsOpen(true)}> 수정 </button> | ||
<div> {title} </div> | ||
<div> {content} </div> | ||
</main> | ||
</> | ||
); | ||
}; | ||
|
||
export default Attendance; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import React from 'react' | ||
import React from "react"; | ||
|
||
const Curriculum = () => { | ||
return ( | ||
<div>커리큘럼 관련 Wiki - Curriculum 컴포넌트</div> | ||
) | ||
} | ||
return <div>커리큘럼 관련 Wiki - Curriculum 컴포넌트</div>; | ||
}; | ||
|
||
export default Curriculum | ||
export default Curriculum; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from "react"; | ||
|
||
const Leave = () => { | ||
return <div>Leave</div>; | ||
}; | ||
|
||
export default Leave; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from "react"; | ||
|
||
const TrainingIncentive = () => { | ||
return <div>TrainingIncentive</div>; | ||
}; | ||
|
||
export default TrainingIncentive; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from "react"; | ||
|
||
interface ValueState { | ||
id: number; | ||
title: string; | ||
content: string; | ||
} | ||
|
||
interface WikiEditProps { | ||
handleSubmitBtn: () => void; | ||
handleTitleChange: (e: React.ChangeEvent<HTMLInputElement>) => void; | ||
handleContentChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void; | ||
content: string; | ||
title: string; | ||
} | ||
|
||
const WikiEdit: React.FC<WikiEditProps> = ({ | ||
handleTitleChange, | ||
handleSubmitBtn, | ||
handleContentChange, | ||
title, | ||
content, | ||
}) => { | ||
return ( | ||
<div> | ||
<form> | ||
<div> | ||
<input name="title" onChange={handleTitleChange} value={title} /> | ||
</div> | ||
<div> | ||
<textarea | ||
rows={8} | ||
onChange={handleContentChange} | ||
name="content" | ||
value={content} | ||
/> | ||
</div> | ||
|
||
<button onClick={handleSubmitBtn}>수정 완료</button> | ||
<button>닫기 </button> | ||
</form> | ||
</div> | ||
); | ||
}; | ||
|
||
export default WikiEdit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,41 @@ | ||
import Sidebar from 'components/Sidebar' | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
import { Route, Routes } from 'react-router-dom' | ||
import Administration from '../components/Admin' | ||
import Curriculum from '../components/Curriculum' | ||
import Sidebar from "components/Sidebar"; | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import { Route, Routes } from "react-router-dom"; | ||
import Administration from "../components/Admin"; | ||
import Curriculum from "../components/Curriculum"; | ||
import Attendance from "components/Attendance"; | ||
import AttRecognition from "components/AttRecognition"; | ||
import AttCorrection from "components/AttCorrection"; | ||
import Leave from "components/Leave"; | ||
import TrainingIncentive from "components/TrainingIncentive"; | ||
|
||
const Wiki = () => { | ||
|
||
return ( | ||
<> | ||
<Sidebar /> | ||
<Container> | ||
<Routes> | ||
<Route path="" element={<Administration />}></Route> | ||
<Route path="교육과정" element={<Curriculum />}></Route> | ||
<Route path="" element={<Attendance />}></Route> | ||
<Route path="출석 인정" element={<AttRecognition />}></Route> | ||
<Route | ||
path="QR출결 정정 프로세스" | ||
element={<AttCorrection />} | ||
></Route> | ||
<Route path="휴가" element={<Leave />}></Route> | ||
<Route path="훈련장려금" element={<TrainingIncentive />}></Route> | ||
<Route path="학습 일정" element={<Curriculum />}></Route> | ||
</Routes> | ||
</Container> | ||
</> | ||
) | ||
} | ||
); | ||
}; | ||
|
||
const Container = styled.section` | ||
position: relative; | ||
left: 140px; | ||
height: calc(100% - 60px); | ||
width: calc(100% - 140px); | ||
` | ||
`; | ||
|
||
export default Wiki | ||
export default Wiki; |