1
1
import React , { useState } from "react" ;
2
2
import { useEffect } from "react" ;
3
3
import { useLocation , useNavigate } from "react-router-dom" ;
4
+ import { motion } from "framer-motion" ;
4
5
5
6
const MainScheduleCards = ( { schedules } ) => {
6
7
const navigate = useNavigate ( ) ;
@@ -28,9 +29,7 @@ const MainScheduleCards = ({ schedules }) => {
28
29
if ( invitees . length > 1 ) {
29
30
setInviteesList ( ( ) => ( {
30
31
hidden : false ,
31
- inviteesList : `${ schedules . invitees [ 0 ] . username } 외 ${
32
- invitees . length - 1
33
- } 명`,
32
+ inviteesList : `${ schedules . invitees [ 0 ] . username } 외 ${ invitees . length - 1 } 명` ,
34
33
} ) ) ;
35
34
}
36
35
} , [ invitees , schedules . invitees ] ) ;
@@ -40,13 +39,20 @@ const MainScheduleCards = ({ schedules }) => {
40
39
} ;
41
40
42
41
return (
43
- < div
42
+ < motion . div
43
+ initial = { { opacity : 0 , scale : 0.2 } }
44
+ animate = { { opacity : 1 , scale : 1 } }
45
+ transition = { {
46
+ duration : 0.8 ,
47
+ delay : 0.5 ,
48
+ ease : [ 0 , 0.71 , 0.2 , 1.01 ] ,
49
+ } }
50
+ whileHover = { { scale : 1.1 , transition : { type : "spring" , stiffness : 400 , damping : 10 } } }
51
+ whileTap = { { scale : 1.1 } }
44
52
onClick = { onDetail }
45
53
className = { `w-[335px] h-[180px] bg-white rounded-[10px] border border-solid border-[#E8E8E8] shadow-md cursor-pointer` }
46
54
>
47
- < div
48
- className = { `flex items-center h-[14px] ${ bgColor } rounded-t-[10px] ` }
49
- >
55
+ < div className = { `flex items-center h-[14px] ${ bgColor } rounded-t-[10px] ` } >
50
56
< ul className = "ml-[9px] flex flex-row gap-[4px]" >
51
57
{ [ 0 , 1 , 2 ] . map ( ( list ) => (
52
58
< li key = { list } className = "bg-white h-[4px] w-[4px] rounded-full" />
@@ -85,10 +91,7 @@ const MainScheduleCards = ({ schedules }) => {
85
91
< div className = "flex -space-x-8 overflow-hidden " >
86
92
{ invitees ?. map ( ( list , index ) => {
87
93
return (
88
- < div
89
- key = { index }
90
- className = "flex border-2 border-white rounded-full"
91
- >
94
+ < div key = { index } className = "flex border-2 border-white rounded-full" >
92
95
< img
93
96
className = "inline-block h-[40px] w-[40px] rounded-full"
94
97
src = { list . profile }
@@ -98,16 +101,14 @@ const MainScheduleCards = ({ schedules }) => {
98
101
) ;
99
102
} ) }
100
103
</ div >
101
- < div className = "flex items-center text-[#6F6F6F]" >
102
- { inviteesList . inviteesList }
103
- </ div >
104
+ < div className = "flex items-center text-[#6F6F6F]" > { inviteesList . inviteesList } </ div >
104
105
</ div >
105
106
</ div >
106
107
</ div >
107
108
</ div >
108
109
</ div >
109
110
</ div >
110
- </ div >
111
+ </ motion . div >
111
112
) ;
112
113
} ;
113
114
0 commit comments