From bbc762efc7254113d73c3d399d4b4cd1264f904d Mon Sep 17 00:00:00 2001 From: takecchi Date: Wed, 13 Dec 2023 16:22:12 +0900 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E8=BA=AB=E3=81=AE=E6=83=85=E5=A0=B1?= =?UTF-8?q?=E3=82=92=E5=8F=82=E7=85=A7=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_components/layouts/EditProfileButton.tsx | 20 +++++++++---------- .../_components/layouts/ProfileCard.tsx | 8 +------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/app/(menu)/(public)/[username]/_components/layouts/EditProfileButton.tsx b/src/app/(menu)/(public)/[username]/_components/layouts/EditProfileButton.tsx index f6106502..73a77844 100644 --- a/src/app/(menu)/(public)/[username]/_components/layouts/EditProfileButton.tsx +++ b/src/app/(menu)/(public)/[username]/_components/layouts/EditProfileButton.tsx @@ -3,16 +3,16 @@ import CapsuleButton from '@/app/_components/button/CapsuleButton'; import ProfileSettingModal from '@/app/(menu)/(public)/[username]/_components/layouts/ProfileSettingModal'; import { useState } from 'react'; +import { useProfile } from '@/swr/client/auth'; -type Props = { - src: string; - displayName: string; - bio: string; -}; - -export function EditProfileButton({ src, displayName, bio }: Props) { +export function EditProfileButton() { const text = 'プロフィールを編集'; const [open, setOpen] = useState(false); + const { data } = useProfile(); + + if (!data) { + return <>; + } return ( <> @@ -28,9 +28,9 @@ export function EditProfileButton({ src, displayName, bio }: Props) { setOpen(false)} /> diff --git a/src/app/(menu)/(public)/[username]/_components/layouts/ProfileCard.tsx b/src/app/(menu)/(public)/[username]/_components/layouts/ProfileCard.tsx index b1a31a5b..203c8d8a 100644 --- a/src/app/(menu)/(public)/[username]/_components/layouts/ProfileCard.tsx +++ b/src/app/(menu)/(public)/[username]/_components/layouts/ProfileCard.tsx @@ -112,13 +112,7 @@ export default function ProfileCard({ {authId && !isMe && ( )} - {authId && isMe && ( - - )} + {authId && isMe && }