From c799b269bb1adcf69b265dcb00805191071423b4 Mon Sep 17 00:00:00 2001 From: esthel Date: Tue, 5 Dec 2023 02:32:51 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20alias=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/App.tsx | 12 ++++++------ front/src/GlobalStyles.tsx | 2 +- front/src/components/Button/Button.tsx | 2 +- front/src/components/Button/StepButton.tsx | 4 ++-- front/src/components/InputSnowball/InputSnowball.tsx | 2 +- front/src/components/Msg/Msg.tsx | 2 +- .../components/SnowGlobeCanvas/SnowGlobeCanvas.tsx | 4 ++-- .../src/components/SnowGlobeCanvas/models/Bottom.tsx | 4 ++-- front/src/components/SnowGlobeCanvas/models/Deco.tsx | 4 ++-- .../components/SnowGlobeCanvas/models/MainDeco.tsx | 4 ++-- .../components/SnowGlobeCanvas/models/Raycaster.tsx | 2 +- front/src/components/SnowGlobeCanvas/models/Snow.tsx | 2 +- front/src/pages/Intro/Intro.tsx | 2 +- front/src/pages/Intro/IntroButtonBox.tsx | 4 ++-- front/src/pages/Intro/LoginBox.tsx | 2 +- front/src/pages/Intro/MsgBox.tsx | 2 +- front/src/pages/Main/ListMsgs.tsx | 4 ++-- front/src/pages/Main/Main.tsx | 2 +- front/src/pages/Main/MainButtonBox.tsx | 6 +++--- front/src/pages/Main/MenuModal.tsx | 2 +- front/src/pages/Make/Nickname/Nickname.tsx | 4 ++-- front/src/pages/Make/Snowball/MainDeco/DecoBox.tsx | 2 +- .../src/pages/Make/Snowball/MainDeco/DecoEnroll.tsx | 2 +- front/src/pages/Make/Snowball/MainDeco/MainDeco.tsx | 2 +- .../src/pages/Make/Snowball/MainDeco/MakeButton.tsx | 2 +- .../Make/Snowball/MainDeco/MakeSnowballCanvas.tsx | 4 ++-- front/src/pages/Make/Snowball/MainDeco/MsgBox.tsx | 6 +++--- front/src/pages/Make/Snowball/MainDeco/Steps.tsx | 4 ++-- front/src/pages/Make/Snowball/Snowball.tsx | 6 +++--- front/src/pages/Visit/Deco/Deco.tsx | 2 +- front/src/pages/Visit/Deco/DecoBox.tsx | 2 +- front/src/pages/Visit/Deco/DecoCanvas/DecoCanvas.tsx | 2 +- front/src/pages/Visit/Deco/DecoCanvas/DecoModel.tsx | 4 ++-- front/src/pages/Visit/Deco/DecoEnroll.tsx | 2 +- front/src/pages/Visit/Deco/MsgBox.tsx | 4 ++-- front/src/pages/Visit/Deco/PostButton.tsx | 2 +- front/src/pages/Visit/Deco/Steps.tsx | 4 ++-- front/src/pages/Visit/SnowBallProvider.tsx | 2 +- front/src/pages/Visit/Visit.tsx | 2 +- front/src/pages/Visit/VisitBody.tsx | 2 +- front/src/pages/Visit/VisitBottom.tsx | 4 ++-- front/src/pages/Visit/VisitHeader.tsx | 4 ++-- front/src/styled.d.ts | 2 +- front/tsconfig.json | 3 ++- front/vite.config.ts | 3 ++- 45 files changed, 73 insertions(+), 71 deletions(-) diff --git a/front/src/App.tsx b/front/src/App.tsx index b29f32f..ba4590e 100644 --- a/front/src/App.tsx +++ b/front/src/App.tsx @@ -1,13 +1,13 @@ import { BrowserRouter, Routes, Route, Outlet } from 'react-router-dom'; import styled, { ThemeProvider } from 'styled-components'; import GlobalStyles from './GlobalStyles'; -import { theme } from './utils'; +import { theme } from '@utils'; +import * as Pages from '@pages'; +import { Song } from '@components'; import { IsLogin, IsSnowballData } from './router'; -import * as Pages from './pages'; -import { Song } from './components'; -import { SnowBallProvider } from './pages/Visit/SnowBallProvider'; -import { MessageProvider } from './pages/Visit/MessageProvider'; -import { DecoProvider } from './pages/Visit/Deco/DecoProvider'; +import { SnowBallProvider } from '@pages/Visit/SnowBallProvider'; +import { MessageProvider } from '@pages/Visit/MessageProvider'; +import { DecoProvider } from '@pages/Visit/Deco/DecoProvider'; const Outer = styled.div` position: relative; diff --git a/front/src/GlobalStyles.tsx b/front/src/GlobalStyles.tsx index e7c7711..407c900 100644 --- a/front/src/GlobalStyles.tsx +++ b/front/src/GlobalStyles.tsx @@ -1,6 +1,6 @@ import { createGlobalStyle } from 'styled-components'; import reset from 'styled-reset'; -import { theme } from './utils'; +import { theme } from '@utils'; const GlobalStyles = createGlobalStyle` ${reset} diff --git a/front/src/components/Button/Button.tsx b/front/src/components/Button/Button.tsx index 012a7ac..42c9a62 100644 --- a/front/src/components/Button/Button.tsx +++ b/front/src/components/Button/Button.tsx @@ -1,5 +1,5 @@ import styled from 'styled-components'; -import { LongButton } from '../../utils'; +import { LongButton } from '@utils'; interface ButtonColor { color: string; diff --git a/front/src/components/Button/StepButton.tsx b/front/src/components/Button/StepButton.tsx index 417eeb0..0409832 100644 --- a/front/src/components/Button/StepButton.tsx +++ b/front/src/components/Button/StepButton.tsx @@ -1,7 +1,7 @@ import { useContext } from 'react'; import styled from 'styled-components'; -import { LongButton } from '../../utils'; -import { DecoContext } from '../../pages/Make/Snowball/MainDeco/DecoProvider'; +import { LongButton } from '@utils'; +import { DecoContext } from '@pages/Make/Snowball/MainDeco/DecoProvider'; interface ButtonColor { color: string; diff --git a/front/src/components/InputSnowball/InputSnowball.tsx b/front/src/components/InputSnowball/InputSnowball.tsx index 7ec5b9a..2d911d1 100644 --- a/front/src/components/InputSnowball/InputSnowball.tsx +++ b/front/src/components/InputSnowball/InputSnowball.tsx @@ -1,6 +1,6 @@ import { useContext, useState } from 'react'; import styled from 'styled-components'; -import { DecoContext } from '../../pages/Make/Snowball/MainDeco/DecoProvider'; +import { DecoContext } from '@pages/Make/Snowball/MainDeco/DecoProvider'; const StyledLetterBox = styled.div` width: 80%; diff --git a/front/src/components/Msg/Msg.tsx b/front/src/components/Msg/Msg.tsx index 25ccad2..8c6b400 100644 --- a/front/src/components/Msg/Msg.tsx +++ b/front/src/components/Msg/Msg.tsx @@ -1,6 +1,6 @@ import { useContext, useState } from 'react'; import styled from 'styled-components'; -import { DecoContext } from '../../pages/Visit/Deco/DecoProvider'; +import { DecoContext } from '@pages/Visit/Deco/DecoProvider'; interface MsgProps { color: string; diff --git a/front/src/components/SnowGlobeCanvas/SnowGlobeCanvas.tsx b/front/src/components/SnowGlobeCanvas/SnowGlobeCanvas.tsx index f52b318..874e33e 100644 --- a/front/src/components/SnowGlobeCanvas/SnowGlobeCanvas.tsx +++ b/front/src/components/SnowGlobeCanvas/SnowGlobeCanvas.tsx @@ -2,11 +2,11 @@ import { useContext, useRef } from 'react'; import { OrbitControls } from '@react-three/drei'; import { Canvas } from '@react-three/fiber'; import * as THREE from 'three'; -import { CanvasContainer, getDecoPoisition } from '../../utils'; +import { CanvasContainer, getDecoPoisition } from '@utils'; import * as Models from './models'; import { Prev } from '../Prev'; +import { SnowBallContext } from '@pages/Visit/SnowBallProvider'; import { PrevProvider } from './PrevProvider'; -import { SnowBallContext } from '../../pages/Visit/SnowBallProvider'; const SnowGlobeCanvas = () => { const isClicked = useRef(false); diff --git a/front/src/components/SnowGlobeCanvas/models/Bottom.tsx b/front/src/components/SnowGlobeCanvas/models/Bottom.tsx index c243682..9e5424f 100644 --- a/front/src/components/SnowGlobeCanvas/models/Bottom.tsx +++ b/front/src/components/SnowGlobeCanvas/models/Bottom.tsx @@ -1,8 +1,8 @@ import React from 'react'; import { useGLTF } from '@react-three/drei'; import * as THREE from 'three'; -import { BOTTOM } from '../../../constants/deco'; -import * as MeshUtils from '../../../utils/meshUtils'; +import * as MeshUtils from '@utils/meshUtils'; +import { BOTTOM } from '@constants'; interface BottomProps { scale: number; diff --git a/front/src/components/SnowGlobeCanvas/models/Deco.tsx b/front/src/components/SnowGlobeCanvas/models/Deco.tsx index 21384e3..ab7bcb1 100644 --- a/front/src/components/SnowGlobeCanvas/models/Deco.tsx +++ b/front/src/components/SnowGlobeCanvas/models/Deco.tsx @@ -1,7 +1,7 @@ import { useGLTF } from '@react-three/drei'; import * as THREE from 'three'; -import { DECO, MSG_COLOR } from '../../../constants/deco'; -import * as MeshUtils from '../../../utils/meshUtils'; +import * as MeshUtils from '@utils/meshUtils'; +import { DECO, MSG_COLOR } from '@constants'; interface DecoProps { id: number; diff --git a/front/src/components/SnowGlobeCanvas/models/MainDeco.tsx b/front/src/components/SnowGlobeCanvas/models/MainDeco.tsx index eb3b3f5..c728815 100644 --- a/front/src/components/SnowGlobeCanvas/models/MainDeco.tsx +++ b/front/src/components/SnowGlobeCanvas/models/MainDeco.tsx @@ -2,8 +2,8 @@ import React, { useRef } from 'react'; import { useFrame } from '@react-three/fiber'; import { useGLTF } from '@react-three/drei'; import * as THREE from 'three'; -import { MAIN } from '../../../constants/deco'; -import { makeColorChangedMaterial } from '../../../utils/meshUtils'; +import { makeColorChangedMaterial } from '@utils/meshUtils'; +import { MAIN } from '@constants'; interface MyModelProps { id: number; diff --git a/front/src/components/SnowGlobeCanvas/models/Raycaster.tsx b/front/src/components/SnowGlobeCanvas/models/Raycaster.tsx index fa1d503..867a1f8 100644 --- a/front/src/components/SnowGlobeCanvas/models/Raycaster.tsx +++ b/front/src/components/SnowGlobeCanvas/models/Raycaster.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useRef, useContext } from 'react'; import { useThree, useFrame } from '@react-three/fiber'; import * as THREE from 'three'; -import { MessageContext } from '../../../pages/Visit/MessageProvider'; +import { MessageContext } from '@pages/Visit/MessageProvider'; import { PrevContext } from '../PrevProvider'; interface RaycasterProps { diff --git a/front/src/components/SnowGlobeCanvas/models/Snow.tsx b/front/src/components/SnowGlobeCanvas/models/Snow.tsx index df3e7ea..69b8333 100644 --- a/front/src/components/SnowGlobeCanvas/models/Snow.tsx +++ b/front/src/components/SnowGlobeCanvas/models/Snow.tsx @@ -2,7 +2,7 @@ import { useRef } from 'react'; import { useFrame } from '@react-three/fiber'; import { useGLTF } from '@react-three/drei'; import * as THREE from 'three'; -import { makeColorChangedMaterial } from '../../../utils/meshUtils'; +import { makeColorChangedMaterial } from '@utils/meshUtils'; interface SnowProps { radius: number; diff --git a/front/src/pages/Intro/Intro.tsx b/front/src/pages/Intro/Intro.tsx index a982bf1..5c1b87f 100644 --- a/front/src/pages/Intro/Intro.tsx +++ b/front/src/pages/Intro/Intro.tsx @@ -1,5 +1,5 @@ import styled from 'styled-components'; -import { SnowGlobeCanvas, UIContainer } from '../../../src/components'; +import { SnowGlobeCanvas, UIContainer } from '@components'; import IntroButtonBox from './IntroButtonBox'; import MsgBox from './MsgBox'; import { MessageProvider } from '../Visit/MessageProvider'; diff --git a/front/src/pages/Intro/IntroButtonBox.tsx b/front/src/pages/Intro/IntroButtonBox.tsx index d1f54da..7973c12 100644 --- a/front/src/pages/Intro/IntroButtonBox.tsx +++ b/front/src/pages/Intro/IntroButtonBox.tsx @@ -1,7 +1,7 @@ import { useState } from 'react'; import styled from 'styled-components'; -import { theme } from '../../utils'; -import { Button } from '../../components'; +import { theme } from '@utils'; +import { Button } from '@components'; import Introduce from './Introduce'; import LoginBox from './LoginBox'; diff --git a/front/src/pages/Intro/LoginBox.tsx b/front/src/pages/Intro/LoginBox.tsx index 58b7389..1eed8bc 100644 --- a/front/src/pages/Intro/LoginBox.tsx +++ b/front/src/pages/Intro/LoginBox.tsx @@ -1,6 +1,6 @@ import React, { useState, useRef } from 'react'; import styled from 'styled-components'; -import { BlurBody } from '../../utils'; +import { BlurBody } from '@utils'; interface LoginProps { view: [boolean, React.Dispatch>]; diff --git a/front/src/pages/Intro/MsgBox.tsx b/front/src/pages/Intro/MsgBox.tsx index 5aa03ff..05d1d32 100644 --- a/front/src/pages/Intro/MsgBox.tsx +++ b/front/src/pages/Intro/MsgBox.tsx @@ -1,5 +1,5 @@ import { useContext } from 'react'; -import { Msg } from '../../components'; +import { Msg } from '@components'; import { MessageContext } from '../Visit/MessageProvider'; import { SnowBallContext } from '../Visit/SnowBallProvider'; diff --git a/front/src/pages/Main/ListMsgs.tsx b/front/src/pages/Main/ListMsgs.tsx index f66ce46..35dd708 100644 --- a/front/src/pages/Main/ListMsgs.tsx +++ b/front/src/pages/Main/ListMsgs.tsx @@ -1,8 +1,8 @@ import { useEffect, useState } from 'react'; import axios from 'axios'; import styled from 'styled-components'; -import { ListMsg, Prev } from '../../components'; -import { MSG_COLOR } from '../../constants/deco'; +import { ListMsg, Prev } from '@components'; +import { MSG_COLOR } from '@constants'; interface ListMsgProps { set: React.Dispatch>; diff --git a/front/src/pages/Main/Main.tsx b/front/src/pages/Main/Main.tsx index 2f163d1..e8f8c7b 100644 --- a/front/src/pages/Main/Main.tsx +++ b/front/src/pages/Main/Main.tsx @@ -1,7 +1,7 @@ import { useState, useEffect, useRef } from 'react'; import { useNavigate, useSearchParams } from 'react-router-dom'; import styled from 'styled-components'; -import { SnowGlobeCanvas, UIContainer } from '../../components'; +import { SnowGlobeCanvas, UIContainer } from '@components'; import MainButtonBox from './MainButtonBox'; const StyledLeft = styled.img` diff --git a/front/src/pages/Main/MainButtonBox.tsx b/front/src/pages/Main/MainButtonBox.tsx index 7f4c008..00bd3dd 100644 --- a/front/src/pages/Main/MainButtonBox.tsx +++ b/front/src/pages/Main/MainButtonBox.tsx @@ -1,10 +1,10 @@ import { useState, useRef } from 'react'; +import axios from 'axios'; import styled from 'styled-components'; -import { Container } from '../../utils'; -import { HeaderText } from '../../components'; +import { Container } from '@utils'; +import { HeaderText } from '@components'; import MenuModal from './MenuModal'; import ListMsgs from './ListMsgs'; -import axios from 'axios'; const StyledMenu = styled.img` position: fixed; diff --git a/front/src/pages/Main/MenuModal.tsx b/front/src/pages/Main/MenuModal.tsx index 1cdb232..8566e88 100644 --- a/front/src/pages/Main/MenuModal.tsx +++ b/front/src/pages/Main/MenuModal.tsx @@ -1,6 +1,6 @@ import { useNavigate, NavigateFunction } from 'react-router-dom'; import styled from 'styled-components'; -import mock from '../../mockdata.json'; +import mock from '@mock'; interface ModalProps { set: React.Dispatch>; diff --git a/front/src/pages/Make/Nickname/Nickname.tsx b/front/src/pages/Make/Nickname/Nickname.tsx index 3dbd325..fb81139 100644 --- a/front/src/pages/Make/Nickname/Nickname.tsx +++ b/front/src/pages/Make/Nickname/Nickname.tsx @@ -2,8 +2,8 @@ import { useState, useRef, useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import axios from 'axios'; import styled from 'styled-components'; -import { theme } from '../../../utils'; -import { Button } from '../../../components'; +import { theme } from '@utils'; +import { Button } from '@components'; const StyledWrap = styled.div` width: 100%; diff --git a/front/src/pages/Make/Snowball/MainDeco/DecoBox.tsx b/front/src/pages/Make/Snowball/MainDeco/DecoBox.tsx index 2c18924..89d10d1 100644 --- a/front/src/pages/Make/Snowball/MainDeco/DecoBox.tsx +++ b/front/src/pages/Make/Snowball/MainDeco/DecoBox.tsx @@ -1,6 +1,6 @@ import { useContext } from 'react'; import styled from 'styled-components'; -import { MAIN, BOTTOM } from '../../../../constants/deco'; +import { MAIN, BOTTOM } from '@constants'; import { DecoContext } from './DecoProvider'; interface DecoProps { diff --git a/front/src/pages/Make/Snowball/MainDeco/DecoEnroll.tsx b/front/src/pages/Make/Snowball/MainDeco/DecoEnroll.tsx index 59e11a0..465f657 100644 --- a/front/src/pages/Make/Snowball/MainDeco/DecoEnroll.tsx +++ b/front/src/pages/Make/Snowball/MainDeco/DecoEnroll.tsx @@ -2,7 +2,7 @@ import React, { useState, useRef } from 'react'; import { NavigateFunction, useNavigate } from 'react-router-dom'; import axios from 'axios'; import styled from 'styled-components'; -import { theme, BlurBody } from '../../../../utils'; +import { theme, BlurBody } from '@utils'; interface NaviProps { visible: [number, React.Dispatch>]; diff --git a/front/src/pages/Make/Snowball/MainDeco/MainDeco.tsx b/front/src/pages/Make/Snowball/MainDeco/MainDeco.tsx index 1f91603..b778d8c 100644 --- a/front/src/pages/Make/Snowball/MainDeco/MainDeco.tsx +++ b/front/src/pages/Make/Snowball/MainDeco/MainDeco.tsx @@ -1,4 +1,4 @@ -import { Prev, UIContainer } from '../../../../components'; +import { Prev, UIContainer } from '@components'; import Steps from './Steps'; import { DecoProvider } from './DecoProvider'; import MakeSnowballCanvas from './MakeSnowballCanvas'; diff --git a/front/src/pages/Make/Snowball/MainDeco/MakeButton.tsx b/front/src/pages/Make/Snowball/MainDeco/MakeButton.tsx index 37b4533..9b976a7 100644 --- a/front/src/pages/Make/Snowball/MainDeco/MakeButton.tsx +++ b/front/src/pages/Make/Snowball/MainDeco/MakeButton.tsx @@ -1,7 +1,7 @@ import { useState, useContext } from 'react'; import axios from 'axios'; import styled from 'styled-components'; -import { LongButton } from '../../../../utils'; +import { LongButton } from '@utils'; import { DecoContext } from './DecoProvider'; interface MakeButtonProps { diff --git a/front/src/pages/Make/Snowball/MainDeco/MakeSnowballCanvas.tsx b/front/src/pages/Make/Snowball/MainDeco/MakeSnowballCanvas.tsx index 3b5704a..8f8fec6 100644 --- a/front/src/pages/Make/Snowball/MainDeco/MakeSnowballCanvas.tsx +++ b/front/src/pages/Make/Snowball/MainDeco/MakeSnowballCanvas.tsx @@ -2,8 +2,8 @@ import { useContext } from 'react'; import { Canvas } from '@react-three/fiber'; import { OrbitControls } from '@react-three/drei'; import * as THREE from 'three'; -import { CanvasContainer } from '../../../../utils'; -import * as Models from '../../../../components/SnowGlobeCanvas/models'; +import { CanvasContainer } from '@utils'; +import * as Models from '@components/SnowGlobeCanvas/models'; import { DecoContext } from './DecoProvider'; const MainSnowballCavnas = () => { diff --git a/front/src/pages/Make/Snowball/MainDeco/MsgBox.tsx b/front/src/pages/Make/Snowball/MainDeco/MsgBox.tsx index d2735fd..ebd95fa 100644 --- a/front/src/pages/Make/Snowball/MainDeco/MsgBox.tsx +++ b/front/src/pages/Make/Snowball/MainDeco/MsgBox.tsx @@ -1,8 +1,8 @@ import { useContext } from 'react'; -import { DecoContext } from './DecoProvider'; -import { MSG_COLOR } from '../../../../constants/deco'; -import { Msg } from '../../../../components'; import styled from 'styled-components'; +import { Msg } from '@components'; +import { MSG_COLOR } from '@constants'; +import { DecoContext } from './DecoProvider'; interface MsgBoxProps { isInput: boolean; diff --git a/front/src/pages/Make/Snowball/MainDeco/Steps.tsx b/front/src/pages/Make/Snowball/MainDeco/Steps.tsx index af08818..68f4b3c 100644 --- a/front/src/pages/Make/Snowball/MainDeco/Steps.tsx +++ b/front/src/pages/Make/Snowball/MainDeco/Steps.tsx @@ -1,7 +1,7 @@ import { useState, useRef, useEffect, useContext } from 'react'; import styled from 'styled-components'; -import { theme, Container } from '../../../../utils'; -import { InputSnowball, HeaderText, StepButton } from '../../../../components'; +import { theme, Container } from '@utils'; +import { InputSnowball, HeaderText, StepButton } from '@components'; import MakeButton from './MakeButton'; import DecoBox from './DecoBox'; import DecoEnroll from './DecoEnroll'; diff --git a/front/src/pages/Make/Snowball/Snowball.tsx b/front/src/pages/Make/Snowball/Snowball.tsx index 9f84b8c..c0566dc 100644 --- a/front/src/pages/Make/Snowball/Snowball.tsx +++ b/front/src/pages/Make/Snowball/Snowball.tsx @@ -1,9 +1,9 @@ import { useState } from 'react'; import styled from 'styled-components'; -import { theme } from '../../../utils'; -import { SnowGlobeCanvas, Button } from '../../../components'; +import { theme } from '@utils'; +import { SnowGlobeCanvas, Button } from '@components'; +import mock from '@mock'; import { MainDeco } from './MainDeco'; -import mock from '../../../mockdata.json'; const StyledHeader = styled.div` position: absolute; diff --git a/front/src/pages/Visit/Deco/Deco.tsx b/front/src/pages/Visit/Deco/Deco.tsx index dcc4366..e03b40a 100644 --- a/front/src/pages/Visit/Deco/Deco.tsx +++ b/front/src/pages/Visit/Deco/Deco.tsx @@ -1,4 +1,4 @@ -import { Prev, UIContainer } from '../../../components'; +import { Prev, UIContainer } from '@components'; import Steps from './Steps'; import DecoCavnas from './DecoCanvas/DecoCanvas'; diff --git a/front/src/pages/Visit/Deco/DecoBox.tsx b/front/src/pages/Visit/Deco/DecoBox.tsx index a845bf3..43b9724 100644 --- a/front/src/pages/Visit/Deco/DecoBox.tsx +++ b/front/src/pages/Visit/Deco/DecoBox.tsx @@ -1,6 +1,6 @@ import { useContext } from 'react'; import styled from 'styled-components'; -import { DECO, MSG_COLOR } from '../../../constants/deco'; +import { DECO, MSG_COLOR } from '@constants'; import { DecoContext } from './DecoProvider'; interface DecoProps { diff --git a/front/src/pages/Visit/Deco/DecoCanvas/DecoCanvas.tsx b/front/src/pages/Visit/Deco/DecoCanvas/DecoCanvas.tsx index 8887041..ab66117 100644 --- a/front/src/pages/Visit/Deco/DecoCanvas/DecoCanvas.tsx +++ b/front/src/pages/Visit/Deco/DecoCanvas/DecoCanvas.tsx @@ -1,6 +1,6 @@ import { Canvas } from '@react-three/fiber'; import { OrbitControls } from '@react-three/drei'; -import { CanvasContainer } from '../../../../utils'; +import { CanvasContainer } from '@utils'; import DecoModel from './DecoModel'; const DecoCavnas = () => { diff --git a/front/src/pages/Visit/Deco/DecoCanvas/DecoModel.tsx b/front/src/pages/Visit/Deco/DecoCanvas/DecoModel.tsx index 9309af3..372cdf2 100644 --- a/front/src/pages/Visit/Deco/DecoCanvas/DecoModel.tsx +++ b/front/src/pages/Visit/Deco/DecoCanvas/DecoModel.tsx @@ -1,8 +1,8 @@ import { useContext } from 'react'; import { useGLTF } from '@react-three/drei'; import * as THREE from 'three'; -import { makeColorChangedMaterial } from '../../../../utils/meshUtils'; -import { DECO } from '../../../../constants/deco'; +import { makeColorChangedMaterial } from '@utils/meshUtils'; +import { DECO } from '@constants'; import { DecoContext } from '../DecoProvider'; const DecoModel = () => { diff --git a/front/src/pages/Visit/Deco/DecoEnroll.tsx b/front/src/pages/Visit/Deco/DecoEnroll.tsx index 32f1074..ee989e0 100644 --- a/front/src/pages/Visit/Deco/DecoEnroll.tsx +++ b/front/src/pages/Visit/Deco/DecoEnroll.tsx @@ -1,7 +1,7 @@ import React, { useState, useRef } from 'react'; import { NavigateFunction, useNavigate, useParams } from 'react-router-dom'; import styled from 'styled-components'; -import { theme, BlurBody } from '../../../utils'; +import { theme, BlurBody } from '@utils'; interface NaviProps { visible: [number, React.Dispatch>]; diff --git a/front/src/pages/Visit/Deco/MsgBox.tsx b/front/src/pages/Visit/Deco/MsgBox.tsx index 36245ee..047a8d6 100644 --- a/front/src/pages/Visit/Deco/MsgBox.tsx +++ b/front/src/pages/Visit/Deco/MsgBox.tsx @@ -1,7 +1,7 @@ import { useContext } from 'react'; import styled from 'styled-components'; -import { MSG_COLOR } from '../../../constants/deco'; -import { Msg } from '../../../components'; +import { Msg } from '@components'; +import { MSG_COLOR } from '@constants'; import { DecoContext } from './DecoProvider'; import { SnowBallContext } from '../SnowBallProvider'; diff --git a/front/src/pages/Visit/Deco/PostButton.tsx b/front/src/pages/Visit/Deco/PostButton.tsx index 67b8ea1..132eddc 100644 --- a/front/src/pages/Visit/Deco/PostButton.tsx +++ b/front/src/pages/Visit/Deco/PostButton.tsx @@ -2,7 +2,7 @@ import { useContext, useState } from 'react'; import { useNavigate } from 'react-router-dom'; import axios from 'axios'; import styled from 'styled-components'; -import { LongButton } from '../../../utils'; +import { LongButton } from '@utils'; import { DecoContext } from './DecoProvider'; import { SnowBallContext } from '../SnowBallProvider'; diff --git a/front/src/pages/Visit/Deco/Steps.tsx b/front/src/pages/Visit/Deco/Steps.tsx index 6cb61d0..bf48f8c 100644 --- a/front/src/pages/Visit/Deco/Steps.tsx +++ b/front/src/pages/Visit/Deco/Steps.tsx @@ -1,7 +1,7 @@ import { useState, useRef, useEffect, useContext } from 'react'; import styled from 'styled-components'; -import { theme, Container } from '../../../utils'; -import { HeaderText, StepButton } from '../../../components'; +import { theme, Container } from '@utils'; +import { HeaderText, StepButton } from '@components'; import DecoBox from './DecoBox'; import MsgBox from './MsgBox'; import DecoEnroll from './DecoEnroll'; diff --git a/front/src/pages/Visit/SnowBallProvider.tsx b/front/src/pages/Visit/SnowBallProvider.tsx index 8d5cb8f..b9fdbf9 100644 --- a/front/src/pages/Visit/SnowBallProvider.tsx +++ b/front/src/pages/Visit/SnowBallProvider.tsx @@ -1,7 +1,7 @@ import React, { useState, createContext, useEffect } from 'react'; -import mockData from '../../mockdata.json'; import { useNavigate, useParams } from 'react-router-dom'; import axios from 'axios'; +import mockData from '@mock'; interface SnowBallContextType { snowBallData: SnowBallData; diff --git a/front/src/pages/Visit/Visit.tsx b/front/src/pages/Visit/Visit.tsx index 0925880..9dba624 100644 --- a/front/src/pages/Visit/Visit.tsx +++ b/front/src/pages/Visit/Visit.tsx @@ -1,4 +1,4 @@ -import { SnowGlobeCanvas, UIContainer } from '../../components'; +import { SnowGlobeCanvas, UIContainer } from '@components'; import VisitHeader from './VisitHeader'; import VisitBody from './VisitBody'; import VisitBottom from './VisitBottom'; diff --git a/front/src/pages/Visit/VisitBody.tsx b/front/src/pages/Visit/VisitBody.tsx index 369a090..51628f5 100644 --- a/front/src/pages/Visit/VisitBody.tsx +++ b/front/src/pages/Visit/VisitBody.tsx @@ -1,7 +1,7 @@ import { useContext } from 'react'; import styled from 'styled-components'; import axios from 'axios'; -import { Msg } from '../../components'; +import { Msg } from '@components'; import { MessageContext } from './MessageProvider'; import { SnowBallContext, SnowBallData } from './SnowBallProvider'; diff --git a/front/src/pages/Visit/VisitBottom.tsx b/front/src/pages/Visit/VisitBottom.tsx index e8d6036..2ee33ad 100644 --- a/front/src/pages/Visit/VisitBottom.tsx +++ b/front/src/pages/Visit/VisitBottom.tsx @@ -1,7 +1,7 @@ import { useState, useEffect } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; -import { theme, Container } from '../../utils'; -import { Button } from '../../components'; +import { theme, Container } from '@utils'; +import { Button } from '@components'; const VisitBottom = () => { const navigate = useNavigate(); diff --git a/front/src/pages/Visit/VisitHeader.tsx b/front/src/pages/Visit/VisitHeader.tsx index 3a1e3c4..f2f9253 100644 --- a/front/src/pages/Visit/VisitHeader.tsx +++ b/front/src/pages/Visit/VisitHeader.tsx @@ -1,7 +1,7 @@ import { useContext } from 'react'; import styled from 'styled-components'; -import { Container } from '../../utils'; -import { HeaderText } from '../../components'; +import { Container } from '@utils'; +import { HeaderText } from '@components'; import { SnowBallContext } from './SnowBallProvider'; const StyledLetter = styled.div` diff --git a/front/src/styled.d.ts b/front/src/styled.d.ts index 59e6b45..8a22fac 100644 --- a/front/src/styled.d.ts +++ b/front/src/styled.d.ts @@ -1,5 +1,5 @@ import 'styled-components'; -import theme from './utils/theme'; +import { theme } from '@utils'; type ThemeType = typeof theme; diff --git a/front/tsconfig.json b/front/tsconfig.json index a3b73f8..51a9f5c 100644 --- a/front/tsconfig.json +++ b/front/tsconfig.json @@ -14,7 +14,8 @@ "@pages": ["pages/index"], "@pages/*": ["pages/*"], "@utils": ["utils/index"], - "@utils/*": ["utils/*"] + "@utils/*": ["utils/*"], + "@mock": ["mockdata.json"] }, /* Bundler mode */ diff --git a/front/vite.config.ts b/front/vite.config.ts index f5ca5fe..b5ab63b 100644 --- a/front/vite.config.ts +++ b/front/vite.config.ts @@ -21,7 +21,8 @@ export default defineConfig({ '@components': '/src/components', '@constants': '/src/constants', '@pages': '/src/pages', - '@utils': '/src/utils' + '@utils': '/src/utils', + '@mock': '/src/mockdata.json' } } });