Skip to content

Commit

Permalink
rfactor: 기타 수정 진행
Browse files Browse the repository at this point in the history
- 사용하지 않는 model 삭제
- 상수명 변경
- 주석 삭제
  • Loading branch information
junghaesung79 committed Jun 27, 2024
1 parent ecf68cc commit a96917a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/layout/Header/MobilePanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import MenuIcon from 'assets/svg/common/hamburger-menu.svg?react';
import MobileLogoIcon from 'assets/svg/common/mobile-koin-logo.svg?react';
import useMediaQuery from 'hooks/useMediaQuery';
import useMobileSidebar from 'layout/Header/hooks/useMobileSidebar';
import { CATEGORY_COOP, HeaderCategory } from 'models/headerCategory';
import { HEADER_CATEGORY, HeaderCategory } from 'models/headerCategory';
import { useCoopMe, useLogout } from 'query/auth';
import cn from 'utils/className';

Expand Down Expand Up @@ -68,7 +68,7 @@ export default function MobilePanel() {
<span className={styles['mobile-header__title']}>
{pathname === '/' ? (
<MobileLogoIcon title="코인 로고" />
) : (CATEGORY_COOP
) : (HEADER_CATEGORY
.flatMap((categoryValue) => categoryValue.submenu)
.find((subMenuValue) => subMenuValue.link === pathname)
?.title ?? ''
Expand Down Expand Up @@ -122,7 +122,7 @@ export default function MobilePanel() {
</ul>
</div>

{CATEGORY_COOP.map((category: HeaderCategory) => (
{HEADER_CATEGORY.map((category: HeaderCategory) => (
<PanelContent
key={category.title}
hideSidebar={hideSidebar}
Expand Down
4 changes: 2 additions & 2 deletions src/layout/Header/PCPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Link } from 'react-router-dom';

import LogoIcon from 'assets/svg/common/koin-logo.svg?react';
import useMegaMenu from 'layout/Header/hooks/useMegaMenu';
import { CATEGORY_COOP, HeaderCategory } from 'models/headerCategory';
import { HEADER_CATEGORY, HeaderCategory } from 'models/headerCategory';
import { useLogout } from 'query/auth';
import cn from 'utils/className';

Expand Down Expand Up @@ -94,7 +94,7 @@ export default function PCPanel() {
>
<LogoIcon title="코인 로고" />
</Link>
<HeaderContent categoryArray={CATEGORY_COOP} />
<HeaderContent categoryArray={HEADER_CATEGORY} />

<ul className={styles['header__auth-menu']}>
<li className={styles['header__auth-link']}>
Expand Down
7 changes: 0 additions & 7 deletions src/models/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ export const CoopMeResponse = z.object({

export type CoopMeResponse = z.infer<typeof CoopMeResponse>;

export const UserStorageInSession = z.object({
isAuthenticated: z.boolean(),
user: CoopMeResponse.nullable(),
});

export type UserStorageInSession = z.infer<typeof UserStorageInSession>;

export const LoginParams = z.object({
email: z.string(),
password: z.string(),
Expand Down
2 changes: 1 addition & 1 deletion src/models/headerCategory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface HeaderCategory {
submenu: SubMenu[]
}

export const CATEGORY_COOP: HeaderCategory[] = [
export const HEADER_CATEGORY: HeaderCategory[] = [
{
title: '식단관리',
planFlag: true,
Expand Down
1 change: 0 additions & 1 deletion src/utils/operate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export const getDiningTypeOnTime = (): DiningType => {
return 'DINNER'; // 15:01~24:00
};

// date = 'yyMMdd'
export const getIsOperating = (selectedDiningType: DiningType, date: string) => {
const today = dayjs().format('YYMMDD');
const now = new Date();
Expand Down

0 comments on commit a96917a

Please sign in to comment.