Skip to content

Commit

Permalink
fix: Hot fix (#321)
Browse files Browse the repository at this point in the history
* fix: scheduleDrawer createFooter 동작 오류 해결

* refactor: scheduleDrawer template badge 디자인 수정

* fix: scheduleDrawer open 시 템플릿 초기화

* fix: TodayButton bottom position 수정

* fix: 일정 수정 오류 해결

* fix: 선택 일정만 수정, 삭제 적용

* fix: inputMode numeric setting

* refactor: remove base url

* refactor: add main page error handler

* refactor: remove unused path of mockServiceWorker

* refactor: apply ScheduleListPage error handler

* docs: update readme
  • Loading branch information
soyoung125 authored Sep 23, 2024
1 parent c57953c commit 4d697c1
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 17 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 💸 핀더펜 (Financial The Penny)

### [웹에서 데모버전 확인하기](https://soyoung125.github.io/fin-the-pen-web/)
### [웹에서 데모버전 확인하기](https://fin-the-pen-web-demo.vercel.app/)

### [배포 페이지 바로가기](https://d2vl90cpkqpz2m.cloudfront.net/)
### [배포 페이지 바로가기](https://fin-the-pen.vercel.app/)

#### [Storybook](https://645bb0d7fab3ee51343325b9-wqmzcooqxa.chromatic.com/)

Expand Down
2 changes: 1 addition & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function main() {
if (import.meta.env.VITE_LOCAL_MODE !== "true") {
await worker.start({
serviceWorker: {
url: "/fin-the-pen-web/mockServiceWorker.js",
url: "/mockServiceWorker.js",
},
onUnhandledRequest: "bypass",
});
Expand Down
28 changes: 14 additions & 14 deletions src/pages/Home/pages/ScheduleListPage/ScheduleListPage.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
import React, { useEffect, useRef, useState } from "react";
import ScheduleListPageHeader from "components/ScheduleList/ScheduleListPageHeader";
import useHome from "@hooks/useHome.ts";
import moment from "moment";
import { Box, Stack } from "@mui/material";
import SummaryCard from "@pages/Home/next-components/HomeHeader/MonthlyBudgetSummary/SummaryCard";
import { Box } from "@mui/material";
import useHeader from "@hooks/useHeader.ts";
import ScheduleListHeader from "components/ScheduleList/ScheduleListHeader";
import React, { useEffect, useRef, useState } from "react";
import ScheduleList from "@components/ScheduleList";
import TodayButton from "@components/common/TodayButton/TodayButton.tsx";
import FilterDrawer from "@components/layouts/common/TopBar/buttons/FilterButton/FilterDrawer.tsx";
import useMonthSchedule from "@hooks/home/useMonthSchedule.ts";
import MonthlySummary from "@pages/Home/pages/ScheduleListPage/components/MonthlySummary/MonthlySummary.tsx";

function ScheduleListPage() {
useHeader(false);
const options = ["최신순", "과거순"];
const todayRef = useRef<HTMLDivElement>(null);

const { date, subtractMonth, addMonth, pickMonth } = useHome();
const { monthData: data, monthSchedules, isPending } = useMonthSchedule();
const {
monthData: data,
monthSchedules,
isPending,
isError,
} = useMonthSchedule();

const [selectedOption, setSelectedOption] = useState(options[0]);
const [scheduleDates, setScheduleDates] = useState<string[]>([]);
Expand Down Expand Up @@ -69,16 +74,11 @@ function ScheduleListPage() {
changeMonth={pickMonth}
/>

<Stack
py={3}
px={2.5}
spacing="6px"
bgcolor="primary.main"
sx={{ color: "#FFF" }}
>
<SummaryCard title="수입" amount={parseInt(data?.income ?? "")} />
<SummaryCard title="지출" amount={parseInt(data?.expense ?? "")} />
</Stack>
<MonthlySummary
isError={isError}
income={parseInt(data?.income ?? "")}
expense={parseInt(data?.expense ?? "")}
/>

<Box
sx={{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import SummaryCard from "@pages/Home/next-components/HomeHeader/MonthlyBudgetSummary/SummaryCard";
import { Stack } from "@mui/material";
import React from "react";

interface MonthlySummaryProps {
income: number;
expense: number;
isError: boolean;
}

function MonthlySummary({ isError, expense, income }: MonthlySummaryProps) {
if (isError) {
return (
<Stack
py={3}
px={2.5}
spacing="6px"
bgcolor="primary.main"
sx={{ color: "#FFF" }}
>
<SummaryCard title="수입" amount={0} />
<SummaryCard title="지출" amount={0} />
</Stack>
);
}

return (
<Stack
py={3}
px={2.5}
spacing="6px"
bgcolor="primary.main"
sx={{ color: "#FFF" }}
>
<SummaryCard title="수입" amount={income} />
<SummaryCard title="지출" amount={expense} />
</Stack>
);
}

export default MonthlySummary;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as MonthlySummary } from "./MonthlySummary";

0 comments on commit 4d697c1

Please sign in to comment.