Skip to content

Commit

Permalink
feat: import 문 구분을 위해 폴더 구조 배럴파일 구조로 변경 (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
suwonthugger committed Dec 21, 2024
1 parent ccff5a1 commit ec9e9e7
Show file tree
Hide file tree
Showing 27 changed files with 40 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Task } from '@/shared/types/home';
import ButtonAddIcon from '@/shared/assets/svgs/btn_task_add.svg?react';
import MeatBallDefault from '@/shared/assets/svgs/todo_meatball_default.svg?react';

import ButtonTodoToggle from '../../../shared/components/ButtonTodayToggle/ButtonTodoToggle';
import ButtonTodoToggle from '../../../../shared/components/ButtonTodayToggle/ButtonTodoToggle';
import BoxTodoInput from './BoxTodoInput/BoxTodoInput';
import StatusDefaultBoxCategory from './StatusDefaultBoxCategory/StatusDefaultBoxCategory';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import CheckBoxBlankIcon from '@/shared/assets/svgs/check_box_blank.svg?react';
import TimeLineIcon from '@/shared/assets/svgs/mingcute_time-line.svg?react';
import MeatBall from '@/shared/assets/svgs/todo_meatball_default.svg?react';

import SVGBtn from '../../../../shared/components/ButtonSVG';
import SVGBtn from '../../../../../shared/components/ButtonSVG';

interface BoxTodoInputProps {
editable: boolean;
Expand Down
2 changes: 2 additions & 0 deletions src/pages/HomePage/Box/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as BoxCategory } from './BoxCategory/BoxCategory';
export { default as BoxTodayTodo } from './BoxTodayTodo/BoxTodayTodo';
2 changes: 2 additions & 0 deletions src/pages/HomePage/Button/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as ButtonMoreFriends } from './ButtonMoreFriends/ButtonMoreFriends';
export { default as ButtonUserProfile } from './ButtonUserProfile/ButtonUserProfile';
10 changes: 4 additions & 6 deletions src/pages/HomePage/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useNavigate } from 'react-router-dom';

import { useQueryClient } from '@tanstack/react-query';

import ButtonSVG from '@/shared/components/ButtonSVG';
import ModalWrapper, { ModalWrapperRef } from '@/shared/components/ModalWrapper';

import useClickOutside from '@/shared/hooks/useClickOutside';
Expand All @@ -29,13 +30,10 @@ import LargePlusIcon from '@/shared/assets/svgs/large_plus.svg?react';

import { ROUTES_CONFIG } from '@/router/routesConfig';

import ButtonSVG from '../../shared/components/ButtonSVG';
import BoxCategory from './BoxCategory/BoxCategory';
import BoxTodayTodo from './BoxTodayTodo/BoxTodayTodo';
import ButtonMoreFriends from './ButtonMoreFriends/ButtonMoreFriends';
import ButtonUserProfile from './ButtonUserProfile/ButtonUserProfile';
import { BoxCategory, BoxTodayTodo } from './Box';
import { ButtonMoreFriends, ButtonUserProfile } from './Button';
import DatePicker from './DatePicker/DatePicker';
import { ModalContentsCategory, ModalContentsFriends } from './ModalContents/index';
import { ModalContentsCategory, ModalContentsFriends } from './ModalContents';
import StatusDefaultHome from './StatusDefaultHome/StatusDefaultHome';

dayjs.extend(utc);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ButtonAlert from './ButtonAlert/ButtonAlert';
import { AlertModalProps } from './types/index';
import ButtonAlert from '../ButtonAlert/ButtonAlert';
import { AlertModalProps } from '../types/index';

const Complete = ({ handleClose, userEmail }: AlertModalProps) => (
<div className="flex flex-col rounded-[0.8rem] bg-gray-bg-04 p-[3rem]">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { FormEvent, useRef, useState } from 'react';

import IconWarning from '@/shared/assets/svgs/ic_delete_alert.svg?react';

import ButtonAlert from './ButtonAlert/ButtonAlert';
import { AlertModalProps } from './types/index';
import ButtonAlert from '../ButtonAlert/ButtonAlert';
import { AlertModalProps } from '../types/index';

const DeleteAccount = ({ handleClose, userEmail }: AlertModalProps) => {
const inputRef = useRef<HTMLInputElement | null>(null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ButtonAlert from './ButtonAlert/ButtonAlert';
import { AlertModalProps } from './types/index';
import ButtonAlert from '../ButtonAlert/ButtonAlert';
import { AlertModalProps } from '../types/index';

const Logout = ({ handleClose, userEmail }: AlertModalProps) => (
<div className="flex flex-col rounded-[0.8rem] bg-gray-bg-04 p-[3rem]">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Complete from '../../../ModalContentsAlert/Complete/Complete';

Check failure on line 1 in src/pages/HomePage/ModalContents/ModalContentsAlert/ModalContentsAlert.tsx

View workflow job for this annotation

GitHub Actions / build (20)

Cannot find module '../../../ModalContentsAlert/Complete/Complete' or its corresponding type declarations.
import DeleteAccount from '../../../ModalContentsAlert/DeleteAccount/DeleteAccount';

Check failure on line 2 in src/pages/HomePage/ModalContents/ModalContentsAlert/ModalContentsAlert.tsx

View workflow job for this annotation

GitHub Actions / build (20)

Cannot find module '../../../ModalContentsAlert/DeleteAccount/DeleteAccount' or its corresponding type declarations.
import Logout from '../../../ModalContentsAlert/Logoout/Logout';

Check failure on line 3 in src/pages/HomePage/ModalContents/ModalContentsAlert/ModalContentsAlert.tsx

View workflow job for this annotation

GitHub Actions / build (20)

Cannot find module '../../../ModalContentsAlert/Logoout/Logout' or its corresponding type declarations.

const ModalContentsAlert = {
Logout: Logout,
DeleteAccount: DeleteAccount,
Complete: Complete,
};

export default ModalContentsAlert;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { userFriendData } from '@/shared/mocks/userFriendData';

import ButtonRequestAction from './components/ButtonRequestAction';
import FriendsListRequested from './components/FriendsListRequested';
import InputSendRequest from './components/InputSendRequest';
import ButtonRequestAction from '../../ModalContents/Friends/components/FriendsRequest/components/ButtonRequestAction';

Check failure on line 3 in src/pages/HomePage/ModalContents/ModalContentsFriends/FriendRequest/FriendsRequest.tsx

View workflow job for this annotation

GitHub Actions / build (20)

Cannot find module '../../ModalContents/Friends/components/FriendsRequest/components/ButtonRequestAction' or its corresponding type declarations.
import FriendsListRequested from '../../ModalContents/Friends/components/FriendsRequest/components/FriendsListRequested';

Check failure on line 4 in src/pages/HomePage/ModalContents/ModalContentsFriends/FriendRequest/FriendsRequest.tsx

View workflow job for this annotation

GitHub Actions / build (20)

Cannot find module '../../ModalContents/Friends/components/FriendsRequest/components/FriendsListRequested' or its corresponding type declarations.
import InputSendRequest from '../../ModalContents/Friends/components/FriendsRequest/components/InputSendRequest';

Check failure on line 5 in src/pages/HomePage/ModalContents/ModalContentsFriends/FriendRequest/FriendsRequest.tsx

View workflow job for this annotation

GitHub Actions / build (20)

Cannot find module '../../ModalContents/Friends/components/FriendsRequest/components/InputSendRequest' or its corresponding type declarations.

const FriendsRequest = () => {
return (
Expand All @@ -11,15 +11,15 @@ const FriendsRequest = () => {
<InputSendRequest />
</div>
<div className="h-[52.5rem] overflow-scroll">
<h2 className="subhead-bold-22 px-[1rem] py-[2rem] text-white">받은 요청</h2>
<h2 className="px-[1rem] py-[2rem] text-white subhead-bold-22">받은 요청</h2>
<FriendsListRequested friendsData={userFriendData}>
<div className="flex w-full items-center justify-end gap-[1rem]">
<ButtonRequestAction variant="positive">수락</ButtonRequestAction>
<ButtonRequestAction variant="negative">거절</ButtonRequestAction>
</div>
</FriendsListRequested>

<h2 className="subhead-bold-22 mt-[4rem] px-[1rem] py-[2rem] text-white">보낸 요청</h2>
<h2 className="mt-[4rem] px-[1rem] py-[2rem] text-white subhead-bold-22">보낸 요청</h2>
<FriendsListRequested friendsData={userFriendData}>
<div className="flex w-full items-center justify-end">
<ButtonRequestAction variant="negative">요청 취소</ButtonRequestAction>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { forwardRef, useState } from 'react';

import FriendsList from './components/FriendsList/FriendsList';
import FriendsRequest from './components/FriendsRequest/FriendsRequest';
import FriendsRequest from './FriendRequest/FriendsRequest';
import FriendsList from './FriendsList/FriendsList';

const ModalContentsFriends = forwardRef<HTMLDivElement>((_, ref) => {
const [activeTab, setActiveTab] = useState<string>('친구목록');
Expand All @@ -15,17 +15,17 @@ const ModalContentsFriends = forwardRef<HTMLDivElement>((_, ref) => {
ref={ref}
className="h-[800px] w-[1300px] rounded-[14px] bg-gray-bg-03 p-[4rem] shadow-[0_3px_30px_0px_rgba(0,0,0,0.4)]"
>
<h1 className="title-bold-32 mb-[1rem] text-white">친구</h1>
<h1 className="mb-[1rem] text-white title-bold-32">친구</h1>

<button
className={`subhead-bold-22 mr-[0.5rem] p-[1rem] ${activeTab === '친구목록' ? 'text-white' : 'text-gray-03'}`}
className={`mr-[0.5rem] p-[1rem] subhead-bold-22 ${activeTab === '친구목록' ? 'text-white' : 'text-gray-03'}`}
onClick={() => handleTabChange('친구목록')}
>
{'친구목록'}
</button>

<button
className={`subhead-bold-22 mr-[0.5rem] p-[1rem] ${activeTab === '친구요청' ? 'text-white' : 'text-gray-03'}`}
className={`mr-[0.5rem] p-[1rem] subhead-bold-22 ${activeTab === '친구요청' ? 'text-white' : 'text-gray-03'}`}
onClick={() => handleTabChange('친구요청')}
>
{'친구요청'}
Expand Down

This file was deleted.

5 changes: 3 additions & 2 deletions src/pages/HomePage/ModalContents/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { default as ModalContentsFriends } from './Friends/ModalContentsFriends';
export { default as ModalContentsCategory } from './Category/ModalContentsCategory';
export { default as ModalContentsAlert } from './ModalContentsAlert/ModalContentsAlert';
export { default as ModalContentsCategory } from './ModalContentsCategory/ModalContentsCategory';
export { default as ModalContentsFriends } from './ModalContentsFriends/ModalContentsFriends';

0 comments on commit ec9e9e7

Please sign in to comment.