Skip to content

Commit

Permalink
fix: 방 상세페이지 버그 수정 (#498)
Browse files Browse the repository at this point in the history
* refactor: 디렉토리 구조 정리 (#495)

* refactor: domain 디렉토리 정리

* refactor: MSW 관련 디렉토리 이동

* refactor: eslint import rule 수정

* fix: 방 상세페이지 날짜 오류 수정 (#497)

---------

Co-authored-by: SangHoon Lee <[email protected]>
  • Loading branch information
chasj0326 and bbearcookie authored Jan 3, 2024
1 parent d124a07 commit 7f07f22
Show file tree
Hide file tree
Showing 216 changed files with 112 additions and 112 deletions.
14 changes: 3 additions & 11 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"internal", // 리액트 내부와 밀접한 연관이 있는 패키지
"external", // 네트워크와 연관이 있는 패키지
"unknown", // 그 외의 경로 미지정된 서드파티 패키지
"object", // core or shared 디렉토리의 소스코드
"object", // core, shared, domain 디렉토리의 소스코드
"parent", // 부모 (../)
"sibling", // 형제 (./)
"index", // 현재 디렉토리
Expand Down Expand Up @@ -91,7 +91,7 @@
"group": "external"
},
/**
core or shared 디렉토리의 소스코드
core, shared, domain 디렉토리의 소스코드
*/
{
"pattern": "{@,.,..}/core/**",
Expand All @@ -102,16 +102,8 @@
"pattern": "{@,.,..}/shared/**",
"group": "object"
},
/**
도메인(domain) 디렉토리
*/
{
"pattern": "@/*/**", // 도메인 디렉토리에 들어 있는 각종 파일
"group": "object",
"position": "after"
},
{
"pattern": "@/*", // [domain] 디렉토리의 index.tsx 파일
"pattern": "{@,.,..}/domain/**",
"group": "object",
"position": "after"
},
Expand Down
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import timeOption from '@/core/api/options/time';
import getTimeRange from '@/core/utils/getTimeRange';
import { Navbar } from '@/shared/Navbar';
import { UnknownFallback } from '@/shared/ErrorBoundary';
import { AboutMoabam } from '@/AboutMoabam';
import { CommonMeta } from '@/Meta';
import { AboutMoabam } from '@/domain/AboutMoabam';
import { CommonMeta } from '@/domain/Meta';
import 'swiper/css';
import 'swiper/css/bundle';

Expand Down
8 changes: 0 additions & 8 deletions src/RoomSearch/index.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useQuery } from '@tanstack/react-query';
import { roomOptions } from '@/core/api/options';
import RoomDetailContainer from '@/RoomDetail/components/RoomDetailContainer';
import { RoomNotice } from '@/RoomDetail';
import { RoomDetailMeta } from '@/Meta';
import RoomDetailContainer from '@/domain/RoomDetail/components/RoomDetailContainer';
import { RoomNotice } from '@/domain/RoomDetail';
import { RoomDetailMeta } from '@/domain/Meta';
import RoomHeader from './RoomHeader';
import RoomDetailProvider from './RoomDetailProvider';
import RoomDetailFallback from './RoomDetailFallback';
Expand All @@ -18,11 +18,12 @@ const RoomDetail = ({
checkedRoomJoin,
serverTime
}: RoomDetailProps) => {
const todayDateString = `${(serverTime || new Date()).getFullYear()}-${
(serverTime || new Date()).getMonth() + 1
}-${(serverTime || new Date()).getDate() < 10 ? 0 : ''}${(
serverTime || new Date()
).getDate()}`;
const todayDate = serverTime || new Date();
const todayDateString = `${todayDate.getFullYear()}-${String(
todayDate.getMonth() + 1
).padStart(2, '0')}-${
todayDate.getDate() < 10 ? 0 : ''
}${todayDate.getDate()}`;

const { data: roomDetailData, status } = useQuery({
...roomOptions.detailByDate(roomId, todayDateString),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useQuery } from '@tanstack/react-query';
import { roomOptions } from '@/core/api/options';
import { useRouteData } from '@/core/hooks';
import { RoomInfo as RoomInfoType } from '@/core/types/Room';
import { RoomInfo, RoomWorkspace } from '@/RoomDetail';
import { RoomInfo, RoomWorkspace } from '@/domain/RoomDetail';
import { DateRoomDetailContext } from './RoomDetailProvider';

interface RoomDetailContainerProps {
Expand All @@ -16,9 +16,11 @@ const RoomDetailContainer = ({ roomDetailData }: RoomDetailContainerProps) => {
const {
params: { roomId }
} = useRouteData();
const chooseDateString = `${chooseDate.getFullYear()}-${
const chooseDateString = `${chooseDate.getFullYear()}-${String(
chooseDate.getMonth() + 1
}-${chooseDate.getDate() < 10 ? 0 : ''}${chooseDate.getDate()}`;
).padStart(2, '0')}-${
chooseDate.getDate() < 10 ? 0 : ''
}${chooseDate.getDate()}`;

const { data: roomDetailDataByDate, status } = useQuery({
...roomOptions.detailByDate(roomId, chooseDateString)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import clsx from 'clsx';
import { roomOptions } from '@/core/api/options';
import getTimeRange from '@/core/utils/getTimeRange';
import { ProgressBar } from '@/shared/ProgressBar';
import { RoomDetailMeta } from '@/Meta';
import { RoomDetailMeta } from '@/domain/Meta';
import { RoomNotice } from '..';
import RoomHeader from './RoomHeader';
import RoomPreview from './RoomPreview';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ const RoomWorkspace = ({
</div>
</>
) : (
<div className="mb-[2.12rem] flex h-[2.56rem] w-full items-center justify-center rounded-[62.43rem] bg-light-point dark:bg-dark-point">
<div className="mb-[2.12rem] flex h-[2.56rem] w-full items-center justify-center rounded-[62.43rem] bg-light-point dark:bg-dark-point-hover">
<Link
to={`log/${chooseDateString}`}
className="flex w-fit items-center text-base"
className="flex w-fit items-center text-base text-white"
state={{
todayCertificateRank,
routines,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useCallback } from 'react';
import { useFormContext } from 'react-hook-form';
import { PasswordInput } from '@/shared/Input';
import { PASSWORD } from '@/RoomForm/constants/literals';
import { PASSWORD } from '@/domain/RoomForm/constants/literals';
import { errorStyle } from '../constants/styles';

interface PasswordProps {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { useMoveRoute } from '@/core/hooks';
import { Room } from '@/core/types';
import { Accordion, AccordionHeader, AccordionBody } from '@/shared/Accordion';
import { RoutineItem, RoutineList } from '@/shared/RoutineList';
import roomListStyle from '@/RoomList/styles/roomListStyle';
import KeywordText from '@/RoomSearch/components/KeywordText';
import { RoomSummary } from '@/RoomSummary';
import { useKeyword } from '@/RoomSearch';
import roomListStyle from '@/domain/RoomList/styles/roomListStyle';
import KeywordText from '@/domain/RoomSearch/components/KeywordText';
import { RoomSummary } from '@/domain/RoomSummary';
import { useKeyword } from '@/domain/RoomSearch';

const isKeywordInRoutines = (
keyword: string,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { clsx } from 'clsx';
import { useMoveRoute } from '@/core/hooks';
import { ParticipatingRoom } from '@/core/types';
import { RoomSummary } from '@/RoomSummary';
import { RoomSummary } from '@/domain/RoomSummary';
import roomListStyle from '../styles/roomListStyle';
import CertifyButton from './CertifyButton';
import BugInfo from './BugInfo';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import clsx from 'clsx';
import { twMerge } from 'tailwind-merge';
import { RoomInfo } from '@/core/types/Room';
import { BIRD, TIME_RANGE } from '@/RoomForm/constants/literals';
import { BIRD, TIME_RANGE } from '@/domain/RoomForm/constants/literals';

interface BirdCardProps {
active?: boolean;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ROOM_COUNT,
ROOM_TYPES,
TIME_RANGE
} from '@/RoomForm/constants/literals';
} from '@/domain/RoomForm/constants/literals';
import { Inputs } from '../hooks/useRoomForm';
import BirdCard from './BirdCard';
import BirdCardFallback from './BirdCardFallback';
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
ROOM_NAME,
USER_COUNT,
PASSWORD
} from '@/RoomForm/constants/literals';
} from '@/domain/RoomForm/constants/literals';

export const formSchema = z.object({
roomType: z.enum(ROOM_TYPES, {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import clsx from 'clsx';
import { PASSWORD } from '@/RoomForm/constants/literals';
import { Password } from '@/RoomForm';
import { PASSWORD } from '@/domain/RoomForm/constants/literals';
import { Password } from '@/domain/RoomForm';
import { headingStyle, descriptionStyle } from '../constants/styles';

const PasswordStep = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useFormContext } from 'react-hook-form';
import { Input } from '@/shared/Input';
import { ROOM_NAME } from '@/RoomForm/constants/literals';
import { Routines, UserCount } from '@/RoomForm';
import { ROOM_NAME } from '@/domain/RoomForm/constants/literals';
import { Routines, UserCount } from '@/domain/RoomForm';
import { errorStyle } from '../constants/styles';
import { Inputs } from '../hooks/useRoomForm';
import { descriptionStyle } from '../constants/styles';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import clsx from 'clsx';
import { useFormContext } from 'react-hook-form';
import { Icon, iconMap } from '@/shared/Icon';
import { formatHourString } from '@/TimePicker/utils/hour';
import { BIRD } from '@/RoomForm/constants/literals';
import { formatHourString } from '@/domain/TimePicker/utils/hour';
import { BIRD } from '@/domain/RoomForm/constants/literals';
import { headingStyle, descriptionStyle } from '../constants/styles';
import { Inputs } from '../hooks/useRoomForm';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useFormContext } from 'react-hook-form';
import { formatHourString } from '@/TimePicker/utils/hour';
import { TIME_RANGE } from '@/RoomForm/constants/literals';
import { TimePicker } from '@/TimePicker';
import { formatHourString } from '@/domain/TimePicker/utils/hour';
import { TIME_RANGE } from '@/domain/RoomForm/constants/literals';
import { TimePicker } from '@/domain/TimePicker';
import {
headingStyle,
descriptionStyle,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { TotalRooms } from '@/core/types';
import { AccordionGroup } from '@/shared/Accordion';
import { Deffered } from '@/shared/Deffered';
import { RoomAccordion } from '@/RoomList';
import { RoomAccordion } from '@/domain/RoomList';
import ResultListFallback from './ResultListFallback';

interface InfiniteScrollOptions {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions src/domain/RoomSearch/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export { default as SearchBar } from '@/domain/RoomSearch/components/SearchBar';
export { default as SearchResultList } from '@/domain/RoomSearch/components/SearchResultList';
export { default as AllResultList } from '@/domain/RoomSearch/components/AllResultList';
export { default as Selection } from '@/domain/RoomSearch/components/Selection';
export {
default as useKeyword,
KeywordContext
} from '@/domain/RoomSearch/hooks/useKeyword';
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
USER_COUNT,
PASSWORD,
FORM_MESSAGE
} from '@/RoomForm/constants/literals';
} from '@/domain/RoomForm/constants/literals';

export const formSchema = z.object({
title: z
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Meta, StoryObj } from '@storybook/react';
import { http, HttpResponse } from 'msw';
import { Title, Description, Stories } from '@storybook/blocks';
import { baseURL } from '@/core/mocks/baseURL';
import { RoomInfoBeforeEditing } from '@/core/mocks/datas/room';
import { baseURL } from '@/core/api/mocks/baseURL';
import { RoomInfoBeforeEditing } from '@/core/api/mocks/datas/room';
import RemoveTab from './RemoveTab';

const meta = {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import clsx from 'clsx';
import { roomOptions } from '@/core/api/options';
import { Input } from '@/shared/Input';
import { LoadingSpinner } from '@/shared/LoadingSpinner';
import { formatHourString } from '@/TimePicker/utils/hour';
import { formatHourString } from '@/domain/TimePicker/utils/hour';
import {
TIME_RANGE,
ANNOUNCEMENT,
ROOM_NAME
} from '@/RoomForm/constants/literals';
import { UserCount, Routines, Password } from '@/RoomForm';
import { TimePicker } from '@/TimePicker';
} from '@/domain/RoomForm/constants/literals';
import { UserCount, Routines, Password } from '@/domain/RoomForm';
import { TimePicker } from '@/domain/TimePicker';
import useRoomForm from '../hooks/useRoomForm';

interface RoomTabProps {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { clsx } from 'clsx';
import { useMoveRoute } from '@/core/hooks';
import { Icon } from '@/shared/Icon';
import roomListStyle from '@/RoomList/styles/roomListStyle';
import roomListStyle from '@/domain/RoomList/styles/roomListStyle';

interface NewRoomCardProps {
disabled: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useSuspenseQuery } from '@tanstack/react-query';
import { roomOptions } from '@/core/api/options';
import { MyJoinRoom, ParticipatingRoom, DayType } from '@/core/types';
import { DAY_TYPE } from '@/RoomSlide/constants/dayType';
import { RoomCard } from '@/RoomList';
import { DAY_TYPE } from '@/domain/RoomSlide/constants/dayType';
import { RoomCard } from '@/domain/RoomList';
import NewRoomCard from './NewRoomCard';

interface RoomDataProps {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { clsx } from 'clsx';
import { DayType } from '@/core/types';
import { useTheme } from '@/core/hooks';
import { Icon } from '@/shared/Icon';
import KeywordText from '@/RoomSearch/components/KeywordText';
import { useKeyword } from '@/RoomSearch';
import KeywordText from '@/domain/RoomSearch/components/KeywordText';
import { useKeyword } from '@/domain/RoomSearch';
import IconText from './IconText';

interface RoomSummaryProps {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DayType } from '@/core/types';
import { DayInfo, RoomDataFallback } from '@/RoomSlide';
import { DayInfo, RoomDataFallback } from '@/domain/RoomSlide';

interface FakeRoutinesPageProps {
dayType: DayType;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import '@/StartSlide/styles/star.css';
import getRandomValue from '../utils/getRandomValue';
import '@/domain/StartSlide/styles/star.css';

const Star = () => {
const x = getRandomValue(100);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Icon } from '@/shared/Icon';
import '@/StartSlide/styles/swipeArrow.css';
import '@/domain/StartSlide/styles/swipeArrow.css';

const SwipeArrow = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { motion } from 'framer-motion';
import useRandomMessage from '@/StartSlide/hooks/useRandomMessage';
import useRandomMessage from '@/domain/StartSlide/hooks/useRandomMessage';

interface UserBirdProps {
birdSkin: string;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useRef, useEffect } from 'react';
import getRandomValue from '@/StartSlide/utils/getRandomValue';
import { CONTENTS } from '@/StartSlide/constants/contents';
import getRandomValue from '@/domain/StartSlide/utils/getRandomValue';
import { CONTENTS } from '@/domain/StartSlide/constants/contents';

const maxMessageIndex = CONTENTS.MESSAGES.length;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { initializeFirebase, getFCMToken } from '@/core/utils/firebase';
import { ThemeProvider } from '@/core/hooks/useTheme';
import notificationAPI from '@/core/api/functions/notificationAPI';
import queryClient from '@/core/api/queryClient';
import { PWAInstallBannerProvider } from '@/PWAInstallBanner/hooks/usePWAInstallBanner';
import { PWAInstallBannerProvider } from '@/domain/PWAInstallBanner/hooks/usePWAInstallBanner';
import { setupMockServiceWorker, setupFCMServiceWorker } from './setupWorker';
import './main.css';

Expand Down
4 changes: 2 additions & 2 deletions src/pages/CouponPage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Suspense } from 'react';
import { Header } from '@/shared/Header';
import { Deffered } from '@/shared/Deffered';
import MyCouponList from '@/MyCoupon/components/MyCouponList';
import MyCouponListFallback from '@/MyCoupon/components/MyCouponListFallback';
import MyCouponList from '@/domain/MyCoupon/components/MyCouponList';
import MyCouponListFallback from '@/domain/MyCoupon/components/MyCouponListFallback';

const CouponPage = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/EventPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ErrorBoundary } from '@suspensive/react';
import { Header } from '@/shared/Header';
import { Deffered } from '@/shared/Deffered';
import { NetworkFallback } from '@/shared/ErrorBoundary';
import { EventList, EventListFallback } from '@/Promotion';
import { EventList, EventListFallback } from '@/domain/Promotion';

const EventPage = () => {
return (
Expand Down
4 changes: 2 additions & 2 deletions src/pages/GuidePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { Link } from 'react-router-dom';
import { Swiper, SwiperSlide } from 'swiper/react';
import { Pagination, Autoplay } from 'swiper/modules';
import { useTheme } from '@/core/hooks';
import { GuideContent, GUIDE_CONTENTS } from '@/Guide';
import { GuideContent, GUIDE_CONTENTS } from '@/domain/Guide';
import 'swiper/css/pagination';
import '@/Guide/styles/swiperBullets.css';
import '@/domain/Guide/styles/swiperBullets.css';

const GuidePage = () => {
const { theme } = useTheme();
Expand Down
Loading

0 comments on commit 7f07f22

Please sign in to comment.