Skip to content

Commit

Permalink
Merge pull request #158 from bsideproject/moon
Browse files Browse the repository at this point in the history
[feat] 룸등록 관련 소스정리...
  • Loading branch information
KinDDoGGang authored Sep 22, 2023
2 parents 05fa4a9 + f6d38ed commit d6daaf5
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 403 deletions.
10 changes: 1 addition & 9 deletions components/Filter/Filter.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
import React, { useState, useEffect, useCallback, use, useMemo } from 'react';
import { useTranslation } from 'next-i18next';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import { GetStaticPropsContext } from 'next';
import { Toast, Chip, Select, Toggle, Checkbox, Button, Input } from '@/components/index.tsx';
import { Chip, Select, Toggle, Checkbox, Button, Input } from '@/components/index.tsx';
import { FieldValues, SubmitHandler, useForm } from 'react-hook-form';
import { GuList, DongList } from '@/public/js/guDongList.ts';
import toast from 'react-hot-toast';
import styles from './Filter.module.scss';
import { Option } from '../Select/Select';
import Calendar from '../Calendar/Calendar';

export const getStaticProps = async ({ locale }: GetStaticPropsContext) => ({
props: {
...(await serverSideTranslations(locale as string, ['filter', 'common'])),
},
});

const TYPE_OF_HOUSING = [
{
Expand Down
2 changes: 2 additions & 0 deletions components/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ export { default as Space } from '@/components/Space.tsx';
export { default as LoginLayout } from '@/components/layouts/LoginLayout.tsx';
export { default as Toast } from '@/components/Toast/Toast.tsx';
export { default as Upload } from '@/components/File/FileUpload.tsx';
export { default as Calendar } from '@/components/Calendar/Calendar.tsx';
export { default as FileUpload } from '@/components/File/FileUpload.tsx';
13 changes: 3 additions & 10 deletions components/layouts/RoomListLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
import React, { ReactNode } from 'react';
import Header from '@/components/Header/Header.tsx';
import useModal from '@/hooks/useModal.ts';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import { GetStaticPropsContext } from 'next';
import Step1 from '@/pages/room/addRoom/step1.tsx';


interface AppLayoutProps {
children: ReactNode;
}

export const getStaticProps = async ({ locale }: GetStaticPropsContext) => ({
props: {
...(await serverSideTranslations(locale as string, ['filter', 'common'])),
},
});

function RoomListLayout({ children }: AppLayoutProps) {
const { openModal, closeModal } = useModal();
const { openModal } = useModal();
const handleButtonClick = () => {
openModal({
props: {
Expand All @@ -25,7 +18,7 @@ function RoomListLayout({ children }: AppLayoutProps) {
custom: true,
customHeader: true,
},
children: <Step1 closeModal1={closeModal} />,
children: <Step1 />,
});
};

Expand Down
8 changes: 0 additions & 8 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React, { useEffect, useState } from 'react';
import type { GetStaticPropsContext } from 'next';
import 'tailwindcss/tailwind.css';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import RoomCard from '@/components/RoomCard/RoomCard';
import { fetchRooms } from '@/api/room';
import { Room } from '@/public/types/room';
Expand All @@ -16,12 +14,6 @@ import { FieldValues } from 'react-hook-form';
import Filter from '@/components/Filter/Filter.tsx';
import { useTranslation } from 'next-i18next';

export const getStaticProps = async ({ locale }: GetStaticPropsContext) => ({
props: {
...(await serverSideTranslations(locale as string, ['roomList', 'common'])),
},
});

type HomeProps = NextPage & {
getLayout: (page: React.ReactElement, ctx: NextPageContext) => React.ReactNode;
};
Expand Down
Loading

0 comments on commit d6daaf5

Please sign in to comment.