File tree Expand file tree Collapse file tree 7 files changed +55
-55
lines changed
Expand file tree Collapse file tree 7 files changed +55
-55
lines changed Original file line number Diff line number Diff line change 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' ;
44import Test from './pages/List-page/Test' ;
55
66export 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 ) ;
Original file line number Diff line number Diff 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-
Original file line number Diff line number Diff line change 3434
3535button {
3636 cursor : pointer ;
37- font-family : " Pretendard" , sans-serif ;
37+ font-family : ' Pretendard' , sans-serif ;
3838}
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import App from './App.jsx';
66createRoot ( document . getElementById ( 'root' ) ) . render (
77 < StrictMode >
88 < BrowserRouter >
9- < App />
9+ < App />
1010 </ BrowserRouter >
1111 </ StrictMode > ,
1212) ;
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments