Skip to content

Commit

Permalink
ハート要素を削除した (#536)
Browse files Browse the repository at this point in the history
# PRの概要
close #490 

## 具体的な変更内容
<img width="857" alt="スクリーンショット 2024-11-30 16 54 19"
src="https://github.com/user-attachments/assets/d5bbd984-375a-44d9-b51a-99b57086c804">


## 影響範囲

## 動作要件

## 補足

## レビューリクエストを出す前にチェック!

- [ ] 改めてセルフレビューしたか
- [ ] 手動での動作検証を行ったか
- [ ] server の機能追加ならば、テストを書いたか
  - 理由: 書いた | server の機能追加ではない
- [ ] 間違った使い方が存在するならば、それのドキュメントをコメントで書いたか
  - 理由: 書いた | 間違った使い方は存在しない
- [ ] わかりやすいPRになっているか

<!-- レビューリクエスト後は、Slackでもメンションしてお願いすることを推奨します。 -->
  • Loading branch information
KaichiManabe authored Nov 30, 2024
1 parent d6b5739 commit dd3dad8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
21 changes: 15 additions & 6 deletions web/app/home/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use client";

import CloseIcon from "@mui/icons-material/Close";
import FavoriteIcon from "@mui/icons-material/Favorite";
import { motion, useAnimation } from "framer-motion";
import { useCallback, useEffect, useState } from "react";
import { MdThumbUp } from "react-icons/md";
import request from "~/api/request";
import { useMyID, useRecommended } from "~/api/user";
import { Card } from "~/components/Card";
Expand Down Expand Up @@ -33,7 +33,7 @@ export default function Home() {
if (displayedUser?.id) request.send(displayedUser.id);
}, [displayedUser?.id]);

const onClickCross = useCallback(() => {
const onClickClose = useCallback(() => {
setClickedButton("cross");
controls
.start({
Expand Down Expand Up @@ -102,8 +102,8 @@ export default function Home() {
</div>
)}
<div className="button-container mt-4 mb-4 flex w-full justify-center space-x-8">
<RoundButton onclick={onClickCross} icon={<CloseIconStyled />} />
<RoundButton
<CloseButton onclick={onClickClose} icon={<CloseIconStyled />} />
<GoodButton
onclick={onClickHeart}
icon={<FavoriteIconStyled />}
/>
Expand All @@ -120,7 +120,16 @@ interface RoundButtonProps {
icon: JSX.Element;
}

const RoundButton = ({ onclick, icon }: RoundButtonProps) => (
const CloseButton = ({ onclick, icon }: RoundButtonProps) => (
<button
type="button"
onClick={onclick}
className="btn btn-circle bg-white shadow-md"
>
{icon}
</button>
);
const GoodButton = ({ onclick, icon }: RoundButtonProps) => (
<button
type="button"
onClick={onclick}
Expand All @@ -133,5 +142,5 @@ const RoundButton = ({ onclick, icon }: RoundButtonProps) => (
const CloseIconStyled = () => <CloseIcon className="text-4xl text-gray-500" />;

const FavoriteIconStyled = () => (
<FavoriteIcon className="text-4xl text-red-500" />
<MdThumbUp className="text-3xl text-primary" />
);
17 changes: 4 additions & 13 deletions web/components/DraggableCard.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import CloseIcon from "@mui/icons-material/Close";
import FavoriteIcon from "@mui/icons-material/Favorite";
import { Box, Typography } from "@mui/material";
import type { User, UserID } from "common/types";
import { motion, useMotionValue, useMotionValueEvent } from "framer-motion";
import { useCallback, useState } from "react";
import { MdThumbUp } from "react-icons/md";
import { Card } from "./Card";

const SWIPE_THRESHOLD = 30;
Expand Down Expand Up @@ -51,17 +51,8 @@ export const DraggableCard = ({
<div>
{dragProgress > SWIPE_THRESHOLD || clickedButton === "heart" ? (
<div
style={{
position: "absolute",
zIndex: 2,
backgroundColor: "rgba(255, 0, 0, 0.3)",
width: "min(40dvh, 87.5vw)",
height: "70dvh",
pointerEvents: "none",
display: "flex",
justifyContent: "center",
alignItems: "center",
}}
className="pointer-events-none absolute z-20 flex h-[70dvh] w-[min(40dvh,87.5vw)] items-center justify-center"
style={{ backgroundColor: "rgba(3, 155, 229, 0.4)" }}
>
<Box
display="flex"
Expand All @@ -73,7 +64,7 @@ export const DraggableCard = ({
width={"16dvh"}
height={"16dvh"}
>
<FavoriteIcon style={{ color: "red", fontSize: "4.5dvh" }} />
<MdThumbUp className="text-5xl text-primary" />
<Typography variant="h5" component="h1" mb={1}>
いいね!
</Typography>
Expand Down

0 comments on commit dd3dad8

Please sign in to comment.