-
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.
deploy: 드라이버 수익 관리 & 관리자 기본 기능 (#81)
드라이버 수익 관리 & 관리자 기본 기능
- Loading branch information
Showing
121 changed files
with
4,951 additions
and
72 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,12 @@ | ||
import { GET } from "../utils/axios"; | ||
|
||
export const getPartyList = async (status) => | ||
await GET(`/admin/party?status=${status}`, true); | ||
|
||
export const getPartyDetail = async (partyId) => | ||
await GET(`/admin/party/${partyId}`, true); | ||
|
||
export const getPartyDriverReady = async (partyId, ready) => | ||
await GET(`/admin/party/driver-ready/${partyId}?ready=${ready}`, true); | ||
|
||
export const getUserListAdmin = async () => await GET("/admin/user/list", true); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { GET } from "../utils/axios"; | ||
|
||
export const getDriverMonthlyIncome = async (month) => | ||
await GET(`/income/monthly?month=${month}`, true); |
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,15 @@ | ||
import { GET, POST, PUT, DELETE } from "../utils/axios"; | ||
|
||
export const getPartyRegionList = async () => await GET("/party/region"); | ||
|
||
export const postNewPartyRegion = async (body) => | ||
await POST("/party/region", body, true); | ||
|
||
export const putPartyRegion = async (partyRegionId, body) => | ||
await PUT(`/party/region/${partyRegionId}`, body, true); | ||
|
||
export const deletePartyRegion = async (partyRegionId) => | ||
await DELETE(`/party/region/${partyRegionId}`, true); | ||
|
||
export const getPartyRegionDriverList = async (partyRegionId) => | ||
await GET(`/party/region/${partyRegionId}`, true); |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,29 @@ | ||
import { useState } from "react"; | ||
|
||
function TabList({ tabList, changeTab }) { | ||
const [current, setCurrent] = useState(0); | ||
|
||
const rounded = (index, maxIndex) => { | ||
if (index === 0) return "rounded-l-xl"; | ||
if (index === maxIndex) return "rounded-r-xl"; | ||
}; | ||
|
||
return ( | ||
<div className="flex justify-between w-full min-w-[32rem] my-12"> | ||
{tabList.map((item, index) => ( | ||
<button | ||
key={index} | ||
className={`flex justify-center whitespace-nowrap border border-primary w-full p-3 font-semibold text-lg ${rounded(index, tabList.length - 1)} ${index === current ? "bg-primary text-white" : "text-primary"}`} | ||
onClick={() => { | ||
setCurrent(index); | ||
changeTab(index); | ||
}} | ||
> | ||
{item.name} | ||
</button> | ||
))} | ||
</div> | ||
); | ||
} | ||
|
||
export default TabList; |
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,30 @@ | ||
function Table({ columns, data }) { | ||
return ( | ||
<div className="flex flex-col w-full min-w-[32rem]"> | ||
<div className="flex w-full px-5 py-3 items-center justify-center bg-[#EAF4FF] rounded-xl mb-2 text-sm text-[#313033]"> | ||
{columns.map((item, index) => ( | ||
<div key={index} className={index === 1 ? "flex-1" : "w-[25%]"}> | ||
{item} | ||
</div> | ||
))} | ||
</div> | ||
{data.map((item, index) => ( | ||
<div | ||
key={index} | ||
className="flex w-full px-5 py-3 h-10 border border-solid border-[#EFEFEF] rounded-xl mb-2 text-sm" | ||
> | ||
{item.map((it, id) => ( | ||
<div | ||
key={id} | ||
className={`${id === 2 ? "text-primary" : "text-[#939094]"} ${id === 1 ? "flex-1 text-[#313033]" : "w-[25%]"} min-w-fit`} | ||
> | ||
{it} | ||
</div> | ||
))} | ||
</div> | ||
))} | ||
</div> | ||
); | ||
} | ||
|
||
export default Table; |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function Title({ title }) { | ||
return <p className="text-2xl text-black font-bold">{title}</p>; | ||
} | ||
|
||
export default Title; |
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,59 @@ | ||
import { useNavigate } from "react-router"; | ||
|
||
function HomeBodyForm({ name, child }) { | ||
const navigate = useNavigate(); | ||
|
||
if (name === "KPI" || name === "총 수익" || name === "결제 내역 확인") | ||
return null; | ||
return ( | ||
<div className="flex flex-col mt-16 first:mt-0"> | ||
<div className="text-[#000] text-2xl font-bold mb-5">{name}</div> | ||
<div className="flex"> | ||
{name === "관리자 홈" && ( | ||
<div className="flex"> | ||
<button | ||
onClick={() => { | ||
navigate(`/admin/kpi`); | ||
}} | ||
className="flex min-w-fit w-28 px-5 py-3 mr-4 justify-center items-center gap-2 rounded-lg border-solid border border-[#D9D9D9] hover:border-primary text-[#3E3E3E] text-sm font-semibold" | ||
> | ||
KPI | ||
</button> | ||
<button | ||
className="flex min-w-fit w-28 px-5 py-3 mr-4 justify-center items-center gap-2 rounded-lg border-solid border border-[#D9D9D9] hover:border-primary text-[#3E3E3E] text-sm font-semibold" | ||
onClick={() => { | ||
navigate(`/admin/profit`); | ||
}} | ||
> | ||
총 수익 | ||
</button> | ||
<button | ||
className="flex min-w-fit w-28 px-5 py-3 mr-4 justify-center items-center gap-2 rounded-lg border-solid border border-[#D9D9D9] hover:border-primary text-[#3E3E3E] text-sm font-semibold" | ||
onClick={() => { | ||
navigate(`/admin/payment`); | ||
}} | ||
> | ||
결제 내역 확인 | ||
</button> | ||
</div> | ||
)} | ||
{child && | ||
child.map((item, index) => ( | ||
<button | ||
key={index} | ||
className="flex w-28 min-w-fit px-5 py-3 mr-4 justify-center items-center gap-2 rounded-lg border-solid border border-[#D9D9D9] hover:border-primary text-[#3E3E3E] text-sm font-semibold" | ||
onClick={() => { | ||
if (item.id === "community") navigate("/community/main"); | ||
else if (item.id === "inquiry") navigate("/talk"); | ||
else navigate(`/admin/${item.id}`); | ||
}} | ||
> | ||
<div className="text-sm font-semibold">{item.name}</div> | ||
</button> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default HomeBodyForm; |
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,13 @@ | ||
import HomeBodyForm from "./HomeBodyForm"; | ||
|
||
function AdminHome({ menuList }) { | ||
return ( | ||
<div> | ||
{menuList.map((item) => ( | ||
<HomeBodyForm key={item.id} {...item} /> | ||
))} | ||
</div> | ||
); | ||
} | ||
|
||
export default AdminHome; |
Oops, something went wrong.