Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: design qa #367

Merged
merged 6 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/app/tanstack-query/schedules/useCreateSchedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { DOMAIN } from "@api/url";
import { getCookie } from "@app/utils/storage";
import {
QUERY_KEY_REGULAR_ASSET,
QUERY_KEY_REPORT,
QUERY_KEY_SCHEDULES,
} from "@constants/queryKeys";
import { getPriceType } from "@components/ScheduleDrawer/hooks/useScheduleForm";
Expand Down Expand Up @@ -36,6 +37,9 @@ export const useCreateSchedule = () => {
queryClient.invalidateQueries({
queryKey: [QUERY_KEY_SCHEDULES, date.format("YYYY-MM")],
});
queryClient.invalidateQueries({
queryKey: [QUERY_KEY_REPORT, date.format("YYYY-MM")],
});

if (variables.repeat.kind_type !== "none") {
queryClient.invalidateQueries({
Expand Down
2 changes: 1 addition & 1 deletion src/app/utils/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const getCookie = (name: string): string | undefined => {

export const setCookie = (name: string, value?: string) => {
if (value) {
document.cookie = name + "=" + value + ";max-age=600";
document.cookie = name + "=" + value + ";max-age=600000";
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function Input({
style: { textAlign: "center" },
min: min ?? 1,
max: max,
inputMode: "numeric",
}}
/>
</FormControl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function InputLabel({
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const { value, max } = e.target;
let newValue = value;
if (!Number(newValue)) return;
if (isNaN(Number(newValue))) return;
if (Number(newValue) > Number(max)) newValue = max;
handleUpdate(newValue);
};
Expand All @@ -39,6 +39,7 @@ function InputLabel({
min: 1,
max: max,
style: { textAlign: "center" },
inputMode: "numeric",
}}
sx={{
width: "30px",
Expand Down
9 changes: 4 additions & 5 deletions src/components/fetchPaymentHistory/PeriodInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import {
PickersDayProps,
koKR,
} from "@mui/x-date-pickers";
import { InputAdornment, TextField, Grid } from "@mui/material";
import { InputAdornment, TextField } from "@mui/material";
import Grid from "@mui/material/Grid2";
import moment from "moment";
import CalendarTodayOutlinedIcon from "@mui/icons-material/CalendarTodayOutlined";
import { AdapterMoment } from "@mui/x-date-pickers/AdapterMoment";
import InputGrid from "./InputGrid";
import "moment/locale/zh-cn";
import { useState } from "react";
import { AdapterMoment } from "@mui/x-date-pickers/AdapterMoment";

interface PeriodInputProps {
startDate: string;
Expand Down Expand Up @@ -74,10 +74,9 @@ function PeriodInput({ startDate, endDate, changeDate }: PeriodInputProps) {

return (
<InputGrid title="조회기간">
<Grid xs item>
<Grid>
<LocalizationProvider
dateAdapter={AdapterMoment}
adapterLocale="zh-cn"
localeText={
koKR.components.MuiLocalizationProvider.defaultProps.localeText
}
Expand Down
15 changes: 6 additions & 9 deletions src/components/providers/CustomThemeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useSelector } from "react-redux";
import { selectIsDarkMode } from "@redux/slices/settingSlice.ts";
import { darkThemeOptions, lightThemeOptions } from "@app/theme.ts";
import { koKR } from "@mui/material/locale";
import "moment/locale/ko";

/**
* 다크모드 외에도 여러 가지 추가 설정이 올 수 있을것으로 기대하는 Wrapper Component
Expand All @@ -14,16 +15,12 @@ interface CustomThemeProviderProps {

function CustomThemeProvider({ children }: CustomThemeProviderProps) {
const isDarkMode: boolean = useSelector(selectIsDarkMode);
return (
<ThemeProvider
theme={createTheme(
isDarkMode ? darkThemeOptions : lightThemeOptions,
koKR
)}
>
{children}
</ThemeProvider>
const theme = createTheme(
isDarkMode ? darkThemeOptions : lightThemeOptions,
koKR
);

return <ThemeProvider theme={theme}>{children}</ThemeProvider>;
}

export default CustomThemeProvider;
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { useEffect, useRef, useState } from "react";
import { useAppDispatch } from "@redux/hooks.ts";
import RoundedBorderBox from "@components/common/RoundedBorderBox.tsx";
import moment from "moment";
import "moment/locale/ko";
import { Schedule } from "@app/types/schedule.ts";
import useSchedule from "@hooks/schedule/useSchedule.ts";
import { fetchFindSchedules } from "@api/API.ts";
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Start/components/SocialLogin/SocialLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ interface SocialLoginProps {
const SOCIAL_LOGIN: SocialLoginStateType = {
kakao: {
image: "/icons/socialLogin/kakao.svg",
path: `http://localhost:8080/login/kakao`,
path: `${import.meta.env.VITE_LOCAL_DOMAIN}/login/kakao`,
},
naver: {
image: "/icons/socialLogin/btnG_아이콘사각.png",
path: `http://localhost:8080/login/naver`,
path: `${import.meta.env.VITE_LOCAL_DOMAIN}/login/naver`,
},
};

Expand Down