-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
695 additions
and
394 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Dispatch, memo, SetStateAction } from "react"; | ||
import clsx from "clsx"; | ||
|
||
interface Props { | ||
tab: number; | ||
setTab: Dispatch<SetStateAction<number>>; | ||
} | ||
|
||
function DriverTab({ tab, setTab }: Props) { | ||
return ( | ||
<div className="w-full grid grid-cols-3 rounded-lg"> | ||
<button | ||
className={clsx( | ||
"h-12 rounded-l-lg border border-primary text-sm font-semibold transition-all duration-300", | ||
tab === 0 ? "text-white bg-primary" : "text-primary bg-white" | ||
)} | ||
onClick={() => setTab(0)} | ||
> | ||
예약된 파티 | ||
</button> | ||
<button | ||
className={clsx( | ||
"h-12 border-y border-primary text-sm font-semibold transition-all duration-300", | ||
tab === 1 ? "text-white bg-primary" : "text-primary bg-white" | ||
)} | ||
onClick={() => setTab(1)} | ||
> | ||
가입된 파티 | ||
</button> | ||
<button | ||
className={clsx( | ||
"h-12 rounded-r-lg border border-primary text-sm font-semibold transition-all duration-300", | ||
tab === 2 ? "text-white bg-primary" : "text-primary bg-white" | ||
)} | ||
onClick={() => setTab(2)} | ||
> | ||
새로운 파티 승인 대기 | ||
</button> | ||
</div> | ||
); | ||
} | ||
|
||
export default memo(DriverTab); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Dispatch, memo, SetStateAction } from "react"; | ||
import { useSelector } from "react-redux"; | ||
import { RootState } from "../../../redux/store"; | ||
import clsx from "clsx"; | ||
|
||
interface Props { | ||
driverMenu: "driver" | "user"; | ||
setDriverMenu: Dispatch<SetStateAction<"driver" | "user">>; | ||
} | ||
|
||
function DriverMenu({ driverMenu, setDriverMenu }: Props) { | ||
const user = useSelector((state: RootState) => state.user); | ||
|
||
if (user.role !== "ROLE_DRIVER") return null; | ||
return ( | ||
<div className="flex justify-start gap-6 mb-6 max-w-screen-xl mx-auto px-2 md:px-5"> | ||
<button | ||
className={clsx( | ||
"text-2xl font-bold transition-all duration-500", | ||
driverMenu === "driver" ? "text-gray800" : "text-gray400" | ||
)} | ||
onClick={() => setDriverMenu("driver")} | ||
> | ||
드라이버 홈 | ||
</button> | ||
<button | ||
className={clsx( | ||
"text-2xl font-bold transition-all duration-500", | ||
driverMenu === "user" ? "text-gray800" : "text-gray400" | ||
)} | ||
onClick={() => setDriverMenu("user")} | ||
> | ||
여행자 홈 | ||
</button> | ||
</div> | ||
); | ||
} | ||
|
||
export default memo(DriverMenu); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Dispatch, memo, SetStateAction } from "react"; | ||
import clsx from "clsx"; | ||
|
||
interface Props { | ||
tab: number; | ||
setTab: Dispatch<SetStateAction<number>>; | ||
} | ||
|
||
function UserTab({ tab, setTab }: Props) { | ||
return ( | ||
<div className="w-full grid grid-cols-3 rounded-lg"> | ||
<button | ||
className={clsx( | ||
"h-12 rounded-l-lg border border-primary text-sm font-semibold transition-all duration-300", | ||
tab === 0 ? "text-white bg-primary" : "text-primary bg-white" | ||
)} | ||
onClick={() => setTab(0)} | ||
> | ||
예약된 파티 | ||
</button> | ||
<button | ||
className={clsx( | ||
"h-12 border-y border-primary text-sm font-semibold transition-all duration-300", | ||
tab === 1 ? "text-white bg-primary" : "text-primary bg-white" | ||
)} | ||
onClick={() => setTab(1)} | ||
> | ||
가입된 파티 | ||
</button> | ||
<button | ||
className={clsx( | ||
"h-12 rounded-r-lg border border-primary text-sm font-semibold transition-all duration-300", | ||
tab === 2 ? "text-white bg-primary" : "text-primary bg-white" | ||
)} | ||
onClick={() => setTab(2)} | ||
> | ||
새로운 파티 신청 | ||
</button> | ||
</div> | ||
); | ||
} | ||
|
||
export default memo(UserTab); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.