Skip to content

Commit

Permalink
Kyungwhan (#33)
Browse files Browse the repository at this point in the history
* fix

* fix

* fix

* fix

* feat: Modify for Inheritance

* feat: Move CashLog/me to mypage

* fix
  • Loading branch information
hagd0520 authored Feb 27, 2024
1 parent 2d03916 commit 92b5050
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 49 deletions.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions src/components/cashLog/tossPayments/Checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default function CheckOut({ price }) {
customerEmail: "[email protected]",
successUrl: `${window.location.origin}/success`,
failUrl: `${window.location.origin}/fail`,
_skipAuth: "FORCE_SUCCESS",
});
};

Expand Down
99 changes: 50 additions & 49 deletions src/components/mypage/LeftBar.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,56 @@
'use client'
"use client";

import {Avatar, Spacer} from '@nextui-org/react'
import {FaArrowRight, FaUserCircle} from 'react-icons/fa'
import React from 'react'
import Link from 'next/link'
import {usePathname} from 'next/navigation'
import { Avatar, Spacer } from "@nextui-org/react";
import { FaArrowRight, FaUserCircle } from "react-icons/fa";
import React from "react";
import Link from "next/link";
import { usePathname } from "next/navigation";

export default function LeftBar(props) {
const pathName = usePathname()
const pathName = usePathname();

const items = [
{text: '예약 내역', link: '/mypage/reservations'},
{text: '내 정보', link: '/mypage/info'},
{text: '결제 내역', link: '/cashLog/me'},
{text: '내가 등록한 숙소', link: '/mypage/hotels'},
{text: '내가 찜한 숙소', link: '/mypage/like'},
{text: '나의 리뷰', link: '/mypage/reviews'},
]
const items = [
{ text: "예약 내역", link: "/mypage/reservations" },
{ text: "내 정보", link: "/mypage/info" },
{ text: "결제 내역", link: "/mypage/cashLog" },
{ text: "내가 등록한 숙소", link: "/mypage/hotels" },
{ text: "내가 찜한 숙소", link: "/mypage/like" },
{ text: "나의 리뷰", link: "/mypage/reviews" },
];

return (
<div className='flex flex-col items-center w-1/4 bg-[#CECECE]'>
<Spacer y={5}/>
<div className={'text-2xl'}>마이페이지</div>
<Spacer y={5}/>
{props.user?.objData.imageUrl ? (
<Avatar src={props.user.objData.imageUrl} className={'w-44 h-44'}/>
) : (
<FaUserCircle size={100}/>
)}
<Spacer y={5}/>
<div className={'text-2xl'}>{props.user?.objData.nickname}</div>
<Spacer y={10}/>
<ul className={'flex flex-col w-full'}>
{items.map((item, index) => (
<Link href={item.link} key={`l-${index}`}>
<li
className={`w-full h-15 p-5 flex items-center ${
pathName === item.link
? 'bg-white'
: 'hover:cursor-pointer bg-[#898989]'
}`}>
{item.text}
{item.text === '캐시 사용 내역' && (
<div className={'ml-auto'}>
<FaArrowRight/>
</div>
)}
</li>
</Link>
))}
</ul>
</div>
)
return (
<div className="flex flex-col items-center w-1/4 bg-[#CECECE]">
<Spacer y={5} />
<div className={"text-2xl"}>마이페이지</div>
<Spacer y={5} />
{props.user?.objData.imageUrl ? (
<Avatar src={props.user.objData.imageUrl} className={"w-44 h-44"} />
) : (
<FaUserCircle size={100} />
)}
<Spacer y={5} />
<div className={"text-2xl"}>{props.user?.objData.nickname}</div>
<Spacer y={10} />
<ul className={"flex flex-col w-full"}>
{items.map((item, index) => (
<Link href={item.link} key={`l-${index}`}>
<li
className={`w-full h-15 p-5 flex items-center ${
pathName === item.link
? "bg-white"
: "hover:cursor-pointer bg-[#898989]"
}`}
>
{item.text}
{item.text === "캐시 사용 내역" && (
<div className={"ml-auto"}>
<FaArrowRight />
</div>
)}
</li>
</Link>
))}
</ul>
</div>
);
}

0 comments on commit 92b5050

Please sign in to comment.