diff --git a/public/png/yulim.png b/public/png/yulim.png new file mode 100644 index 0000000..ffea8b4 Binary files /dev/null and b/public/png/yulim.png differ diff --git a/src/features/event/Container.tsx b/src/features/event/Container.tsx index df1953a..caeac7c 100644 --- a/src/features/event/Container.tsx +++ b/src/features/event/Container.tsx @@ -11,16 +11,24 @@ const EventContainer: FunctionComponent = () => { return (
-
+
JUNCTION Event
Who is the lucky one who got the winning gift?
-
- gift +
+ gift
-
+
Press the gift box and check the winning results
diff --git a/src/features/event/event.scss b/src/features/event/event.scss index 93191b5..e10aa19 100644 --- a/src/features/event/event.scss +++ b/src/features/event/event.scss @@ -12,6 +12,24 @@ transform: rotate(0deg); } } +@keyframes open-top { + 0% { + padding-top: 7rem; + padding-bottom: 0rem; + } + 100% { + padding-top: 4rem; + padding-bottom: 2rem; + } +} +@keyframes open-bottom { + 0% { + padding-bottom: 0rem; + } + 100% { + padding-bottom: 4rem; + } +} .event-container { height: calc(100vh - 77px); @@ -23,11 +41,15 @@ align-items: center; .content { - padding-top: 183px; + padding-top: 7rem; display: flex; flex-direction: column; justify-content: center; align-items: center; + + &.open { + animation: open-top 0.5s both; + } .label { color: #ffffff; @@ -50,6 +72,11 @@ } .gift { cursor: pointer; + height: 250px; + + &.open { + animation: open-bottom 0.5s both; + } :hover { animation: shake 1s infinite ease-in; diff --git a/src/features/home/components/Profile.tsx b/src/features/home/components/Profile.tsx index db54584..f64d31e 100644 --- a/src/features/home/components/Profile.tsx +++ b/src/features/home/components/Profile.tsx @@ -3,9 +3,10 @@ import { FunctionComponent } from 'react'; import { userAtom } from '../../login/atom'; +import profileImage from '/png/yulim.png'; + const Profile: FunctionComponent = () => { - const [{ email, profileImage, department, name, position }] = - useAtom(userAtom); + const [{ email, department, name, position }] = useAtom(userAtom); return (
diff --git a/src/features/login/constants.ts b/src/features/login/constants.ts index 74cf02a..16fb16b 100644 --- a/src/features/login/constants.ts +++ b/src/features/login/constants.ts @@ -1,8 +1,7 @@ import { DummyUser } from './type'; export const DUMMY_USER: DummyUser = { - name: 'Sangchul', - profileImage: 'https://avatars.githubusercontent.com/u/23524849?v=4', + name: 'Yulim', email: '1ilsang@naver.com', companyNo: 'JS1234', password: 'just', diff --git a/src/features/login/type.ts b/src/features/login/type.ts index a011ffe..a39225b 100644 --- a/src/features/login/type.ts +++ b/src/features/login/type.ts @@ -1,6 +1,5 @@ export type User = { name?: string; - profileImage?: string; email?: string; companyNo?: string; department?: string; diff --git a/src/features/preview/Container.tsx b/src/features/preview/Container.tsx index e815855..aa33082 100644 --- a/src/features/preview/Container.tsx +++ b/src/features/preview/Container.tsx @@ -8,10 +8,12 @@ import './style/index.scss'; import BottomText from './components/BottomText'; import ChooseType from './components/ChooseType'; import PreviewImage from './components/PreviewImage'; +import usePreview from './hooks/usePreview'; const Container = () => { const [, setTitle] = useAtom(titleAtom); const [, setBottomBtn] = useAtom(bottomBtnAtom); + const { curNum, setCurNum } = usePreview(); useLayoutEffect(() => { setTitle({ title: 'CardMe Preview', back: true }); setBottomBtn({ text: 'Modification' }); @@ -25,8 +27,8 @@ const Container = () => { return (
- - + +
); }; diff --git a/src/features/preview/components/BottomText.tsx b/src/features/preview/components/BottomText.tsx index 465178b..1f848ea 100644 --- a/src/features/preview/components/BottomText.tsx +++ b/src/features/preview/components/BottomText.tsx @@ -1,10 +1,44 @@ -const BottomText = () => { +import { FunctionComponent } from 'react'; + +type BottomTextType = { + curNum: number; +}; + +const BottomText: FunctionComponent = ({ curNum }) => { + const titleList = [ + 'My Profile', + 'Active Mood', + 'Creating a Schedule', + 'Cancellation', + 'Schedule Notification', + ]; + const subList = [ + 'My basic information is displayed.', + 'Express your day in various ways with text and stickers!', + 'Sends an alert to the ID Card when you create a schedule.', + 'Send a notification to the ID Card when the schedule is canceled.', + 'Sends a notification to the ID Card when the schedule is imminent.', + ]; return (
-
My Profile
-
- My basic information is displayed. -
+ {titleList.map((item, idx) => { + if (idx === curNum) { + return ( +
+ {item} +
+ ); + } + })} + {subList.map((item, idx) => { + if (idx === curNum) { + return ( +
+ {item} +
+ ); + } + })}
); }; diff --git a/src/features/preview/components/PreviewImage.tsx b/src/features/preview/components/PreviewImage.tsx index 8fe9318..72c7aa1 100644 --- a/src/features/preview/components/PreviewImage.tsx +++ b/src/features/preview/components/PreviewImage.tsx @@ -1,6 +1,6 @@ import 'react-responsive-carousel/lib/styles/carousel.min.css'; import { Carousel } from 'react-responsive-carousel'; -import { useState } from 'react'; +import { Dispatch, FunctionComponent } from 'react'; import idCardBasic from '/svg/idcard_basic.svg'; import idCardMude from '/svg/idcard_mude.svg'; @@ -8,8 +8,14 @@ import meetingAdd from '/svg/meeting_add.svg'; import meetingCancel from '/svg/meeting_cancel.svg'; import meeting30 from '/svg/meeting_30.svg'; -const PreviewImage = () => { - const [curNum, setCurNum] = useState(0); +type PreviewImageType = { + curNum: number; + setCurNum: Dispatch; +}; +const PreviewImage: FunctionComponent = ({ + curNum, + setCurNum, +}) => { const imageList = [ idCardBasic, idCardMude, @@ -17,7 +23,6 @@ const PreviewImage = () => { meetingCancel, meeting30, ]; - console.log(curNum); return ( <>
@@ -29,7 +34,8 @@ const PreviewImage = () => { showIndicators={false} autoPlay infiniteLoop - onChange={(index) => { + selectedItem={curNum} + onChange={(index, _) => { setCurNum(index); }} > @@ -51,6 +57,9 @@ const PreviewImage = () => { ? 'preview-carousel-circle-black' : 'preview-carousel-circle-gray' } + onClick={() => { + setCurNum(idx); + }} >
); })} diff --git a/src/features/preview/hooks/usePreview.ts b/src/features/preview/hooks/usePreview.ts new file mode 100644 index 0000000..8d7ba1c --- /dev/null +++ b/src/features/preview/hooks/usePreview.ts @@ -0,0 +1,12 @@ +import { useState } from 'react'; + +const usePreview = () => { + const [curNum, setCurNum] = useState(0); + + return { + curNum, + setCurNum, + }; +}; + +export default usePreview;