Skip to content

Commit d82c75c

Browse files
committed
to="/feature" 추가
1 parent 5f26e1a commit d82c75c

6 files changed

Lines changed: 47 additions & 13 deletions

File tree

package-lock.json

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"react-icons": "^5.5.0",
1414
"react-router-dom": "^7.5.3",
1515
"react-scripts": "5.0.1",
16+
"react-scroll": "^1.9.3",
1617
"web-vitals": "^2.1.4"
1718
},
1819
"scripts": {

src/components/header/Header.css

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
/* NavLink hover */
5454
.header-nav a:hover {
5555
color: #6a0dad;
56+
cursor: pointer;
5657
}
5758

5859
/* NavLink 활성 상태 */
@@ -62,13 +63,6 @@
6263
font-weight: 600;
6364
}
6465

65-
/* 오른쪽: 버튼들 또는 닉네임 */
66-
/*.header-right {
67-
display: flex;
68-
align-items: center;
69-
gap: 10px;
70-
}*/
71-
7266
/* 로그인/회원가입 버튼 */
7367
.btn {
7468
padding: 6px 12px;

src/components/header/Header.jsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useState, useEffect } from "react";
22
import { NavLink, Link } from "react-router-dom";
3+
import { Link as ScrollLink } from "react-scroll";
34
import { FaMoon, FaSun } from "react-icons/fa";
45
import "./Header.css";
56

@@ -18,7 +19,17 @@ const Header = ({ isLoggedIn, nickname }) => {
1819

1920
<nav className="header-nav">
2021
<NavLink to="/" end></NavLink>
21-
<NavLink to="/features">기능</NavLink>
22+
{/*<NavLink to="/features">기능</NavLink>*/}
23+
<ScrollLink
24+
to="feature"
25+
smooth
26+
duration={500}
27+
offset={-64}
28+
spy={true}
29+
activeClass="active"
30+
>
31+
기능
32+
</ScrollLink>
2233
<NavLink to="/ide">IDE</NavLink>
2334
<NavLink to="/community">커뮤니티</NavLink>
2435
<NavLink to="/broadcast">코드 방송</NavLink>

src/components/mainpage/Main.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
2+
import {Element} from "react-scroll";
33
import Intro from "./intro/Intro";
44
import Features from "./features/Features";
55
import DemoView from "./demoview/DemoView";
@@ -10,7 +10,9 @@ const Main = () => {
1010
<div>
1111
<main>
1212
<Intro />
13-
<Features />
13+
<Element name="feature">
14+
<Features />
15+
</Element>
1416
<DemoView />
1517
<StartNow />
1618
</main>

src/components/mainpage/intro/Intro.jsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React from "react";
22
import "./Intro.css";
33
import introImage from "./intro.png";
4-
import {Link} from "react-router-dom"; // 오른쪽 이미지
4+
import {Link} from "react-router-dom";
5+
import { Link as ScrollLink } from "react-scroll";
56

67
const Intro = () => {
78
return (
@@ -16,8 +17,12 @@ const Intro = () => {
1617
코드 방송 기능을 통해 실시간으로 지식을 공유할 수 있습니다.
1718
</p>
1819
<div className="intro-buttons">
19-
<Link to="ide" className="btn primary">시작하기</Link>
20-
<Link to="" className="btn secondary">기능 살펴보기</Link>
20+
<Link to="/ide" className="btn primary">시작하기</Link>
21+
<ScrollLink to="feature"
22+
smooth
23+
duration={500}
24+
offset={-64}
25+
className="btn secondary">기능 살펴보기</ScrollLink>
2126
</div>
2227
</div>
2328

0 commit comments

Comments
 (0)