Skip to content

Commit e048be4

Browse files
authored
Merge branch 'main' into memo
2 parents c099172 + dd3dad8 commit e048be4

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

web/app/home/page.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"use client";
22

33
import CloseIcon from "@mui/icons-material/Close";
4-
import FavoriteIcon from "@mui/icons-material/Favorite";
54
import { motion, useAnimation } from "framer-motion";
65
import { useCallback, useEffect, useState } from "react";
6+
import { MdThumbUp } from "react-icons/md";
77
import request from "~/api/request";
88
import { useMyID, useRecommended } from "~/api/user";
99
import { Card } from "~/components/Card";
@@ -33,7 +33,7 @@ export default function Home() {
3333
if (displayedUser?.id) request.send(displayedUser.id);
3434
}, [displayedUser?.id]);
3535

36-
const onClickCross = useCallback(() => {
36+
const onClickClose = useCallback(() => {
3737
setClickedButton("cross");
3838
controls
3939
.start({
@@ -102,8 +102,8 @@ export default function Home() {
102102
</div>
103103
)}
104104
<div className="button-container mt-4 mb-4 flex w-full justify-center space-x-8">
105-
<RoundButton onclick={onClickCross} icon={<CloseIconStyled />} />
106-
<RoundButton
105+
<CloseButton onclick={onClickClose} icon={<CloseIconStyled />} />
106+
<GoodButton
107107
onclick={onClickHeart}
108108
icon={<FavoriteIconStyled />}
109109
/>
@@ -120,7 +120,16 @@ interface RoundButtonProps {
120120
icon: JSX.Element;
121121
}
122122

123-
const RoundButton = ({ onclick, icon }: RoundButtonProps) => (
123+
const CloseButton = ({ onclick, icon }: RoundButtonProps) => (
124+
<button
125+
type="button"
126+
onClick={onclick}
127+
className="btn btn-circle bg-white shadow-md"
128+
>
129+
{icon}
130+
</button>
131+
);
132+
const GoodButton = ({ onclick, icon }: RoundButtonProps) => (
124133
<button
125134
type="button"
126135
onClick={onclick}
@@ -133,5 +142,5 @@ const RoundButton = ({ onclick, icon }: RoundButtonProps) => (
133142
const CloseIconStyled = () => <CloseIcon className="text-4xl text-gray-500" />;
134143

135144
const FavoriteIconStyled = () => (
136-
<FavoriteIcon className="text-4xl text-red-500" />
145+
<MdThumbUp className="text-3xl text-primary" />
137146
);

web/components/DraggableCard.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import CloseIcon from "@mui/icons-material/Close";
2-
import FavoriteIcon from "@mui/icons-material/Favorite";
32
import { Box, Typography } from "@mui/material";
43
import type { User, UserID } from "common/types";
54
import { motion, useMotionValue, useMotionValueEvent } from "framer-motion";
65
import { useCallback, useState } from "react";
6+
import { MdThumbUp } from "react-icons/md";
77
import { Card } from "./Card";
88

99
const SWIPE_THRESHOLD = 30;
@@ -51,17 +51,8 @@ export const DraggableCard = ({
5151
<div>
5252
{dragProgress > SWIPE_THRESHOLD || clickedButton === "heart" ? (
5353
<div
54-
style={{
55-
position: "absolute",
56-
zIndex: 2,
57-
backgroundColor: "rgba(255, 0, 0, 0.3)",
58-
width: "min(40dvh, 87.5vw)",
59-
height: "70dvh",
60-
pointerEvents: "none",
61-
display: "flex",
62-
justifyContent: "center",
63-
alignItems: "center",
64-
}}
54+
className="pointer-events-none absolute z-20 flex h-[70dvh] w-[min(40dvh,87.5vw)] items-center justify-center"
55+
style={{ backgroundColor: "rgba(3, 155, 229, 0.4)" }}
6556
>
6657
<Box
6758
display="flex"
@@ -73,7 +64,7 @@ export const DraggableCard = ({
7364
width={"16dvh"}
7465
height={"16dvh"}
7566
>
76-
<FavoriteIcon style={{ color: "red", fontSize: "4.5dvh" }} />
67+
<MdThumbUp className="text-5xl text-primary" />
7768
<Typography variant="h5" component="h1" mb={1}>
7869
いいね!
7970
</Typography>

0 commit comments

Comments
 (0)