Skip to content

Commit 513cb64

Browse files
committed
chore: 린트 에러 수정
1 parent 4ca3a0e commit 513cb64

31 files changed

+645
-597
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: "[BUG]"
4+
title: '[BUG]'
55
labels: ''
66
assignees: eunbeann
7-
87
---
98

109
**Where**

.github/ISSUE_TEMPLATE/feature_request.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: "[FEAT]"
4+
title: '[FEAT]'
55
labels: ''
66
assignees: eunbeann
7-
87
---
98

109
**Subject**
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
---
22
name: Refactor issue template
33
about: Modify codes or the structure
4-
title: "[REFACTOR]"
4+
title: '[REFACTOR]'
55
labels: ''
66
assignees: ''
7-
87
---
9-
10-

public/index.html

+21-24
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8" />
5-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6-
<meta
7-
name="viewport"
8-
content="width=device-width, initial-scale=1, user-scalable=no"
9-
/>
10-
<meta name="theme-color" content="#000000" />
11-
<meta
12-
name="description"
13-
content="Web site created using create-react-app"
14-
/>
15-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
16-
<!--
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
8+
<meta name="theme-color" content="#000000" />
9+
<meta name="description" content="Web site created using create-react-app" />
10+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
11+
<!--
1712
manifest.json provides metadata used when your web app is installed on a
1813
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
1914
-->
20-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
21-
<!--
15+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
16+
<!--
2217
Notice the use of %PUBLIC_URL% in the tags above.
2318
It will be replaced with the URL of the `public` folder during the build.
2419
Only files inside the `public` folder can be referenced from the HTML.
@@ -27,12 +22,13 @@
2722
work correctly both with client-side routing and a non-root public URL.
2823
Learn how to configure a non-root public URL by running `npm run build`.
2924
-->
30-
<title>새로고침</title>
31-
</head>
32-
<body>
33-
<noscript>You need to enable JavaScript to run this app.</noscript>
34-
<div id="root"></div>
35-
<!--
25+
<title>새로고침</title>
26+
</head>
27+
28+
<body>
29+
<noscript>You need to enable JavaScript to run this app.</noscript>
30+
<div id="root"></div>
31+
<!--
3632
This HTML file is a template.
3733
If you open it directly in the browser, you will see an empty page.
3834
@@ -42,5 +38,6 @@
4238
To begin the development, run `npm start` or `yarn start`.
4339
To create a production bundle, use `npm run build` or `yarn build`.
4440
-->
45-
</body>
46-
</html>
41+
</body>
42+
43+
</html>

src/App.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { Routes, Route } from "react-router-dom";
2-
import Menubar from "./pages/Menubar";
3-
import Main from "./pages/Main";
4-
import Notice from "./pages/Notice";
5-
import TimeTable from "./pages/TimeTable";
6-
import Event from "./pages/Event";
7-
import Board from "./pages/Board";
8-
import NoticeManage from "./pages/NoticeManage";
9-
import AdminNotice from "./pages/AdminNotice";
10-
import Update from "./pages/Update";
11-
import NotFound from "./pages/NotFound";
1+
import { Routes, Route } from 'react-router-dom';
2+
import Menubar from './pages/Menubar';
3+
import Main from './pages/Main';
4+
import Notice from './pages/Notice';
5+
import TimeTable from './pages/TimeTable';
6+
import Event from './pages/Event';
7+
import Board from './pages/Board';
8+
import NoticeManage from './pages/NoticeManage';
9+
import AdminNotice from './pages/AdminNotice';
10+
import Update from './pages/Update';
11+
import NotFound from './pages/NotFound';
1212

1313
function App() {
1414
return (
@@ -22,7 +22,7 @@ function App() {
2222
<Route path="/manager" element={<NoticeManage />}></Route>
2323
<Route path="/adminntc" element={<AdminNotice />}></Route>
2424
<Route path="/update" element={<Update />}></Route>
25-
<Route path={"*"} element={<NotFound />}></Route>
25+
<Route path={'*'} element={<NotFound />}></Route>
2626
</Route>
2727
</Routes>
2828
);

src/components/BoardInsert.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import axios from 'axios';
22
import React, { useCallback, useState } from 'react';
33
import styles from '../css/Board.module.css';
4-
import { useNavigate } from 'react-router-dom';
54

65
const BoardInsert = ({ texts, changeTexts }) => {
76
const [insertBody, setInsertBody] = useState(styles.insertBody);

src/components/BoardItem.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import styles from '../css/Board.module.css';
3-
import axios from 'axios';
43

54
const BoardItem = ({ text }) => {
65
const palette = ['#4C966E', '#C4DAE7', '#C3E196', '#D0C7DE', '#E7D0B6'];

src/components/Gate.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@ const Gate = () => {
2929
<div className={style.date}>2022. 05.18 - 05.20</div>
3030
<div className={style.line}></div>
3131
<div className={style.keywordDiv}>
32-
{IMG_ARRAY.map((data) => {
32+
{IMG_ARRAY.map((data, index) => (
3333
<img
34+
key={index}
3435
data-aos="fade-up"
3536
data-aos-offset={data.offset}
3637
className={style.keyword2}
3738
src={data.alt}
3839
alt={data.alt}
3940
data-sa-margin={data.margin}
40-
/>;
41-
})}
41+
/>
42+
))}
4243
</div>
4344
<img className={style.new} src={newduksung} alt="forever" />
4445
</div>

src/components/HeaderTitle.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const HeaderTitle = (props) => {
1616
return (
1717
<div className={s.header}>
1818
<p className={s.headerTitle}>{props.title}</p>
19-
<div>{`${location.pathname}` == '/Notice' ? <TagList /> : null} </div>
19+
<div>{`${location.pathname}` === '/Notice' ? <TagList /> : null} </div>
2020
</div>
2121
);
2222
};

src/components/NoticeUpdate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useMemo, useEffect, useCallback } from 'react';
1+
import React, { useState, useMemo, useEffect } from 'react';
22
import { useLocation, useNavigate } from 'react-router-dom';
33
import styles from '../css/Notice.Write.module.css';
44
import axios from 'axios';

src/components/NoticeWrite.js

+38-53
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React, { useState, useCallback, useMemo } from "react";
2-
import styles from "../css/Notice.Write.module.css";
3-
import axios from "axios";
4-
import { useNavigate } from "react-router-dom";
5-
import plus from "../img/plus.png";
1+
import React, { useState, useMemo } from 'react';
2+
import styles from '../css/Notice.Write.module.css';
3+
import axios from 'axios';
4+
import { useNavigate } from 'react-router-dom';
5+
import plus from '../img/plus.png';
66

77
const NoticeWrite = () => {
88
const [Title, setTitle] = useState(null);
@@ -19,7 +19,7 @@ const NoticeWrite = () => {
1919
//클릭했을 때 true면 false로 false면 true로 바꾸는 함수 - 단일코드
2020
const handleClick = (e) => {
2121
//e.target.name과 같은 state같을 찾는다.
22-
if (e.target.name === "tag1") {
22+
if (e.target.name === 'tag1') {
2323
if (tag1) {
2424
//tag1이 true일때
2525
setTag1(false);
@@ -31,7 +31,7 @@ const NoticeWrite = () => {
3131
setTag3(false);
3232
setTag(1);
3333
}
34-
} else if (e.target.name === "tag2") {
34+
} else if (e.target.name === 'tag2') {
3535
if (tag2) {
3636
//tag1이 true일때
3737
setTag1(false);
@@ -43,7 +43,7 @@ const NoticeWrite = () => {
4343
setTag3(false);
4444
setTag(2);
4545
}
46-
} else if (e.target.name === "tag3") {
46+
} else if (e.target.name === 'tag3') {
4747
if (tag3) {
4848
//tag1이 true일때
4949
setTag1(false);
@@ -60,62 +60,62 @@ const NoticeWrite = () => {
6060

6161
//usememo 최적화 연산 함수
6262
const textColor1 = useMemo(() => {
63-
return tag1 ? "#4C966E" : "#c4c4c4";
63+
return tag1 ? '#4C966E' : '#c4c4c4';
6464
}, [tag1]);
6565
//tag1가 변화하면 윗줄이 동작함
6666
const textColor2 = useMemo(() => {
67-
return tag2 ? "#d0c7de" : "#c4c4c4";
67+
return tag2 ? '#d0c7de' : '#c4c4c4';
6868
}, [tag2]);
6969

7070
const textColor3 = useMemo(() => {
71-
return tag3 ? "#e7d0b6" : "#c4c4c4";
71+
return tag3 ? '#e7d0b6' : '#c4c4c4';
7272
}, [tag3]);
7373

7474
const handleChange = (e) => {
7575
e.preventDefault();
7676
const {
7777
target: { name, value },
7878
} = e;
79-
if (name === "title") {
79+
if (name === 'title') {
8080
setTitle(value);
81-
} else if (name === "content") {
81+
} else if (name === 'content') {
8282
setContent(value);
83-
} else if (name === "tag") {
83+
} else if (name === 'tag') {
8484
setTag(value);
85-
} else if (name === "noImg") {
85+
} else if (name === 'noImg') {
8686
setImg(URL.createObjectURL(e.target.files[0]));
8787
setimg(e.target.files[0]);
8888
}
8989
};
9090

9191
const handleSubmit = (e) => {
9292
e.preventDefault();
93-
formData.append("noTitle", Title);
94-
formData.append("noText", Content);
95-
formData.append("noTag", Tag);
96-
formData.append("noImg", noimg);
93+
formData.append('noTitle', Title);
94+
formData.append('noText', Content);
95+
formData.append('noTag', Tag);
96+
formData.append('noImg', noimg);
9797
if (Title !== null && Content !== null && Tag !== null) {
9898
const config = {
9999
Headers: {
100-
"content-type": "multipart/form-data",
100+
'content-type': 'multipart/form-data',
101101
},
102102
};
103103

104104
axios
105-
.post("http://localhost:3001/notice", formData, config)
105+
.post('http://localhost:3001/notice', formData, config)
106106
.then((res) => {
107-
setTitle(""); //text 초기화
108-
setContent("");
109-
setTag("");
110-
setimg("");
111-
setImg("");
112-
navigate("/Notice");
107+
setTitle(''); //text 초기화
108+
setContent('');
109+
setTag('');
110+
setimg('');
111+
setImg('');
112+
navigate('/Notice');
113113
})
114114
.catch((error) => {
115-
console.log("Network Error : ", error);
115+
console.log('Network Error : ', error);
116116
});
117117
} else {
118-
alert("모든 빈칸을 작성해주세요.");
118+
alert('모든 빈칸을 작성해주세요.');
119119
}
120120
//formData.append('noImg', noImg);
121121
};
@@ -130,16 +130,14 @@ const NoticeWrite = () => {
130130
className={styles.ntcTitle}
131131
value={Title}
132132
onChange={handleChange}
133-
name="title"
134-
></input>
133+
name="title"></input>
135134
<textarea
136135
name="content"
137136
rows="9"
138137
className={styles.ntcContent}
139138
placeholder="내용을 입력하세요"
140139
value={Content}
141-
onChange={handleChange}
142-
></textarea>
140+
onChange={handleChange}></textarea>
143141
</div>
144142
<div>
145143
<p className={styles.tagstyle}>태그</p>
@@ -150,8 +148,7 @@ const NoticeWrite = () => {
150148
style={{ backgroundColor: textColor1 }}
151149
name="tag1"
152150
value="1"
153-
onClick={handleClick}
154-
>
151+
onClick={handleClick}>
155152
NOTICE
156153
</button>
157154
<button
@@ -160,8 +157,7 @@ const NoticeWrite = () => {
160157
style={{ backgroundColor: textColor2 }}
161158
name="tag2"
162159
value="2"
163-
onClick={handleClick}
164-
>
160+
onClick={handleClick}>
165161
EVENT
166162
</button>
167163
<button
@@ -170,8 +166,7 @@ const NoticeWrite = () => {
170166
style={{ backgroundColor: textColor3 }}
171167
name="tag3"
172168
value="3"
173-
onClick={handleClick}
174-
>
169+
onClick={handleClick}>
175170
PROGRAM
176171
</button>
177172
</div>
@@ -188,31 +183,21 @@ const NoticeWrite = () => {
188183
id="input-file"
189184
type="file"
190185
accept="image/*"
191-
style={{ display: "none" }}
186+
style={{ display: 'none' }}
192187
name="noImg"
193-
onChange={handleChange}
194-
></input>
188+
onChange={handleChange}></input>
195189
<label for="input-file">
196190
<div className={styles.plusdiv}>
197191
{noImg ? (
198192
<img src={noImg} alt="preview-img" className={styles.plusdiv} />
199193
) : (
200-
<img
201-
className={styles.plusimg}
202-
id="input-file"
203-
alt="plus"
204-
src={plus}
205-
></img>
194+
<img className={styles.plusimg} id="input-file" alt="plus" src={plus}></img>
206195
)}
207196
</div>
208197
</label>
209198
</div>
210199
<div className={styles.button}>
211-
<input
212-
type="submit"
213-
value="글 남기기"
214-
className={styles.submitbtn}
215-
></input>
200+
<input type="submit" value="글 남기기" className={styles.submitbtn}></input>
216201
</div>
217202
</form>
218203
</div>

0 commit comments

Comments
 (0)