diff --git a/web/app/home/page.tsx b/web/app/home/page.tsx index be1bc198..03004c6e 100644 --- a/web/app/home/page.tsx +++ b/web/app/home/page.tsx @@ -2,12 +2,9 @@ import CloseIcon from "@mui/icons-material/Close"; import FavoriteIcon from "@mui/icons-material/Favorite"; -import { Box, Button } from "@mui/material"; +import { motion, useAnimation } from "framer-motion"; import { useCallback, useEffect, useState } from "react"; import request from "~/api/request"; - -import shadows from "@mui/material/styles/shadows"; -import { motion, useAnimation } from "framer-motion"; import { useMyID, useRecommended } from "~/api/user"; import { Card } from "~/components/Card"; import { DraggableCard } from "~/components/DraggableCard"; @@ -16,7 +13,6 @@ import { NavigateByAuthState } from "~/components/common/NavigateByAuthState"; export default function Home() { const { data: recommended, error } = useRecommended(); - const [nth, setNth] = useState(0); const displayedUser = recommended?.[nth]; const nextUser = recommended?.[nth + 1]; @@ -30,7 +26,7 @@ export default function Home() { if (!displayedUser) return; recommended?.push(displayedUser); setNth((n) => n + 1); - }, [displayedUser, recommended?.push /* ew */]); + }, [displayedUser, recommended]); const accept = useCallback(async () => { setNth((n) => n + 1); @@ -83,64 +79,36 @@ export default function Home() { return ( -
- {displayedUser ? ( - - - {nextUser ? ( - +
+ {displayedUser && ( +
+ {nextUser && ( +
+
- - ) : null} - - - - -
+
+ + + +
+ )} +
} /> } />
- - ) : ( - +
)}
@@ -152,28 +120,18 @@ interface RoundButtonProps { icon: JSX.Element; } -const RoundButton = ({ onclick, icon }: RoundButtonProps) => { - return ( -
- -
- ); -}; - -const ButtonStyle = { - borderRadius: "50%", - width: "7dvh", - height: "7dvh", - boxShadow: shadows[10], - backgroundColor: "white", -}; - -const CloseIconStyled = () => { - return ; -}; - -const FavoriteIconStyled = () => { - return ; -}; +const RoundButton = ({ onclick, icon }: RoundButtonProps) => ( + +); + +const CloseIconStyled = () => ; + +const FavoriteIconStyled = () => ( + +);