Commit 5b9ea71f authored by Kim, Subin's avatar Kim, Subin
Browse files

Nav&Pagination&AdminPage

parent e8766404
This diff is collapsed.
......@@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>KU#</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
......
import React, { useState, useEffect, useRef } from 'react';
import { Navbar, Nav } from 'react-bootstrap';
import logo from '../../public/img/footprint.ico';
import logo from '../footprint.ico';
import cart from '../cart.svg';
import option from '../option.svg';
function MainNav() {
function handleClick() {
alert('로그아웃이 완료되었습니다.')
}
return (
<Navbar bg="dark" variant="dark">
<Navbar fixed="top" bg="dark" variant="dark" style={{position: "sticky"}}>
<Navbar.Brand href="/home">
<img src={logo} width="30" height="30" />
{' '}KU#
......@@ -18,7 +21,7 @@ function MainNav() {
<Nav.Link href="/shoppingcart">
<img src={cart} width="30" height="30" />
</Nav.Link>
<Nav.Link onClick={() => { alert('로그아웃이 완료되었습니다.') }}>Logout</Nav.Link>
<Nav.Link onClick={() => handleClick()}>Logout</Nav.Link>
<Nav.Link href="/admin/:id">
<img src={option} width="30" height="30" />
</Nav.Link>
......
import React, { useState, useEffect, useRef } from 'react';
import { Pagination } from 'react-bootstrap';
function pagination() {
let active = 1;
let items = [];
for (let number = 1; number <= 5; number++) {
items.push(
<Pagination.Item key={number} active={number === active}>
{number}
</Pagination.Item>,
);
}
return (
<Pagination className="justify-content-center mt-5">{items}</Pagination>
)
}
export default pagination
\ No newline at end of file
import React, { useState, useEffect, useRef } from 'react';
import { Navbar, Nav } from 'react-bootstrap';
import { Redirect } from 'react-router-dom';
import { Nav, NavDropdown } from 'react-bootstrap';
function SubNav() {
function handleMouseEnter(e) {
console.log(e.target)
const [toggle, setToggle] = useState({ "dress": false, "outer": false, "top": false, "pants": false, "skirt": false, "training": false, "shoes": false });
function handleMouseEnter(id) {
setToggle({ [id]: true })
}
function handleMouseLeave(id) {
setToggle({ [id]: false })
}
function handleToggle(id) {
setToggle({ [id]: !toggle[`${id}`] })
}
function handleClick(url) {
return <Redirect to={url} />
}
return (
<Nav>
<Nav.Item eventKey="1">
<Nav.Link href="/dress">DRESS</Nav.Link>
</Nav.Item>
<Nav.Item eventKey="2">
<Nav.Link href="/outer">OUTER</Nav.Link>
</Nav.Item>
<Nav.Item eventKey="3">
<Nav.Link href="/top">TOP</Nav.Link>
</Nav.Item>
<Nav.Item eventKey="4">
<Nav.Link href="/bottom">BOTTOM</Nav.Link>
</Nav.Item>
<Nav.Item eventKey="5">
<Nav fixed="top" className="flex-nowrap">
<NavDropdown title="DRESS" onMouseEnter={() => handleMouseEnter("dress")} onMouseLeave={() => handleMouseLeave("dress")} show={toggle.dress} toggle={() => handleToggle("dress")} onClick={() => handleClick("/dress")}>
<NavDropdown.Item href="/dress/long">LONG DRESS</NavDropdown.Item>
<NavDropdown.Item href="/dress/short">SHORT DRESS</NavDropdown.Item>
<NavDropdown.Item href="/dress/knit">KNIT DRESS</NavDropdown.Item>
<NavDropdown.Item href="/dress/shirt">SHIRT DRESS</NavDropdown.Item>
<NavDropdown.Item href="/dress/pattern">PATTERN DRESS</NavDropdown.Item>
<NavDropdown.Item href="/dress/bustier">BUSTIER DRESS</NavDropdown.Item>
<NavDropdown.Item href="/dress/two-piece">TWO-PIECE DRESS</NavDropdown.Item>
</NavDropdown>
<NavDropdown title="OUTER" onMouseEnter={() => handleMouseEnter("outer")} onMouseLeave={() => handleMouseLeave("outer")} show={toggle.outer} toggle={() => handleToggle("outer")} onClick={() => handleClick("/outer")}>
<NavDropdown.Item href="/outer/padded-jacket">PADDED JACKET</NavDropdown.Item>
<NavDropdown.Item href="/outer/jacket">JACKET</NavDropdown.Item>
<NavDropdown.Item href="/outer/jumper">JUMPER</NavDropdown.Item>
<NavDropdown.Item href="/outer/coat">COAT</NavDropdown.Item>
<NavDropdown.Item href="/outer/fleece">FLEECE</NavDropdown.Item>
<NavDropdown.Item href="/outer/cardigan_vest">CARDIGAN / VEST</NavDropdown.Item>
</NavDropdown>
<NavDropdown title="TOP" onMouseEnter={() => handleMouseEnter("top")} onMouseLeave={() => handleMouseLeave("top")} show={toggle.top} toggle={() => handleToggle("top")} onClick={() => handleClick("/top")}>
<NavDropdown.Item href="/top/knit">KNIT</NavDropdown.Item>
<NavDropdown.Item href="/top/hoody">HOODY</NavDropdown.Item>
<NavDropdown.Item href="/top/blouse">BLOUSE</NavDropdown.Item>
<NavDropdown.Item href="/top/shirt">SHIRT</NavDropdown.Item>
<NavDropdown.Item href="/top/sweatshirt">SWEATSHIRT</NavDropdown.Item>
<NavDropdown.Item href="/top/long-sleeve-shirt">LONG SLEEVE SHIRT</NavDropdown.Item>
<NavDropdown.Item href="/top/short-sleeved-shirt_sleeveless-shirt">SHORT SLEEVE / SLEEVELESS SHIRT</NavDropdown.Item>
</NavDropdown>
<NavDropdown title="PANTS" onMouseEnter={() => handleMouseEnter("pants")} onMouseLeave={() => handleMouseLeave("pants")} show={toggle.pants} toggle={() => handleToggle("pants")} onClick={() => handleClick("/pants")}>
<NavDropdown.Item href="/pants/jeans">JEANS</NavDropdown.Item>
<NavDropdown.Item href="/pants/skinny-jeans">SKINNY JEANS</NavDropdown.Item>
<NavDropdown.Item href="/pants/banding">BANDING PANTS</NavDropdown.Item>
<NavDropdown.Item href="/pants/wide-fit">WIDE-FIT PANTS</NavDropdown.Item>
<NavDropdown.Item href="/pants/boot-cut">BOOT-CUT PANTS</NavDropdown.Item>
<NavDropdown.Item href="/pants/straight-fit">STRAIGHT-FIT PANTS</NavDropdown.Item>
<NavDropdown.Item href="/pants/wide-fit">WIDE-FIT PANTS</NavDropdown.Item>
<NavDropdown.Item href="/pants/shorts">SHORTS</NavDropdown.Item>
<NavDropdown.Item href="/pants/trousers">TROUSERS</NavDropdown.Item>
<NavDropdown.Item href="/pants/leggings">LEGGINGS</NavDropdown.Item>
<NavDropdown.Item href="/pants/jumpsuit_overalls">JUMPSUIT / OVERALLS</NavDropdown.Item>
</NavDropdown>
<NavDropdown title="SKIRT" onMouseEnter={() => handleMouseEnter("skirt")} onMouseLeave={() => handleMouseLeave("skirt")} show={toggle.skirt} toggle={() => handleToggle("skirt")} onClick={() => handleClick("/skirt")}>
<NavDropdown.Item href="/skirt/long">LONG SKIRT</NavDropdown.Item>
<NavDropdown.Item href="/skirt/midi">MIDI SKIRT</NavDropdown.Item>
<NavDropdown.Item href="/skirt/mini">MINI SKIRT</NavDropdown.Item>
</NavDropdown>
<Nav.Item>
<Nav.Link href="/training">TRAINING</Nav.Link>
</Nav.Item>
<Nav.Item eventKey="6">
<Nav.Link href="/inner">INNER</Nav.Link>
</Nav.Item>
<Nav.Item eventKey="7">
<Nav.Link href="/shoes">SHOES</Nav.Link>
</Nav.Item>
<NavDropdown title="SHOES" onMouseEnter={() => handleMouseEnter("shoes")} onMouseLeave={() => handleMouseLeave("shoes")} show={toggle.shoes} toggle={() => handleToggle("shoes")} onClick={() => handleClick("/shoes")}>
<NavDropdown.Item href="/skirt/sneakers_slip-on">SNEAKERS / SLIP-ON</NavDropdown.Item>
<NavDropdown.Item href="/skirt/flat_loafer">FLAT / LOAFER</NavDropdown.Item>
<NavDropdown.Item href="/skirt/heel_pump">HEEL / PUMP</NavDropdown.Item>
<NavDropdown.Item href="/skirt/boots">BOOTS</NavDropdown.Item>
<NavDropdown.Item href="/skirt/sandal_slipper">SANDAL / SLIPPER</NavDropdown.Item>
</NavDropdown>
</Nav>
)
}
......
......@@ -2,6 +2,9 @@ import React, { useState, useEffect, useRef } from 'react';
import { Redirect } from 'react-router-dom';
import MainNav from '../Components/MainNav';
import SubNav from '../Components/SubNav';
import Pagination from '../Components/Pagination';
import search from '../search.svg';
import { Row, Col, Form, FormControl, Button, CardColumns, Card } from 'react-bootstrap';
function Admin() {
......@@ -9,7 +12,130 @@ function Admin() {
<div>
<MainNav />
<SubNav />
<Row className="justify-content-end mt-5 mr-3">
<Col md={4} sm={5} xs={8} as={Form} inline className="justify-content-end">
<FormControl type="text" placeholder="Search" className="mr-1" />
<Button bg="dark" variant="dark" type="submit">Search
{/* <img src={search} className="text-light"/> */}
</Button>
</Col>
<Col sm={2} xs={3} as={Button} variant="dark" type="button" href="/:id/productsregist">상품 등록</Col>
</Row>
<Row className="mt-5 m-auto justify-content-start">
<Card className="m-4" style={{width: "18rem"}}>
<Card.Img variant="top" src="/img/Jimin_(2).jpg" />
<Card.Body>
<Card.Title>케이시앵글부트</Card.Title>
<Card.Text>
재고:
구매자 :
</Card.Text>
</Card.Body>
</Card>
<Card className="m-4" style={{width: "18rem"}}>
<Card.Img variant="top" src="" />
<Card.Body>
<Card.Title>메리제인플랫(S)</Card.Title>
<Card.Text>
재고:
구매자 :
</Card.Text>
</Card.Body>
</Card>
<Card className="m-4" style={{width: "18rem"}}>
<Card.Img variant="top" src="" />
<Card.Body>
<Card.Title>케이시앵글부트</Card.Title>
<Card.Text>
재고:
구매자 :
</Card.Text>
</Card.Body>
</Card>
<Card className="m-4" style={{width: "18rem"}}>
<Card.Img variant="top" src="" />
<Card.Body>
<Card.Title>케이시앵글부트</Card.Title>
<Card.Text>
재고:
구매자 :
</Card.Text>
</Card.Body>
</Card>
<Card className="m-4" style={{width: "18rem"}}>
<Card.Img variant="top" src="" />
<Card.Body>
<Card.Title>케이시앵글부트</Card.Title>
<Card.Text>
재고:
구매자 :
</Card.Text>
</Card.Body>
</Card>
<Card className="m-4" style={{width: "18rem"}}>
<Card.Img variant="top" src="" />
<Card.Body>
<Card.Title>케이시앵글부트</Card.Title>
<Card.Text>
재고:
구매자 :
</Card.Text>
</Card.Body>
</Card>
<Card className="m-4" style={{width: "18rem"}}>
<Card.Img variant="top" src="" />
<Card.Body>
<Card.Title>케이시앵글부트</Card.Title>
<Card.Text>
재고:
구매자 :
</Card.Text>
</Card.Body>
</Card>
<Card className="m-4" style={{width: "18rem"}}>
<Card.Img variant="top" src="" />
<Card.Body>
<Card.Title>케이시앵글부트</Card.Title>
<Card.Text>
재고:
구매자 :
</Card.Text>
</Card.Body>
</Card>
<Card className="m-4" style={{width: "18rem"}}>
<Card.Img variant="top" src="" />
<Card.Body>
<Card.Title>케이시앵글부트</Card.Title>
<Card.Text>
재고:
구매자 :
</Card.Text>
</Card.Body>
</Card>
<Card className="m-4" style={{width: "18rem"}}>
<Card.Img variant="top" src="" />
<Card.Body>
<Card.Title>케이시앵글부트</Card.Title>
<Card.Text>
재고:
구매자 :
</Card.Text>
</Card.Body>
</Card>
<Card className="m-4" style={{width: "18rem"}}>
<Card.Img variant="top" src="" />
<Card.Body>
<Card.Title>케이시앵글부트</Card.Title>
<Card.Text>
재고:
구매자 :
</Card.Text>
</Card.Body>
</Card>
</Row>
<Pagination />
</div>
)
}
......
......@@ -17,6 +17,7 @@ ReactDOM.render(
<Route exact path="/" component={Home} />
<Route path="/login" component={Login} />
<Route path="/signup" component={Signup} />
<Route path="/admin" component={Admin} />
<Route path="/shoppingcart" component={ShoppingCart} />
<Redirect path="/" to="/" />
</Switch>
......
<?xml version="1.0" ?><svg enable-background="new 0 0 32 32" id="Glyph" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M27.414,24.586l-5.077-5.077C23.386,17.928,24,16.035,24,14c0-5.514-4.486-10-10-10S4,8.486,4,14 s4.486,10,10,10c2.035,0,3.928-0.614,5.509-1.663l5.077,5.077c0.78,0.781,2.048,0.781,2.828,0 C28.195,26.633,28.195,25.367,27.414,24.586z M7,14c0-3.86,3.14-7,7-7s7,3.14,7,7s-3.14,7-7,7S7,17.86,7,14z" id="XMLID_223_"/></svg>
\ No newline at end of file
node_modules
package-lock.json
\ No newline at end of file
// const createError = require('http-errors');
const express = require('express');
const path = require('path');
const cookieParser = require('cookie-parser');
// const cookieParser = require('cookie-parser');
const logger = require('morgan');
const port = 3030;
const indexRouter = require('./routes/index');
// const indexRouter = require('./routes/index');
const app = express();
connect();
// connect();
// view engine setup
// app.set('views', path.join(__dirname, 'views'));
......@@ -20,7 +20,7 @@ app.use(express.urlencoded({ extended: false }));
// app.use(cookieParser(process.env.JWT_SECRET));
app.use(express.static(path.join(__dirname, 'public')));
app.use('/', indexRouter);
// app.use('/', indexRouter);
app.listen(port, () => console.log(port));
......@@ -33,7 +33,7 @@ app.use(function(req, res, next) {
app.use(function(err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};
// res.locals.error = req.app.get('env') === 'development' ? err : {};
// render the error page
res.status(err.status || 500);
......
{
"name": "server",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.17.1"
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment