-
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.
Merge pull request #79 from Duri-Salon/feat(salon)/statistics-page
[feat] 매출 통계 훅 구현, Income 페이지에 데이터 로드, 메인헤더 로그인 문구 변경
- Loading branch information
Showing
30 changed files
with
393 additions
and
94 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,11 +1,8 @@ | ||
export async function enableMocking() { | ||
console.log(import.meta.env.VITE_MSW_ENABLED); | ||
if (import.meta.env.VITE_MSW_ENABLED === 'true') { | ||
const { worker } = await import('./browser'); | ||
return await worker.start({ | ||
onUnhandledRequest: 'bypass', | ||
}); | ||
} else { | ||
console.log('MSW is disabled'); | ||
} | ||
} |
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
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,14 @@ | ||
import { IncomeMonthListType } from '@duri-fe/utils/src/apis/types/income'; | ||
|
||
interface MonthIncomeStatisticProps { | ||
beforeRatio: number; //전월대비 증감 | ||
incomeMonthList: IncomeMonthListType[]; //최근 5달 매출 리스트 | ||
} | ||
|
||
export const MonthIncomeStatistic = ({ | ||
beforeRatio, | ||
incomeMonthList, | ||
}: MonthIncomeStatisticProps) => { | ||
console.log(incomeMonthList, beforeRatio); | ||
return <div>MonthIncomeStatistic</div>; | ||
}; |
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,28 @@ | ||
interface PetStatisticProps { | ||
agePetStatistic?: { | ||
standard: string; | ||
ratio: number; | ||
count: number; | ||
}[]; | ||
|
||
diseasePetStatistic?: { | ||
standard: string; | ||
ratio: number; | ||
count: number; | ||
}[]; | ||
|
||
characterPetStatistic?: { | ||
standard: string; | ||
ratio: number; | ||
count: number; | ||
}[]; | ||
} | ||
|
||
export const PetStatistic = ({ | ||
agePetStatistic, | ||
characterPetStatistic, | ||
diseasePetStatistic, | ||
}: PetStatisticProps) => { | ||
console.log(agePetStatistic, diseasePetStatistic, characterPetStatistic); | ||
return <div>PetStatistic</div>; | ||
}; |
16 changes: 16 additions & 0 deletions
16
apps/salon/src/components/income/RecentIncomeStatistic.tsx
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,16 @@ | ||
import { IncomeMonthListType } from '@duri-fe/utils/src/apis/types/income'; | ||
|
||
interface RecentIncomeStatisticProps { | ||
incomeMonthList: IncomeMonthListType[]; //선택, 이전, 이번달 매출 리스트 | ||
beforeRatio: number; //전월 대비 증감 | ||
nowRatio: number; //이번달 대비 증감 | ||
} | ||
|
||
export const RecentIncomeStatistic = ({ | ||
incomeMonthList, | ||
beforeRatio, | ||
nowRatio, | ||
}: RecentIncomeStatisticProps) => { | ||
console.log(incomeMonthList, beforeRatio, nowRatio); | ||
return <div>RecentIncomeStatistic</div>; | ||
}; |
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 |
---|---|---|
@@ -1,10 +1,6 @@ | ||
export async function enableMocking() { | ||
console.log(import.meta.env.VITE_MSW_ENABLED) | ||
if (import.meta.env.VITE_MSW_ENABLED === 'true') { | ||
const { worker } = await import('./browser'); | ||
return await worker.start(); | ||
} | ||
else { | ||
console.log('MSW is disabled'); | ||
} | ||
} | ||
if (import.meta.env.VITE_MSW_ENABLED === 'true') { | ||
const { worker } = await import('./browser'); | ||
return await worker.start(); | ||
} | ||
} |
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,58 @@ | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import { Header, MobileLayout, SalonNavbar } from '@duri-fe/ui'; | ||
import { | ||
useGetAgeStatistic, | ||
useGetCharacterStatistic, | ||
useGetDiseaseStatistic, | ||
useGetSelectedMonthIncome, | ||
useGetThisMonthIncome, | ||
} from '@duri-fe/utils'; | ||
import { MonthIncomeStatistic } from '@salon/components/income/MonthIncomeStatistic'; | ||
import { PetStatistic } from '@salon/components/income/PetStatistic'; | ||
import { RecentIncomeStatistic } from '@salon/components/income/RecentIncomeStatistic'; | ||
|
||
const IncomePage = () => { | ||
const navigate = useNavigate(); | ||
const handleClickBack = () => { | ||
navigate('/'); | ||
}; | ||
|
||
const { data: monthIncomeData } = useGetThisMonthIncome({}); | ||
const { data: selectedIncomeData } = useGetSelectedMonthIncome({ month: 12 }); | ||
const { data: agePetStatistic } = useGetAgeStatistic({}); | ||
const { data: diseasePetStatistic } = useGetDiseaseStatistic({}); | ||
const { data: characterPetStatistic } = useGetCharacterStatistic({}); | ||
|
||
return ( | ||
<MobileLayout> | ||
<Header | ||
title="매출" | ||
titleAlign="start" | ||
backIcon | ||
onClickBack={handleClickBack} | ||
/> | ||
{monthIncomeData && ( | ||
<MonthIncomeStatistic | ||
beforeRatio={monthIncomeData.beforeRatio} | ||
incomeMonthList={monthIncomeData.incomeMonthList} | ||
/> | ||
)} | ||
|
||
{selectedIncomeData && ( | ||
<RecentIncomeStatistic | ||
incomeMonthList={selectedIncomeData.incomeMonthList} | ||
beforeRatio={selectedIncomeData.beforeRatio} | ||
nowRatio={selectedIncomeData.nowRatio} | ||
/> | ||
)} | ||
{<PetStatistic | ||
agePetStatistic={agePetStatistic?.ageList} | ||
diseasePetStatistic={diseasePetStatistic?.diseaseList} | ||
characterPetStatistic={characterPetStatistic?.characterList} | ||
/>} | ||
<SalonNavbar /> | ||
</MobileLayout> | ||
); | ||
}; | ||
export default IncomePage; |
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
33 changes: 0 additions & 33 deletions
33
apps/salon/vite.config.ts.timestamp-1734462252624-4189b1039114a.mjs
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
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
Oops, something went wrong.