Commit 20a12a94 authored by Lee SeoYeon's avatar Lee SeoYeon
Browse files

.

parent c3d80753
This diff is collapsed.
......@@ -8,7 +8,7 @@ function Paginations(props) {
return (
<>
{(props.endPage > 5) ?
<Pagination >
<Pagination>
<Pagination.First onClick={() => props.handlePage(1)} />
{props.index === 1 ? <Pagination.Prev onClick={() => props.handlePage(props.index)} /> : <Pagination.Prev onClick={() => props.handlePage(props.index - 1)} />}
{props.index === props.endPage - 1 ? <Pagination.Item onClick={() => props.handlePage(props.index - 3)}>{props.index - 3}</Pagination.Item> : ""}
......
import React, { useState, useEffect } from 'react';
import { Redirect } from 'react-router-dom';
import ohuh from '../ohuh.PNG';
import { Container, Row, Form, Image, InputGroup, Button, Col, Card } from 'react-bootstrap';
import { Container, Row, Form, Image, InputGroup, Button, Col, Card, Nav } from 'react-bootstrap';
import axios from 'axios';
import Place from '../Pages/Place.js';
import { handleLogout, isAuthenticated } from '../utils/auth.js'
function App() {
const [state, setState] = useState(false);
......@@ -11,7 +12,7 @@ function App() {
const [show, setShow] = useState(false);
const [recommend, setRecommend] = useState([{ name: " ", address: " ", img: " " }]);
const [latest, setLatest] = useState([{ name: " ", address: " ", img: " " }]);
const user = isAuthenticated()
useEffect(() => {
getRecommend()
......@@ -54,8 +55,18 @@ function App() {
return (
<Container className="vh-100 ">
<Container className="vh-100 d-flex justify-content-md-center\">
<Col md={12} >
<Nav className="justify-content-end" bg="#fff" variant="light" >
{user ? <Nav.Link onClick={() => handleLogout()}>로그아웃</Nav.Link>
: (
<>
<Nav.Link href="/signup">회원가입</Nav.Link>
<Nav.Link href="/login">로그인</Nav.Link>
</>
)}
<Nav.Link href='/bookmark'>북마크</Nav.Link>
</Nav>
<Row className="justify-content-center" >
<Image src={ohuh} style={{ margin: "5%", marginTop : "3%" }} />
</Row>
......@@ -84,7 +95,7 @@ function App() {
<Card.Body >
<Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: "80px" }} >
{recommend.address} </Card.Text>
<Button variant="primary" onClick={() => {
<Button variant="info" onClick={() => {
setShow(true)
}}>{recommend.name} 자세히 살펴보기</Button>
<Place place={recommend} show={show} onHide={() => setShow(false)} />
......@@ -100,7 +111,7 @@ function App() {
<Card.Body >
<Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: "80px" }} >
{latest.address} </Card.Text>
<Button variant="primary" onClick={() => {
<Button variant="info" onClick={() => {
setShow(true)
}}>{latest.name} 자세히 살펴보기</Button>
<Place place={latest} show={show} onHide={() => setShow(false)} />
......
......@@ -8,7 +8,7 @@ function Place(props) {
const [db, setDb] = useState(false)
const [index, setIndex] = useState(0)
const [reviews, setReviews] = useState([])
const place = queryString.parse(props.location.search).place
const place = queryString.parse(props.location).place
const getReview = (index) => {
console.log(index, "dlseprtm")
......
......@@ -162,7 +162,7 @@ function Search(props) {
return (
<Container >
<Link to="/path" className="d-flex justify-content-center"><Image src={ohuh} /></Link>
<Link to="/" className="d-flex justify-content-center"><Image src={ohuh} /></Link>
<Row className="mb-2" className="d-flex justify-content-center">
<Form style={{ width: "90vw" }} onSubmit={handleSubmit}>
<InputGroup size="lg">
......@@ -201,7 +201,7 @@ function Search(props) {
<Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: "80px" }} >
{place.address} </Card.Text>
<Link to={`/place?id=${index}&place=${place.name}`} >
<Button variant="primary"> {place.name} 자세히 살펴보기</Button>
<Button variant="info"> {place.name} 자세히 살펴보기</Button>
</Link>
</Card.Body>
</Card>
......
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