Skip to content

Commit

Permalink
refactor: 컴포넌트 아토믹 구조로 분리 (#272)
Browse files Browse the repository at this point in the history
* refactor: 아토믹 구조에 맞게 분리

* fix: 잘못 추가된 파일 제거

* fix: 폴더 분리 후 index 파일 수정
  • Loading branch information
backward99 authored Jan 15, 2024
1 parent b2e5a99 commit ec8c8fb
Show file tree
Hide file tree
Showing 68 changed files with 110 additions and 39 deletions.
3 changes: 3 additions & 0 deletions src/components/atoms/EventContent/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import EventContent from './EventContent';

export { EventContent };
3 changes: 3 additions & 0 deletions src/components/molecules/EventTime/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import EventTime from './EventTime';

export { EventTime };
3 changes: 3 additions & 0 deletions src/components/molecules/EventTitle/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import EventTitle from './EventTitle';

export { EventTitle };
3 changes: 3 additions & 0 deletions src/components/molecules/ImageCard/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ImageCard from './ImageCard';

export { ImageCard };
3 changes: 3 additions & 0 deletions src/components/molecules/LinkItem/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import LinkItem from './LinkItem';

export { LinkItem };
3 changes: 3 additions & 0 deletions src/components/molecules/MentorCareerContent/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import MentorCareerContent from './MentorCareerContent';

export { MentorCareerContent };
3 changes: 3 additions & 0 deletions src/components/molecules/MentorCareerTitle/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import MentorCareerTitle from './MentorCareerTitle';

export { MentorCareerTitle };
2 changes: 1 addition & 1 deletion src/components/molecules/Modal/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import ModalWithButton from './ModalWithButton';
import ModalWithButton from '../../organisms/ModalWithButton/ModalWithButton';

const meta = {
title: 'Resumeme/components/Molecules/Modal',
Expand Down
3 changes: 1 addition & 2 deletions src/components/molecules/Modal/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import CareerContentModal from './CareerContentModal';
import Modal from './Modal';

export { Modal, CareerContentModal };
export { Modal };
2 changes: 1 addition & 1 deletion src/components/molecules/OptionsButton/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import EditDeleteOptionsButton from './EditDeleteOptionsButton';
import EditDeleteOptionsButton from '../../organisms/EditDeleteOptionsButton/EditDeleteOptionsButton';
import OptionsButton from './OptionsButton';

export { OptionsButton, EditDeleteOptionsButton };
3 changes: 3 additions & 0 deletions src/components/molecules/RadioCard/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import RadioCard from './RadioCard';

export { RadioCard };
3 changes: 3 additions & 0 deletions src/components/molecules/RejectionModalContent/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import RejectionModalContent from './RejectionModalContent';

export { RejectionModalContent };
3 changes: 3 additions & 0 deletions src/components/molecules/ResumeList/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ResumeList from './ResumeList';

export { ResumeList };
3 changes: 3 additions & 0 deletions src/components/molecules/TitleInputForm/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import TitleInputForm from './TitleInputForm';

export { TitleInputForm };
3 changes: 3 additions & 0 deletions src/components/organisms/BasicInfoForm/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import BasicInfoForm from './BasicInfoForm';

export { BasicInfoForm };
3 changes: 3 additions & 0 deletions src/components/organisms/BasicInfoView/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import BasicInfoView from './BasicInfoView';

export { BasicInfoView };
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Text } from '@chakra-ui/react';
import { Modal } from '.';
import { Modal } from '../../molecules/Modal';

const CareerContentModal = ({ isOpen, onClose }: { isOpen: boolean; onClose: () => void }) => {
return (
Expand Down
3 changes: 3 additions & 0 deletions src/components/organisms/CareerContentModal/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import CareerContentModal from './CareerContentModal';

export { CareerContentModal };
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Flex } from '@chakra-ui/react';
import { FieldError, UseFormRegisterReturn } from 'react-hook-form';
import { FORM_STYLE } from './EditMentorProfileTemplate';
import { FORM_STYLE } from '../../templates/EditProfileTemplate/EditMentorProfileTemplate';
import { Avatar } from '~/components/atoms/Avatar';
import { BorderBox } from '~/components/atoms/BorderBox';
import { FormLabel } from '~/components/atoms/FormLabel';
Expand Down
3 changes: 3 additions & 0 deletions src/components/organisms/CommonInput/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import CommonInput from './CommonInput';

export { CommonInput };
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useDisclosure } from '@chakra-ui/react';
import OptionsButton from './OptionsButton';
import { Option } from './OptionsButton';
import { ConfirmModal } from '../ConfirmModal';
import { ConfirmModal } from '../../molecules/ConfirmModal';
import OptionsButton from '../../molecules/OptionsButton/OptionsButton';
import { Option } from '../../molecules/OptionsButton/OptionsButton';

const EditDeleteOptionsButton = ({
onEdit,
Expand Down
3 changes: 3 additions & 0 deletions src/components/organisms/EditDeleteOptionsButton/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import EditDeleteOptionsButton from './EditDeleteOptionsButton';

export { EditDeleteOptionsButton };
8 changes: 4 additions & 4 deletions src/components/organisms/EventDetail/EventDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Box, Divider, Flex } from '@chakra-ui/react';
import EventContent from './EventContent';
import EventTime from './EventTime';
import MentorCareerContent from './MentorCareerContent';
import MentorCareerTitle from './MentorCareerTitle';
import EventContent from '../../atoms/EventContent/EventContent';
import EventTime from '../../molecules/EventTime/EventTime';
import MentorCareerContent from '../../molecules/MentorCareerContent/MentorCareerContent';
import MentorCareerTitle from '../../molecules/MentorCareerTitle/MentorCareerTitle';
import { ReadEvent } from '~/types/event/event';
import { ReadMentor } from '~/types/mentor';

Expand Down
3 changes: 3 additions & 0 deletions src/components/organisms/EventItem/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import EventItem from './EventItem';

export { EventItem };
3 changes: 3 additions & 0 deletions src/components/organisms/FeedbackBlock/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import FeedbackBlock from './FeedbackBlock';

export { FeedbackBlock };
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Box, Divider } from '@chakra-ui/react';
import React from 'react';
import { BorderBox } from '~/components/atoms/BorderBox';
import { FeedbackView } from '~/components/molecules/FeedbackView';
import FeedbackBlock from '~/components/templates/FeedbackResumeTemplate/FeedbackBlock';
import FeedbackBlock from '~/components/organisms/FeedbackBlock/FeedbackBlock';
import { FeedbackComment } from '~/types/event/feedback';
import { ReadMentor } from '~/types/mentor';
import { DetailsComponentProps } from '~/types/props/detailsComponentProps';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button, useDisclosure } from '@chakra-ui/react';
import Modal, { ModalProps } from './Modal';
import Modal, { ModalProps } from '../../molecules/Modal/Modal';

const ModalWithButton = ({ size, title, hasCloseButton, hasFooter, children }: ModalProps) => {
const { isOpen, onOpen, onClose } = useDisclosure();
Expand Down
3 changes: 3 additions & 0 deletions src/components/organisms/ModalWithButton/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ModalWithButton from './ModalWithButton';

export { ModalWithButton };
4 changes: 2 additions & 2 deletions src/components/organisms/Profile/Profile.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Flex, Heading } from '@chakra-ui/react';
import ImageCard from './ImageCard';
import UserDetail from './UserDetail';
import ImageCard from '../../molecules/ImageCard/ImageCard';
import UserDetail from '../UserDetail/UserDetail';
import { BorderBox } from '~/components/atoms/BorderBox';
import { User } from '~/types/user';

Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/RadioCardGroup/RadioCardGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, BoxProps, Flex, FormErrorMessage, useRadioGroup } from '@chakra-ui/react';
import { FieldError, UseFormRegisterReturn } from 'react-hook-form';
import RadioCard from './RadioCard';
import RadioCard from '../../molecules/RadioCard/RadioCard';

export type RadioOption<T extends string = string> = {
value: T;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Flex, FormControl, Radio, RadioGroup } from '@chakra-ui/react';
import { useForm } from 'react-hook-form';
import LinkItem from './LinkItem';
import LinkItem from '../../molecules/LinkItem/LinkItem';
import { BorderBox } from '~/components/atoms/BorderBox';
import { Button } from '~/components/atoms/Button';
import { FormTextInput } from '~/components/molecules/FormTextInput';
Expand Down
3 changes: 3 additions & 0 deletions src/components/organisms/ReferenceLinkForm/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ReferenceLinkForm from './ReferenceLinkForm';

export { ReferenceLinkForm };
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useForm } from 'react-hook-form';
import { useNavigate, useParams } from 'react-router-dom';
import RemoteControlReject from './RemoteControlReject';
import RemoteControlReject from '../RemoteControlReject/RemoteControlReject';
import { Button } from '~/components/atoms/Button';
import { FormLabel } from '~/components/atoms/FormLabel';
import { RemoteControl } from '~/components/atoms/RemoteControl';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useDisclosure, Text, Box } from '@chakra-ui/react';
import RejectionModalContent from './RejectionModalContent';
import RejectionModalContent from '../../molecules/RejectionModalContent/RejectionModalContent';
import { Modal } from '~/components/molecules/Modal';

type RemoteControlRejectProps = {
Expand Down
3 changes: 3 additions & 0 deletions src/components/organisms/RemoteControlReject/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import RemoteControlReject from './RemoteControlReject';

export { RemoteControlReject };
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Box, Flex, Heading, Text } from '@chakra-ui/react';
import { useEffect, useState } from 'react';
import { useParams } from 'react-router-dom';
import BasicInfoForm from './BasicInfoForm';
import BasicInfoView from './BasicInfoView';
import ReferenceLinkForm from './ReferenceLinkForm';
import TitleInputForm from './TitleInputForm';
import TitleInputForm from '../../molecules/TitleInputForm/TitleInputForm';
import BasicInfoForm from '../BasicInfoForm/BasicInfoForm';
import BasicInfoView from '../BasicInfoView/BasicInfoView';
import ReferenceLinkForm from '../ReferenceLinkForm/ReferenceLinkForm';
import { BorderBox } from '~/components/atoms/BorderBox';
import useUser from '~/hooks/useUser';
import { useGetResumeReferenceLinks } from '~/queries/resume/details/useGetResumeReferenceLinks';
Expand Down
3 changes: 3 additions & 0 deletions src/components/organisms/ResumeCategory/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ResumeCategory from './ResumeCategory';

export { ResumeCategory };
4 changes: 2 additions & 2 deletions src/components/organisms/ResumeCategoryCareer/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import ResumeCategory from './ResumeCategory';
import CareerForm from './CareerForm';

export { ResumeCategory };
export { CareerForm };
3 changes: 3 additions & 0 deletions src/components/organisms/UserDetail/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import UserDetail from './UserDetail';

export { UserDetail };
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Box, Flex, Heading } from '@chakra-ui/react';
import { useQueryClient } from '@tanstack/react-query';
import { SubmitHandler, useForm } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';
import CommonInput from './CommonInput';
import CommonInput from '../../organisms/CommonInput/CommonInput';
import { FORM_STYLE } from './EditMentorProfileTemplate';
import { BorderBox } from '~/components/atoms/BorderBox';
import { FormLabel } from '~/components/atoms/FormLabel';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { Box, ChakraProps, Flex, Heading, Text, useDisclosure } from '@chakra-ui
import { useQueryClient } from '@tanstack/react-query';
import { SubmitHandler, useForm } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';
import CommonInput from './CommonInput';
import CommonInput from '../../organisms/CommonInput/CommonInput';
import { BorderBox } from '~/components/atoms/BorderBox';
import { FormLabel } from '~/components/atoms/FormLabel';
import { FormControl } from '~/components/molecules/FormControl';
import { FormTextarea } from '~/components/molecules/FormTextarea';
import { FormTextInput } from '~/components/molecules/FormTextInput';
import { LabelCheckboxGroup } from '~/components/molecules/LabelCheckboxGroup';
import { CareerContentModal } from '~/components/molecules/Modal';
import { SubmitButtonGroup } from '~/components/molecules/SubmitButtonGroup';
import { CareerContentModal } from '~/components/organisms/CareerContentModal';
import { appPaths } from '~/config/paths';
import CONSTANTS from '~/constants';
import useUser from '~/hooks/useUser';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button } from '~/components/atoms/Button';
import { ResumeBasicInput } from '~/components/organisms/ResumeBasicInput';
import { ActivityForm } from '~/components/organisms/ResumeCategoryActivity';
import { AwardForm } from '~/components/organisms/ResumeCategoryAwards';
import CareerForm from '~/components/organisms/ResumeCategoryCareer/CareerForm';
import { CareerForm } from '~/components/organisms/ResumeCategoryCareer';
import { ResumeCategoryDetails } from '~/components/organisms/ResumeCategoryDetails';
import { LanguageForm } from '~/components/organisms/ResumeCategoryLanguage';
import { ProjectForm } from '~/components/organisms/ResumeCategoryProject';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Flex, Heading, Text } from '@chakra-ui/react';
import { v4 as uuidv4 } from 'uuid';
import EventItem from './EventItem';
import EventItem from '../../organisms/EventItem/EventItem';
import { BorderBox } from '~/components/atoms/BorderBox';
import { ReadManagementEvent } from '~/types/event/event';

type EventProfile = {
events: ReadManagementEvent[];
};

const EventProfile = ({ events }: EventProfile) => {
const EventProfileTemplate = ({ events }: EventProfile) => {
return (
<>
<Heading
Expand Down Expand Up @@ -63,4 +63,4 @@ const EventProfile = ({ events }: EventProfile) => {
</>
);
};
export default EventProfile;
export default EventProfileTemplate;
3 changes: 3 additions & 0 deletions src/components/templates/EventProfileTemplate/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import EventProfileTemplate from './EventProfileTemplate';

export { EventProfileTemplate };
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FeedbackCategoryReflectDetails } from '~/components/organisms/FeedbackC
import { ResumeBasicInput } from '~/components/organisms/ResumeBasicInput';
import { ActivityForm } from '~/components/organisms/ResumeCategoryActivity';
import { AwardForm } from '~/components/organisms/ResumeCategoryAwards';
import CareerForm from '~/components/organisms/ResumeCategoryCareer/CareerForm';
import { CareerForm } from '~/components/organisms/ResumeCategoryCareer';
import { LanguageForm } from '~/components/organisms/ResumeCategoryLanguage';
import ProjectForm from '~/components/organisms/ResumeCategoryProject/ProjectForm';
import { TrainingForm } from '~/components/organisms/ResumeCategoryTraining';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Box, Flex, Text } from '@chakra-ui/react';
import { useNavigate, useParams } from 'react-router-dom';
import { BorderBox } from '../../atoms/BorderBox';
import { Label } from '~/components/atoms/Label';
import EditDeleteOptionsButton from '~/components/molecules/OptionsButton/EditDeleteOptionsButton';
import EditDeleteOptionsButton from '~/components/organisms/EditDeleteOptionsButton/EditDeleteOptionsButton';
import { ReferenceLinkBox } from '~/components/molecules/ReferenceLinkBox';
import { ResumeCategoryDetails } from '~/components/organisms/ResumeCategoryDetails';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { FormControl } from '~/components/molecules/FormControl';
import { FormTextarea } from '~/components/molecules/FormTextarea';
import { FormTextInput } from '~/components/molecules/FormTextInput';
import { LabelCheckboxGroup } from '~/components/molecules/LabelCheckboxGroup';
import { CareerContentModal } from '~/components/molecules/Modal';
import { CareerContentModal } from '~/components/organisms/CareerContentModal';
import { SignUpHeader } from '~/components/organisms/SignUpHeader';
import CONSTANTS from '~/constants';
import { SignUpMentor } from '~/types/signUp';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/EventPages/EventDetailPage/EventDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { useQueryClient } from '@tanstack/react-query';
import { Suspense } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import { Spinner } from '~/components/atoms/Spinner';
import EventTitle from '~/components/molecules/EventTitle/EventTitle';
import { MentorProfile } from '~/components/molecules/MentorProfile';
import { Modal } from '~/components/molecules/Modal';
import { EventDetail } from '~/components/organisms/EventDetail';
import EventTitle from '~/components/organisms/EventDetail/EventTitle';
import ResumeSelect from '~/components/organisms/ResumeSelect/ResumeSelect';
import { appPaths } from '~/config/paths';
import useUser from '~/hooks/useUser';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MyPage/MyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Box } from '@chakra-ui/react';
import { Suspense } from 'react';
import { Spinner } from '~/components/atoms/Spinner';
import { Profile } from '~/components/organisms/Profile';
import EventProfile from '~/components/organisms/Profile/EventProfile';
import EventProfile from '~/components/templates/EventProfileTemplate/EventProfileTemplate';
import useUser from '~/hooks/useUser';
import { useGetManagementEvents } from '~/queries/event/details/useGetManagementEvents';

Expand Down

0 comments on commit ec8c8fb

Please sign in to comment.