diff --git a/src/App.tsx b/src/App.tsx index 18c1e4ed..672f92ae 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,23 +1,23 @@ +import BodyLayout from '@components/BodyLayout'; import FooterTab from '@components/FooterTab'; import Header from '@components/Header'; import Announcement from '@pages/Announcement'; -import BodyLayout from '@pages/BodyLayout'; import Home from '@pages/Home'; import MajorDecision from '@pages/MajorDecision'; import Map from '@pages/Map'; -import MapProvider from '@pages/Map/Provider'; import My from '@pages/My'; import Tip from '@pages/Tip'; import RouteChangeTracker from '@utils/routeChangeTracker'; -import { Routes, Route, useLocation } from 'react-router-dom'; +import { Routes, Route } from 'react-router-dom'; + +import { OverlayProvider } from './components/Providers'; const App = () => { - const location = useLocation(); RouteChangeTracker(); return ( <> - {location.pathname !== '/map' &&
} +
}> } /> @@ -26,7 +26,7 @@ const App = () => { } /> } /> - }> + }> } /> diff --git a/src/pages/BodyLayout/index.tsx b/src/components/BodyLayout/index.tsx similarity index 100% rename from src/pages/BodyLayout/index.tsx rename to src/components/BodyLayout/index.tsx diff --git a/src/components/Card/AnnounceCard/index.test.tsx b/src/components/Card/AnnounceCard/index.test.tsx index 02d09044..aadaa992 100644 --- a/src/components/Card/AnnounceCard/index.test.tsx +++ b/src/components/Card/AnnounceCard/index.test.tsx @@ -1,5 +1,5 @@ import http from '@apis/http'; -import MajorProvider from '@components/MajorProvider'; +import MajorProvider from '@components/Providers/MajorProvider'; import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { AnnounceItemList } from '@type/announcement'; diff --git a/src/components/Card/InformCard/index.test.tsx b/src/components/Card/InformCard/index.test.tsx index a32daa6b..f5f16cbb 100644 --- a/src/components/Card/InformCard/index.test.tsx +++ b/src/components/Card/InformCard/index.test.tsx @@ -1,5 +1,5 @@ -import AlertModal from '@components/Modal/AlertModal'; -import ModalsProvider from '@components/ModalsProvider'; +import AlertModal from '@components/Common/Modal/AlertModal'; +import ModalsProvider from '@components/Providers/ModalsProvider'; import { MODAL_MESSAGE } from '@constants/modal-messages'; import MajorContext from '@contexts/major'; import useModals from '@hooks/useModals'; @@ -9,8 +9,8 @@ import Major from '@type/major'; import { IconKind } from '@type/styles/icon'; import { act } from 'react-dom/test-utils'; import { MemoryRouter } from 'react-router-dom'; - import '@testing-library/jest-dom'; + import InformCard from './index'; type INFORM_CARD_TYPE = 'ANNOUNCEMENT' | 'GRADUATION'; diff --git a/src/components/Card/InformCard/index.tsx b/src/components/Card/InformCard/index.tsx index 5d3e688f..6822bf2a 100644 --- a/src/components/Card/InformCard/index.tsx +++ b/src/components/Card/InformCard/index.tsx @@ -1,6 +1,5 @@ -import Icon from '@components/Icon'; +import Icon from '@components/Common/Icon'; import { MODAL_BUTTON_MESSAGE, MODAL_MESSAGE } from '@constants/modal-messages'; -import { css } from '@emotion/react'; import styled from '@emotion/styled'; import useMajor from '@hooks/useMajor'; import useModals, { modals } from '@hooks/useModals'; diff --git a/src/components/Button/Toggle/index.tsx b/src/components/Common/Button/Toggle/index.tsx similarity index 96% rename from src/components/Button/Toggle/index.tsx rename to src/components/Common/Button/Toggle/index.tsx index 4b3199e7..bf25ed3f 100644 --- a/src/components/Button/Toggle/index.tsx +++ b/src/components/Common/Button/Toggle/index.tsx @@ -8,11 +8,6 @@ interface Props { animation: boolean; } -interface Circle { - isOn: boolean; - animation: boolean; -} - const ToggleButton = (props: Props) => { const { isOn, changeState, animation } = props; @@ -25,6 +20,11 @@ const ToggleButton = (props: Props) => { export default ToggleButton; +// chore : Circle interface 위치 수정 +interface Circle { + isOn: boolean; + animation: boolean; +} const Button = styled.button` position: relative; border: none; diff --git a/src/components/Button/index.tsx b/src/components/Common/Button/index.tsx similarity index 100% rename from src/components/Button/index.tsx rename to src/components/Common/Button/index.tsx diff --git a/src/components/Icon/index.tsx b/src/components/Common/Icon/index.tsx similarity index 100% rename from src/components/Icon/index.tsx rename to src/components/Common/Icon/index.tsx diff --git a/src/components/Image/index.tsx b/src/components/Common/Image/index.tsx similarity index 100% rename from src/components/Image/index.tsx rename to src/components/Common/Image/index.tsx diff --git a/src/components/Modal/AlertModal/index.tsx b/src/components/Common/Modal/AlertModal/index.tsx similarity index 93% rename from src/components/Modal/AlertModal/index.tsx rename to src/components/Common/Modal/AlertModal/index.tsx index f89a2551..51cad411 100644 --- a/src/components/Modal/AlertModal/index.tsx +++ b/src/components/Common/Modal/AlertModal/index.tsx @@ -1,5 +1,5 @@ -import Button from '@components/Button'; -import Icon from '@components/Icon'; +import Button from '@components/Common/Button'; +import Icon from '@components/Common/Icon'; import { css } from '@emotion/react'; import { THEME } from '@styles/ThemeProvider/theme'; import { IconKind } from '@type/styles/icon'; diff --git a/src/components/Modal/ConfirmModal/index.tsx b/src/components/Common/Modal/ConfirmModal/index.tsx similarity index 96% rename from src/components/Modal/ConfirmModal/index.tsx rename to src/components/Common/Modal/ConfirmModal/index.tsx index d0016eb3..a39e9883 100644 --- a/src/components/Modal/ConfirmModal/index.tsx +++ b/src/components/Common/Modal/ConfirmModal/index.tsx @@ -1,4 +1,4 @@ -import Button from '@components/Button'; +import Button from '@components/Common/Button'; import { css } from '@emotion/react'; import { THEME } from '@styles/ThemeProvider/theme'; import React from 'react'; diff --git a/src/components/Modal/Modals/index.tsx b/src/components/Common/Modal/Modals/index.tsx similarity index 100% rename from src/components/Modal/Modals/index.tsx rename to src/components/Common/Modal/Modals/index.tsx diff --git a/src/components/Modal/SuggestionModal/index.tsx b/src/components/Common/Modal/SuggestionModal/index.tsx similarity index 97% rename from src/components/Modal/SuggestionModal/index.tsx rename to src/components/Common/Modal/SuggestionModal/index.tsx index 27022104..6c9ddef8 100644 --- a/src/components/Modal/SuggestionModal/index.tsx +++ b/src/components/Common/Modal/SuggestionModal/index.tsx @@ -1,6 +1,6 @@ import http from '@apis/http'; -import Button from '@components/Button'; -import Icon from '@components/Icon'; +import Button from '@components/Common/Button'; +import Icon from '@components/Common/Icon'; import { SERVER_URL } from '@config/index'; import { MODAL_BUTTON_MESSAGE, MODAL_MESSAGE } from '@constants/modal-messages'; import PLCACEHOLDER_MESSAGES from '@constants/placeholder-message'; diff --git a/src/components/Modal/index.tsx b/src/components/Common/Modal/index.tsx similarity index 100% rename from src/components/Modal/index.tsx rename to src/components/Common/Modal/index.tsx diff --git a/src/components/Toast/Toasts/index.tsx b/src/components/Common/Toast/Toasts/index.tsx similarity index 100% rename from src/components/Toast/Toasts/index.tsx rename to src/components/Common/Toast/Toasts/index.tsx diff --git a/src/components/Toast/index.tsx b/src/components/Common/Toast/index.tsx similarity index 100% rename from src/components/Toast/index.tsx rename to src/components/Common/Toast/index.tsx diff --git a/src/components/FooterTab/index.tsx b/src/components/FooterTab/index.tsx index f25fc173..545fcd6d 100644 --- a/src/components/FooterTab/index.tsx +++ b/src/components/FooterTab/index.tsx @@ -1,9 +1,9 @@ -import Icon from '@components/Icon'; +import Icon from '@components/Common/Icon'; import styled from '@emotion/styled'; import useRouter from '@hooks/useRouter'; import { THEME } from '@styles/ThemeProvider/theme'; -const footerTabs = [ +const FOOTER_TABS = [ { kind: 'map', label: '지도', path: '/map' }, { kind: 'home', label: '홈', path: '/' }, { kind: 'accountCircle', label: '마이', path: '/my' }, @@ -16,7 +16,7 @@ const FooterTab = () => { return (