From c429fa389967974c2f31b7e79078572c9dcf9897 Mon Sep 17 00:00:00 2001 From: yasuaki-kumazaki Date: Mon, 1 Jul 2024 17:03:24 +0200 Subject: [PATCH] fixed pet page --- frontend/src/Components/PetDetails.tsx | 30 ++++++++++++++----- .../src/Components/PetDetailsProgressBar.tsx | 12 +++++--- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/frontend/src/Components/PetDetails.tsx b/frontend/src/Components/PetDetails.tsx index a98cf00e..72e6e476 100644 --- a/frontend/src/Components/PetDetails.tsx +++ b/frontend/src/Components/PetDetails.tsx @@ -1,8 +1,8 @@ import { Pet } from "../lib/api/usePetApi"; import PetDetailsProgressBar from "./PetDetailsProgressBar"; -const PetDetails = (props: {pet: Pet, petImageSrc: string}) => { - const {pet, petImageSrc} = props; +const PetDetails = (props: { pet: Pet; petImageSrc: string }) => { + const { pet, petImageSrc } = props; if (!pet.state) return; const petState = pet.state; @@ -10,16 +10,32 @@ const PetDetails = (props: {pet: Pet, petImageSrc: string}) => { return ( <>
- Image showing the pet + Image showing the pet
{pet.name}
- - - + + +
); -} +}; export default PetDetails; diff --git a/frontend/src/Components/PetDetailsProgressBar.tsx b/frontend/src/Components/PetDetailsProgressBar.tsx index edc48c86..da3ff6cc 100644 --- a/frontend/src/Components/PetDetailsProgressBar.tsx +++ b/frontend/src/Components/PetDetailsProgressBar.tsx @@ -4,14 +4,18 @@ import { IProgressBarProps } from "react-progressbar-fancy/build/ProgressBar/Pro /** * See https://github.com/RavinRau/react-progressbar-fancy */ -const PetDetailsProgressBar = (props: {value?: number, color: IProgressBarProps["progressColor"]}) => { +const PetDetailsProgressBar = (props: { + labelName: string; + value?: number; + color: IProgressBarProps["progressColor"]; +}) => { return ( <> {props.value != undefined && (
-
{props.value}
+
{props.labelName}
); -} +}; export default PetDetailsProgressBar;