Skip to content

Commit

Permalink
Merge pull request #39 from URECA-PODONG/feat/#4
Browse files Browse the repository at this point in the history
feat(#4): 쇼핑몰 api 쿼리 실행, 건강관리 퍼블리싱, Nav&Footer 오류 수정, 장바구니 퍼블리싱
  • Loading branch information
ckdwns1221 authored Nov 3, 2024
2 parents a816bed + 0e237a7 commit 0df27d9
Show file tree
Hide file tree
Showing 25 changed files with 1,661 additions and 1,988 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@eslint/js": "^9.11.1",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.3",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^9.11.1",
"eslint-plugin-react": "^7.37.0",
Expand Down
9 changes: 9 additions & 0 deletions public/images/carousel/carouselImage1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/images/carousel/carouselImage2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/images/carousel/carouselImage3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/images/carousel/carouselImage4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/images/carousel/carouselImage5.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/images/carousel/carouselImage6.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/images/carousel/carouselImage7.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/images/carousel/carouselImage8.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
186 changes: 103 additions & 83 deletions src/Router.jsx
Original file line number Diff line number Diff line change
@@ -1,108 +1,128 @@
import {
BrowserRouter,
Routes,
Route,
Outlet,
useLocation,
} from "react-router-dom";
import MainPage from "./pages/MainPage/MainPage.jsx";
import MainNav from "./components/common/MainNav.jsx";
import Footer from "./components/common/Footer";
import ScrollTop from "./components/common/ScrollTop.jsx";
import LoginPage from "./pages/LoginPage/LoginPage.jsx";
import NanumWrite from "./pages/NanumPage/NanumWrite.jsx";
import NanumList from "./pages/NanumPage/NanumList.jsx";
import NanumDetail from "./pages/NanumPage/NanumDetail.jsx";
import UserRegisterPage from "./pages/RegisterPage/UserRegisterPage.jsx";
import UserEditPage from "./pages/MyPage/UserEditPage.jsx";
import MyPage from "./pages/MyPage/MyPage.jsx";
import RegisterMissingSavePage from "./pages/MyPage/RegisterMissingSavePage.jsx";
import RegisterMissing from "./pages/MyPage/RegisterMissing.jsx";
import PetRegisterPage from "./pages/RegisterPage/PetRegisterPage.jsx";
import ShoppingDetail from "./pages/MainPage/ShoppingDetail.jsx";
import SideNav from "./components/common/SideNav.jsx";
import WalkPage from "./pages/WalkPage/WalkPage.jsx";
import WalkMapPage from "./pages/WalkPage/WalkMapPage.jsx";
import WalkJournalPage from "./pages/WalkPage/WalkJournalPage.jsx";
import Payment from "./pages/PaymentPage/Payment.jsx";
import PaymentEnd from "./pages/PaymentPage/PaymentEnd.jsx";
import CancelPay from "./pages/PaymentPage/CancelPay.jsx";
import PetEditPage from "./pages/MyPage/PetEditPage.jsx";
import { BrowserRouter, Routes, Route, Outlet, useLocation } from 'react-router-dom';
import MainPage from './pages/MainPage/MainPage.jsx';
import MainNav from './components/common/MainNav.jsx';
import Footer from './components/common/Footer';
import ScrollTop from './components/common/ScrollTop.jsx';
import LoginPage from './pages/LoginPage/LoginPage.jsx';
import NanumWrite from './pages/NanumPage/NanumWrite.jsx';
import NanumList from './pages/NanumPage/NanumList.jsx';
import NanumDetail from './pages/NanumPage/NanumDetail.jsx';
import UserRegisterPage from './pages/RegisterPage/UserRegisterPage.jsx';
import UserEditPage from './pages/MyPage/UserEditPage.jsx';
import MyPage from './pages/MyPage/MyPage.jsx';
import RegisterMissingSavePage from './pages/MyPage/RegisterMissingSavePage.jsx';
import RegisterMissing from './pages/MyPage/RegisterMissing.jsx';
import PetRegisterPage from './pages/RegisterPage/PetRegisterPage.jsx';
import ShoppingDetail from './pages/MainPage/ShoppingDetail.jsx';
import SideNav from './components/common/SideNav.jsx';
import WalkPage from './pages/WalkPage/WalkPage.jsx';
import WalkMapPage from './pages/WalkPage/WalkMapPage.jsx';
import WalkJournalPage from './pages/WalkPage/WalkJournalPage.jsx';
import Payment from './pages/PaymentPage/Payment.jsx';
import PaymentEnd from './pages/PaymentPage/PaymentEnd.jsx';
import CancelPay from './pages/PaymentPage/CancelPay.jsx';
import PetEditPage from './pages/MyPage/PetEditPage.jsx';


import PayListTest from "./pages/PaymentPage/paylisttest.jsx";
import PaymentCancelList from "./pages/PaymentPage/PaymentCancelList.jsx";
import PaymentHistory from "./pages/PaymentPage/PaymentHistory.jsx";
import PayListTest from './pages/PaymentPage/paylisttest.jsx';
import PaymentCancelList from './pages/PaymentPage/PaymentCancelList.jsx';
import PaymentHistory from './pages/PaymentPage/PaymentHistory.jsx';

import ComunityWrite from './pages/CommunityPage/CommunityWrite.jsx';
import CommunityList from './pages/CommunityPage/CommunityList.jsx';
import CommunityDetail from './pages/CommunityPage/CommunityDetail.jsx';

import HealthCare from './pages/HealthCare/HealthCare.jsx';
import ShoppingCart from './pages/ShoppingCart/ShoppingCart.jsx';
import { CartProvider } from './pages/ShoppingCart/CartContext';

function Router() {
return (
<BrowserRouter>
{/* <ScrollTop /> */}
{/* <NavSelector /> */}
<Routes>
<Route path="/" element={<Outlet />}>
<Route index element={<MainPage/>} />
<Route path="login" element={<LoginPage />} />
<Route
path="shoppingDetail/:productId"
element={<ShoppingDetail />}
/>
<CartProvider>
<ScrollTop />
<NavSelector />
<Routes>
<Route path="/" element={<Outlet />}>
<Route index element={<MainPage />} />
<Route path="login" element={<LoginPage />} />
<Route path="shoppingDetail/:productId" element={<ShoppingDetail />} />
<Route path="shoppingCart" element={<ShoppingCart />} />
<Route path="healthCare" element={<HealthCare />} />

<Route path="payment" element={<Payment />} />
<Route path="paymentCancelList" element={<PaymentCancelList />}/>
<Route path="paymentEnd" element={<PaymentEnd />}/>
<Route path="paymentHistory" element={<PaymentHistory />}/>
<Route path="cancelpay" element={<CancelPay />}/>
<Route path="paymentlist" element={<PayListTest />}/>
<Route path="payment" element={<Payment />} />
<Route path="paymentCancelList" element={<PaymentCancelList />} />
<Route path="paymentEnd" element={<PaymentEnd />} />
<Route path="paymentHistory" element={<PaymentHistory />} />
<Route path="cancelpay" element={<CancelPay />} />
<Route path="paymentlist" element={<PayListTest />} />

<Route path="nanumList" element={<Outlet />}>
<Route index element={<NanumList />} />
<Route path="write" element={<NanumWrite />} />
<Route path="detail/:no" element={<NanumDetail />} />
</Route>
<Route path="nanumList" element={<Outlet />}>
<Route index element={<NanumList />} />
<Route path="write" element={<NanumWrite />} />
<Route path="detail/:no" element={<NanumDetail />} />
</Route>

<Route path="community" element={<Outlet />}>
<Route index element={<CommunityList />} />
<Route path="write" element={<ComunityWrite />} />
<Route path="detail/:no" element={<CommunityDetail />} />
</Route>
<Route path="community" element={<Outlet />}>
<Route index element={<CommunityList />} />
<Route path="write" element={<ComunityWrite />} />
<Route path="detail/:no" element={<CommunityDetail />} />
</Route>

<Route path="userRegister/:userId" element={<UserRegisterPage />} />
<Route path="petRegister" element={<PetRegisterPage />} />
<Route path="userRegister/:userId" element={<UserRegisterPage />} />
<Route path="petRegister" element={<PetRegisterPage />} />

<Route path="walking" element={<WalkPage />}>
<Route path="map" element={<WalkMapPage />} />
<Route path="journal" element={<WalkJournalPage />} />
</Route>

<Route path="myPage" element={<Outlet />}>
<Route index element={<MyPage />} />
<Route path="editPetRegister" element={<PetEditPage />} />
<Route path="editUserRegister" element={<UserEditPage />} />
<Route path="missingSave" element={<RegisterMissingSavePage />} />
<Route path="missingRegister" element={<RegisterMissing />} />
</Route>
<Route path="walking" element={<WalkPage />}>
<Route path="map" element={<WalkMapPage />} />
<Route path="journal" element={<WalkJournalPage />} />
</Route>

</Route>
</Routes>
<Footer />
<Route path="myPage" element={<Outlet />}>
<Route index element={<MyPage />} />
<Route path="editPetRegister" element={<PetEditPage />} />
<Route path="editUserRegister" element={<UserEditPage />} />
<Route path="missingSave" element={<RegisterMissingSavePage />} />
<Route path="missingRegister" element={<RegisterMissing />} />
</Route>
</Route>
</Routes>
<Footer />
</CartProvider>
</BrowserRouter>
);
}
function NavSelector() {
const location = useLocation();
const path = location.pathname;

if (path === '/') {
return <MainNav />;
}

const navPaths = [
"/shoppingDetail",
"/nanumList/write",
"/nanumList/detail",
"/myPage",
'/shoppingDetail',
'/shoppingCart',
'/payment',
'/nanumList/write',
'/nanumList',
'/nanumDetail',
'/healthCare',
'/walking',
'/walkingRecord',
'/community',
'/communityDetail',
'/communityWrite',
'/myPage/editUserRegister',
'/myPage/editPetRegister',
'/myPage/missingRegister',
'/myPage/missingSave',
'/myPage',
'/orderList/orderDetail/orderCancel',
'/orderList/orderDetail',
'/orderList',
'/alert',
];
const isNavPath = navPaths.some((navPath) => path.startsWith(navPath));
const isNavPath = navPaths.some(navPath => path.startsWith(navPath));

return isNavPath ? <SideNav /> : <MainNav />;
}
export default Router;
export default Router;
93 changes: 47 additions & 46 deletions src/components/Images.jsx
Original file line number Diff line number Diff line change
@@ -1,59 +1,60 @@
/*
불러올 때
import { images } from '현재 경로에서 images.jsx 있는경로';
<img src={images.cameraIcon} alt="카메라아이콘" />
*/
export const images = {
// common
cameraIcon: "/images/common/cameraIcon.svg",
loginDogCat: "/images/common/loginDogCat.svg",
logo: "/images/common/logo.svg",
paw: "/images/common/paw.svg",
cancel: "/images/common/cancelButton.svg",
cameraIcon: '/images/common/cameraIcon.svg',
loginDogCat: '/images/common/loginDogCat.svg',
logo: '/images/common/logo.svg',
cancel: '/images/common/cancelButton.svg',

// community
categoryAll: "/images/community/categoryAll.svg",
categoryAnonymous: "/images/community/categoryAnonymous.svg",
categoryDongNea: "/images/community/categoryDongNea.svg",
categoryEvent: "/images/community/categoryEvent.svg",
categoryExport: "/images/community/categoryExport.svg",
categoryFreedom: "/images/community/categoryFreedom.svg",
categoryAll: '/images/community/categoryAll.svg',
categoryAnonymous: '/images/community/categoryAnonymous.svg',
categoryDongNea: '/images/community/categoryDongNea.svg',
categoryEvent: '/images/community/categoryEvent.svg',
categoryExport: '/images/community/categoryExport.svg',
categoryFreedom: '/images/community/categoryFreedom.svg',

// credit
kakaoIcon: "/images/credit/kakaoIcon.svg",
naverPayLogo: "/images/credit/naverPayLogo.svg",
tossLogo: "/images/credit/tossLogo.svg",
kakaoIcon: '/images/credit/kakaoIcon.svg',
naverPayLogo: '/images/credit/naverPayLogo.svg',
tossLogo: '/images/credit/tossLogo.svg',

// footer
communityIconOff: "/images/footer/communityIconOff.svg",
communityIconOn: "/images/footer/communityIconOn.svg",
dogWalkingOff: "/images/footer/dogWalkingOff.svg",
dogWalkingOn: "/images/footer/dogWalkingOn.svg",
home: "/images/footer/home.svg",
communityIconOff: '/images/footer/communityIconOff.svg',
communityIconOn: '/images/footer/communityIconOn.svg',
dogWalkingOff: '/images/footer/dogWalkingOff.svg',
dogWalkingOn: '/images/footer/dogWalkingOn.svg',
home: '/images/footer/home.svg',

// mypage
alert: "/images/myPage/alert.svg",
blockHand: "/images/myPage/blockHand.svg",
bogwan: "/images/myPage/bogwan.svg",
calendar: "/images/myPage/calendar.svg",
hide: "/images/myPage/hide.svg",
imseeJeojang: "/images/myPage/imseeJeojang.svg",
myActivity: "/images/myPage/myActivity.svg",
bag: "/images/myPage/bag.svg",
calendar: "/images/myPage/calendar.svg",
coupon: "/images/myPage/coupon.svg",
missing: "/images/myPage/missing.svg",
paw: "/images/myPage/paw.svg",
point:"/images/myPage/point.svg",
review:"/images/myPage/review.svg",


alert: '/images/myPage/alert.svg',
blockHand: '/images/myPage/blockHand.svg',
bogwan: '/images/myPage/bogwan.svg',
calendar: '/images/myPage/calendar.svg',
hide: '/images/myPage/hide.svg',
imseeJeojang: '/images/myPage/imseeJeojang.svg',
myActivity: '/images/myPage/myActivity.svg',
bag: '/images/myPage/bag.svg',
coupon: '/images/myPage/coupon.svg',
missing: '/images/myPage/missing.svg',
paw: '/images/myPage/paw.svg',
point: '/images/myPage/point.svg',
review: '/images/myPage/review.svg',

// walk
walkMap: "/images/walk/walkMap.svg",
walkStopWatch: "/images/walk/walkStopWatch.svg",
walkAnimation: "/images/walk/walkHeader.json",
missingPet: "/images/walk/missingPet.svg",
walkingTime: "/images/walk/walkingTime.svg",
walkingDistance: "/images/walk/walkingDistance.svg",
walkMap: '/images/walk/walkMap.svg',
walkStopWatch: '/images/walk/walkStopWatch.svg',
walkAnimation: '/images/walk/walkHeader.json',
missingPet: '/images/walk/missingPet.svg',
walkingTime: '/images/walk/walkingTime.svg',
walkingDistance: '/images/walk/walkingDistance.svg',

// carousel
carouselImage1: '/images/carousel/carouselImage1.svg',
carouselImage2: '/images/carousel/carouselImage2.svg',
carouselImage3: '/images/carousel/carouselImage3.svg',
carouselImage4: '/images/carousel/carouselImage4.svg',
carouselImage5: '/images/carousel/carouselImage5.svg',
carouselImage6: '/images/carousel/carouselImage6.svg',
carouselImage7: '/images/carousel/carouselImage7.svg',
carouselImage8: '/images/carousel/carouselImage8.svg',
};
Loading

0 comments on commit 0df27d9

Please sign in to comment.