Skip to content

Commit

Permalink
Modify: 메인 링크 주소 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Haze10425 committed Nov 2, 2023
1 parent e5b217b commit f42c735
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Weread</title>
<title>Dobby</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
1 change: 0 additions & 1 deletion src/Router.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const Router = () => {
<Route path="/delivery" element={<Delivery />} />
<Route path="/detail/:productId" element={<Detail />} />
<Route path="/main" element={<Main />} />
{/* <Route path="/store/:id" element={<Store />} /> */}
<Route path="/store" element={<Store />} />
<Route path="/pay-complete" element={<PayComplete />} />
<Route path="/payment" element={<Payment />} />
Expand Down
4 changes: 2 additions & 2 deletions src/components/Nav/Nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ const Nav = () => {
localStorage.removeItem('token');
localStorage.removeItem('nickname');
alert('로그아웃 되었습니다.');
navigate('/main');
navigate('/main?dobbyBox=basic');
};

return (
<div className="navHeader">
<div className="header">
<h1
onClick={() => {
navigate('/main');
navigate('/main?dobbyBox=basic');
}}
>
DOBBY
Expand Down
3 changes: 2 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// src/config.js
const BASE_URL = 'http://10.58.52.189:8000';
const BASE_URL6 = 'http://10.58.52.196:8000';
// const BASE_URL6 = 'http://10.58.52.196:8000';

export const GET_SUBSCRIPTION_API = `${BASE_URL}/subscription`;
export const GET_PRODUCTLIST_API = `${BASE_URL}/products`;
Expand All @@ -13,3 +13,4 @@ export const GET_PAYMENT_ADDRESS_API = `${BASE_URL}/cart/payment/address`;
export const POST_PAYMENT_NEW_ADDRESS_API = `${BASE_URL}/cart/payment/address/done`;
export const GET_PRODUCT_DETAIL_API = `${BASE_URL}/products`;
export const POST_CART_DETAIL_API = `${BASE_URL}/cart`;
export const PATCH_PAYMENT_ORDER_API = `${BASE_URL}/cart/payment/reversion`;
2 changes: 1 addition & 1 deletion src/pages/Login/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Login = () => {
alert('로그인 되었습니다.');
localStorage.setItem('nickname', data.nickname);
localStorage.setItem('token', data.token);
navigate('/main?dobbybox=basic');
navigate('/main?dobbyBox=basic');
} else if (data.message === 'INVALID EMAIL OR PASSWORD') {
alert('가입되지 않은 정보입니다.');
}
Expand Down
5 changes: 1 addition & 4 deletions src/pages/Main/Layout/TabList/TabList.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
border-radius: 10px 10px 0 0;
padding: 13px;
color: #fff;

&:hover {
cursor: pointer;
}
cursor: pointer;

&.active {
background-color: #fff;
Expand Down
7 changes: 5 additions & 2 deletions src/pages/Main/Main.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { useSearchParams } from 'react-router-dom';
import { useNavigate, useSearchParams } from 'react-router-dom';
import Subscribe from './Layout/Subscribe/Subscribe';
import CategorizedSlide from './Layout/CategorizedSlide/CategorizedSlide';
import CategoryList from './Layout/CategoryList/CategoryList';
Expand All @@ -10,6 +10,7 @@ const Main = () => {
const [searchParams, setSearchParams] = useSearchParams();
const [productsData, setProductsData] = useState({});
const [menuList, setMenuList] = useState([]);
const navigate = useNavigate();

const setSubTypeParams = subtype => {
const subscriptParams = new URLSearchParams(searchParams);
Expand Down Expand Up @@ -55,7 +56,9 @@ const Main = () => {
})
.then(res => res.json())
.then(data => {
window.location.href = data.redirectUrl;
if (data.message === 'success') {
navigate(`/payment${searchParams.toString()}`);
}
});
};

Expand Down
2 changes: 1 addition & 1 deletion src/pages/PayComplete/PayComplete.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const PayComplete = () => {
const navigate = useNavigate();

const mainClick = () => {
navigate('/main');
navigate('/main?dobbyBox=basic');
};

return (
Expand Down
6 changes: 5 additions & 1 deletion src/pages/Store/Layout/Search.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import React, { useState } from 'react';
import './Search.scss';
import { useSearchParams } from 'react-router-dom';
import './Search.scss';

const Search = () => {
const [search, setSearch] = useState('');
const [searchParams, setSearchParams] = useSearchParams();

const handleSearch = () => {
if (!search) {
alert('검색어를 입력해주세요!');
return;
}
searchParams.set('search', search);
setSearchParams(searchParams);
};
Expand Down
1 change: 0 additions & 1 deletion src/pages/Store/Layout/Search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
}

button {
cursor: pointer;
border: 1px solid #000;
border-radius: 6px;
padding: 2px 5px;
Expand Down

0 comments on commit f42c735

Please sign in to comment.