diff --git a/src/App.tsx b/src/App.tsx index 74962c4..ffc938b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -6,6 +6,7 @@ import MainDrawer from './components/common/MainDrawer'; import LookbookDetailpage from './pages/LookbookDetailpage'; import Mainpage from './pages/MainPage'; import MyPage from './pages/MyPage'; +import RegisterPage from './pages/RegisterPage'; export default function App() { const queryClient = new QueryClient(); @@ -18,6 +19,7 @@ export default function App() { } /> } /> + } /> } diff --git a/src/assets/images/user.png b/src/assets/images/user.png new file mode 100644 index 0000000..c72985e Binary files /dev/null and b/src/assets/images/user.png differ diff --git a/src/components/MainLayout/InfoBox/Temperature.tsx b/src/components/MainLayout/InfoBox/Temperature.tsx new file mode 100644 index 0000000..be0a39e --- /dev/null +++ b/src/components/MainLayout/InfoBox/Temperature.tsx @@ -0,0 +1,71 @@ +import { Box, Tooltip, Typography } from '@mui/material'; +import lottie from 'lottie-web'; +import { useEffect, useRef } from 'react'; +import { useRecoilValue } from 'recoil'; + +import weatherSky from '../../../assets/data/weatherSky'; +import { weatherDataState } from '../../../utils/Recoil'; +import { WeatherType } from '../../../utils/types'; + +type WeatherProps = { + weatherData: WeatherType | undefined; +}; + +const WeatherSkyLottie = ({ weatherData }: WeatherProps) => { + // weatherData에 따라 다른 애니메이션 데이터를 선택 + const getAnimationData = () => { + if (weatherData?.sky === 1) { + return require('../../../assets/lotties/weather/sunny.json'); + } else if (weatherData?.sky === 3) { + return require('../../../assets/lotties/weather/cloudy.json'); + } else if (weatherData?.sky === 4) { + return require('../../../assets/lotties/weather/rainy.json'); + } else if (weatherData?.sky === 5) { + return require('../../../assets/lotties/weather/snow.json'); + } + // 기본값으로 사용할 애니메이션 데이터 + return require('../../../assets/lotties/weather/sunny.json'); + }; + + const animationData = getAnimationData(); + // const animationData = require('../../assets/lotties/allRain.json'); + + //lottie + const element = useRef(null); + useEffect(() => { + const animation = lottie.loadAnimation({ + container: element.current as HTMLDivElement, + renderer: 'svg', + loop: true, + autoplay: true, + animationData: animationData, + }); + + return () => { + animation.destroy(); // lottie-web 인스턴스 제거 + }; + }, [weatherData]); + return ( + + + + ); +}; + +export default function TemperatureBox() { + const weatherData = useRecoilValue(weatherDataState); + + return ( + + + + {weatherData?.windChill} °C + + + ); +} diff --git a/src/components/User/InputBox.tsx b/src/components/User/InputBox.tsx new file mode 100644 index 0000000..fb4579c --- /dev/null +++ b/src/components/User/InputBox.tsx @@ -0,0 +1,25 @@ +import { InputBase, Paper } from '@mui/material'; + +export default function InputBox({ type }: { type: string }) { + return ( + + + + ); +} diff --git a/src/components/User/QuestionLink.tsx b/src/components/User/QuestionLink.tsx new file mode 100644 index 0000000..7d6a7c2 --- /dev/null +++ b/src/components/User/QuestionLink.tsx @@ -0,0 +1,18 @@ +import { Typography } from '@mui/material'; + +export default function QuestionLink({ + sign, + way, +}: { + sign: string; + way: string; +}) { + return ( + + 이미 계정이 있다면?{' '} + + {sign} + + + ); +} diff --git a/src/components/User/RegisterBox.tsx b/src/components/User/RegisterBox.tsx new file mode 100644 index 0000000..5b30cca --- /dev/null +++ b/src/components/User/RegisterBox.tsx @@ -0,0 +1,68 @@ +import { Avatar, Card } from '@mui/material'; +import userImage from 'src/assets/images/user.png'; + +import InputBox from './InputBox'; +import QuestionLink from './QuestionLink'; +import SubmitButton from './SubmitButton'; +import UserLabel from './UserLabel'; + +export default function RegisterBox() { + return ( + +
+ Fashion Cloud +
+
+ + +
+ + + + + + + + + +
+ ); +} diff --git a/src/components/User/SubmitButton.tsx b/src/components/User/SubmitButton.tsx new file mode 100644 index 0000000..eeb1f85 --- /dev/null +++ b/src/components/User/SubmitButton.tsx @@ -0,0 +1,21 @@ +import { Button } from '@mui/material'; + +export default function SubmitButton({ sign }: { sign: string }) { + return ( + + ); +} diff --git a/src/components/User/UserLabel.tsx b/src/components/User/UserLabel.tsx new file mode 100644 index 0000000..ed6c865 --- /dev/null +++ b/src/components/User/UserLabel.tsx @@ -0,0 +1,15 @@ +export default function UserLabel({ label }: { label: string }) { + return ( +
+ {label} +
+ ); +} diff --git a/src/pages/RegisterPage.tsx b/src/pages/RegisterPage.tsx new file mode 100644 index 0000000..7c32bd1 --- /dev/null +++ b/src/pages/RegisterPage.tsx @@ -0,0 +1,17 @@ +import { Box } from '@mui/material'; +import TemperatureBox from 'src/components/MainLayout/InfoBox/Temperature'; +import RegisterBox from 'src/components/User/RegisterBox'; + +export default function RegisterPage() { + return ( + + + + + ); +}