@@ -11,11 +11,13 @@ import { Card } from "~/components/Card";
1111import { DraggableCard } from "~/components/DraggableCard" ;
1212import FullScreenCircularProgress from "~/components/common/FullScreenCircularProgress" ;
1313import { NavigateByAuthState } from "~/components/common/NavigateByAuthState" ;
14+ import PersonDetailedMenu from "./components/PersonDetailedMenu" ;
1415
1516export default function Home ( ) {
1617 const { data, error } = useRecommended ( ) ;
1718 const controls = useAnimation ( ) ;
1819 const [ clickedButton , setClickedButton ] = useState < string > ( "" ) ;
20+ const [ openDetailedMenu , setOpenDetailedMenu ] = useState ( false ) ;
1921 const {
2022 state : { data : currentUser } ,
2123 } = useAboutMe ( ) ;
@@ -88,34 +90,53 @@ export default function Home() {
8890 < NavigateByAuthState type = "toLoginForUnauthenticated" >
8991 < div className = "flex h-full flex-col items-center justify-center" >
9092 { displayedUser && (
91- < div className = "flex h-full flex-col items-center justify-center" >
92- { nextUser && (
93- < div className = "relative h-full w-full" >
94- < div className = "-translate-x-4 -translate-y-4 inset-0 z-0 mt-4 transform" >
95- < Card displayedUser = { nextUser } currentUser = { currentUser } />
93+ < >
94+ < div className = "flex h-full flex-col items-center justify-center" >
95+ { nextUser && (
96+ < div className = "relative h-full w-full" >
97+ < div className = "-translate-x-4 -translate-y-4 inset-0 z-0 mt-4 transform" >
98+ < Card displayedUser = { nextUser } currentUser = { currentUser } />
99+ </ div >
100+ < motion . div
101+ animate = { controls }
102+ className = "absolute inset-0 z-10 mt-4 flex items-center justify-center"
103+ >
104+ < DraggableCard
105+ displayedUser = { displayedUser }
106+ currentUser = { currentUser }
107+ onSwipeLeft = { reject }
108+ onSwipeRight = { accept }
109+ clickedButton = { clickedButton }
110+ />
111+ </ motion . div >
96112 </ div >
97- < motion . div
98- animate = { controls }
99- className = "absolute inset-0 z-10 mt-4 flex items-center justify-center"
100- >
101- < DraggableCard
102- displayedUser = { displayedUser }
103- currentUser = { currentUser }
104- onSwipeLeft = { reject }
105- onSwipeRight = { accept }
106- clickedButton = { clickedButton }
107- />
108- </ motion . div >
113+ ) }
114+ < button
115+ type = "button"
116+ onClick = { ( ) => setOpenDetailedMenu ( ! openDetailedMenu ) }
117+ >
118+ てすと
119+ </ button >
120+ < div className = "button-container mt-4 mb-4 flex w-full justify-center space-x-8" >
121+ < CloseButton
122+ onclick = { onClickClose }
123+ icon = { < CloseIconStyled /> }
124+ />
125+ < GoodButton
126+ onclick = { onClickHeart }
127+ icon = { < FavoriteIconStyled /> }
128+ />
109129 </ div >
110- ) }
111- < div className = "button-container mt-4 mb-4 flex w-full justify-center space-x-8" >
112- < CloseButton onclick = { onClickClose } icon = { < CloseIconStyled /> } />
113- < GoodButton
114- onclick = { onClickHeart }
115- icon = { < FavoriteIconStyled /> }
116- />
117130 </ div >
118- </ div >
131+ { openDetailedMenu && (
132+ < PersonDetailedMenu
133+ onClose = { ( ) => {
134+ setOpenDetailedMenu ( false ) ;
135+ } }
136+ displayedUser = { displayedUser }
137+ />
138+ ) }
139+ </ >
119140 ) }
120141 </ div >
121142 </ NavigateByAuthState >
0 commit comments