From 2c3b938765785c74c34cfa2f6ee83fdfae6f50b1 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 18 Apr 2024 08:14:09 +0100 Subject: [PATCH] add with overlays skin part image to the skin part view --- src/app/components/player/skin-part-image.tsx | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/src/app/components/player/skin-part-image.tsx b/src/app/components/player/skin-part-image.tsx index b1b2772..b1224c7 100644 --- a/src/app/components/player/skin-part-image.tsx +++ b/src/app/components/player/skin-part-image.tsx @@ -37,6 +37,28 @@ type SkinPartImageProps = { size?: number; }; +type SkinOverlay = { + /** + * The title to display. + */ + title: string; + + /** + * Whether to show the part with overlays. + */ + overlays?: boolean; +}; + +const skinPartOverlay: SkinOverlay[] = [ + { + title: "Without Overlays", + }, + { + title: "With Overlays", + overlays: true, + }, +]; + export function SkinPartImage({ playerName, part, url, size = 64 }: SkinPartImageProps): ReactElement { const partName = capitalizeFirstLetter(part); @@ -61,8 +83,20 @@ export function SkinPartImage({ playerName, part, url, size = 64 }: SkinPartImag See the skin part below. -
- {`The +
+ {skinPartOverlay.map((overlay, index) => { + return ( +
+

{overlay.title}

+ {`The +
+ ); + })}