채지성

front-navbar-first

This diff is collapsed. Click to expand it.
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
6 "@testing-library/jest-dom": "^5.16.4", 6 "@testing-library/jest-dom": "^5.16.4",
7 "@testing-library/react": "^13.3.0", 7 "@testing-library/react": "^13.3.0",
8 "@testing-library/user-event": "^13.5.0", 8 "@testing-library/user-event": "^13.5.0",
9 + "bootstrap": "^5.1.3",
9 "react": "^18.1.0", 10 "react": "^18.1.0",
11 + "react-bootstrap": "^2.4.0",
10 "react-dom": "^18.1.0", 12 "react-dom": "^18.1.0",
11 "react-scripts": "5.0.1", 13 "react-scripts": "5.0.1",
12 "web-vitals": "^2.1.4" 14 "web-vitals": "^2.1.4"
......
1 -import logo from './logo.svg';
2 -import './App.css';
3 -import axios from "axios";
4 -import { useEffect } from 'react';
5 -
6 -function App() {
7 - const callApi = async()=>{
8 - axios.get("/api").then((res)=>{console.log(res.data.test)});
9 - };
10 -
11 - useEffect(()=>{
12 - callApi();
13 - }, []);
14 -
15 - return (
16 - <div className="App">
17 - <header className="App-header">
18 - <img src={logo} className="App-logo" alt="logo" />
19 - <p>
20 - Edit <code>src/App.js</code> and save to reload.
21 - </p>
22 - <a
23 - className="App-link"
24 - href="https://reactjs.org"
25 - target="_blank"
26 - rel="noopener noreferrer"
27 - >
28 - Learn React
29 - </a>
30 - </header>
31 - </div>
32 - );
33 -}
34 -
35 -export default App;
...\ No newline at end of file ...\ No newline at end of file
1 +import './App.css';
2 +import axios from "axios";
3 +import { useEffect } from 'react';
4 +import { Navbar, Container, NavDropdown, Nav} from 'react-bootstrap'
5 +import khuimg from '../img/khumeal.png'
6 +
7 +function App() {
8 + const callApi = async()=>{
9 + axios.get("/api").then((res)=>{console.log(res.data.test)});
10 + };
11 +
12 + useEffect(()=>{
13 + callApi();
14 + }, []);
15 +
16 + return (
17 +
18 + <Navbar bg="#ff0000" expand="lg" style={{ background:'#9E1915'}} >
19 + <Container>
20 + <img src = {khuimg} height="40px" width="40px" />
21 + <Navbar.Brand href="#home">2 학식 커뮤니티</Navbar.Brand>
22 + <Navbar.Toggle aria-controls="basic-navbar-nav" />
23 + <Navbar.Collapse id="basic-navbar-nav">
24 + <Nav className="me-auto">
25 + <Nav.Link href="#home">메뉴</Nav.Link>
26 + <Nav.Link href="#link">메뉴에 대한 이야기</Nav.Link>
27 + <Nav.Link href="#link"> 작성</Nav.Link>
28 + </Nav>
29 + </Navbar.Collapse>
30 + </Container>
31 + </Navbar>
32 + );
33 +}
34 +
35 +export default App;
...\ No newline at end of file ...\ No newline at end of file
1 import React from 'react'; 1 import React from 'react';
2 import ReactDOM from 'react-dom/client'; 2 import ReactDOM from 'react-dom/client';
3 import './index.css'; 3 import './index.css';
4 -import App from './App'; 4 +import App from './Component/App';
5 import reportWebVitals from './reportWebVitals'; 5 import reportWebVitals from './reportWebVitals';
6 +import 'bootstrap/dist/css/bootstrap.min.css';
6 7
7 const root = ReactDOM.createRoot(document.getElementById('root')); 8 const root = ReactDOM.createRoot(document.getElementById('root'));
8 root.render( 9 root.render(
......
This diff is collapsed. Click to expand it.
...@@ -6,9 +6,11 @@ ...@@ -6,9 +6,11 @@
6 }, 6 },
7 "dependencies": { 7 "dependencies": {
8 "axios": "^0.27.2", 8 "axios": "^0.27.2",
9 + "bootstrap": "^5.1.3",
9 "concurrently": "^7.2.1", 10 "concurrently": "^7.2.1",
10 "express": "^4.18.1", 11 "express": "^4.18.1",
11 "http-proxy-middleware": "^2.0.6", 12 "http-proxy-middleware": "^2.0.6",
12 - "nodemon": "^2.0.16" 13 + "nodemon": "^2.0.16",
14 + "react-bootstrap": "^2.4.0"
13 } 15 }
14 } 16 }
......