Skip to content

Commit d0b0e34

Browse files
authored
Merge pull request #27 from codeit-maso/feature/jeon
🐛 fix: 프리티어, eslint적용, 외 코드 일부 수정
2 parents 1cd5594 + 1e19d01 commit d0b0e34

File tree

7 files changed

+55
-55
lines changed

7 files changed

+55
-55
lines changed

src/App.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import "./base.scss";
2-
import { Route, Routes } from "react-router-dom";
3-
import Header from "./components/layout/Header/Header";
1+
import './base.scss';
2+
import { Route, Routes } from 'react-router-dom';
3+
import Header from './components/layout/Header/Header';
44
import Test from './pages/List-page/Test';
55

66
export default function App() {
77
return (
88
<>
9-
<Header/>
9+
<Header />
1010
<Routes>
11-
<Route path="/" element={<Test/>}/>
11+
<Route path="/" element={<Test />} />
1212
</Routes>
1313
</>
1414
);

src/assets/styles/variables.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,3 @@ $font-weight-bold: 700;
127127
font-size: $font-size-12;
128128
font-weight: $font-weight-regular;
129129
}
130-
131-

src/base.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ a {
3434

3535
button {
3636
cursor: pointer;
37-
font-family: "Pretendard", sans-serif;
37+
font-family: 'Pretendard', sans-serif;
3838
}
Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
1-
import { Link } from "react-router-dom";
2-
import { useLocation } from "react-router-dom";
3-
import styles from "./Header.module.scss";
4-
import logo from "../../../assets/images/rolling-logo.svg";
1+
import { Link } from 'react-router-dom';
2+
import { useLocation } from 'react-router-dom';
3+
import styles from './Header.module.scss';
4+
import logo from '../../../assets/images/rolling-logo.svg';
55

6-
export default function Header(){
7-
const location = useLocation();
8-
const showButton = ['/', '/list'];
9-
const isLocation = showButton.includes(location.pathname);
6+
const showButton = ['/', '/list'];
107

11-
return(
12-
<>
13-
<header className={styles.header}>
14-
<Link to="/">
15-
<img className={styles.logo} src={logo} alt="rolling logo"></img>
16-
</Link>
17-
{isLocation && <Link to="/post" className={styles.button}>롤링 페이퍼 만들기</Link>}
18-
</header>
19-
<div className={styles.underline}></div>
20-
</>
21-
)
22-
}
8+
export default function Header() {
9+
const location = useLocation();
10+
const isLocation = showButton.includes(location.pathname);
2311

12+
return (
13+
<>
14+
<header className={styles.header}>
15+
<Link to="/">
16+
<img className={styles.logo} src={logo} alt="rolling logo"></img>
17+
</Link>
18+
{isLocation && (
19+
<Link to="/post" className={styles.button}>
20+
롤링 페이퍼 만들기
21+
</Link>
22+
)}
23+
</header>
24+
<div className={styles.underline}></div>
25+
</>
26+
);
27+
}
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
@import '../../../assets/styles/variables.scss';
1+
@use '../../../assets/styles/variables.scss' as *;
22

3-
.header{
4-
display: flex;
5-
justify-content: space-between;
6-
align-items: center;
7-
width:100%;
8-
max-width: 1207px;
9-
margin:0 auto;
3+
.header {
4+
display: flex;
5+
justify-content: space-between;
6+
align-items: center;
7+
width: 100%;
8+
max-width: 1207px;
9+
margin: 0 auto;
1010
}
1111

12-
.underline{
13-
height: 1px;
14-
background-color: #EDEDED;
12+
.underline {
13+
height: 1px;
14+
background-color: #ededed;
1515
}
1616

17-
.logo{
18-
width: 106px;
19-
margin: 16px 0;
17+
.logo {
18+
width: 106px;
19+
margin: 16px 0;
2020
}
2121

22-
.button{
23-
@include font-16-regular;
24-
padding: 7px 16px;
25-
border: 1px solid $gray-300;
26-
border-radius: 6px;
27-
white-space: nowrap;
28-
}
22+
.button {
23+
@include font-16-regular;
24+
padding: 7px 16px;
25+
border: 1px solid $gray-300;
26+
border-radius: 6px;
27+
white-space: nowrap;
28+
}

src/main.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import App from './App.jsx';
66
createRoot(document.getElementById('root')).render(
77
<StrictMode>
88
<BrowserRouter>
9-
<App/>
9+
<App />
1010
</BrowserRouter>
1111
</StrictMode>,
1212
);

src/pages/List-page/Test.jsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
export default function Test(){
2-
return(
3-
<div style={{fontSize:"30px"}}>Route test component ^_^ </div>
4-
)
5-
}
1+
export default function Test() {
2+
return <div style={{ fontSize: '30px' }}>Route test component ^_^ </div>;
3+
}

0 commit comments

Comments
 (0)