From d29aabb1eee466e09e71d8b10d2ec135b78adb57 Mon Sep 17 00:00:00 2001 From: akhercha Date: Fri, 6 Oct 2023 14:21:07 +0200 Subject: [PATCH] feat: Removed cartridge avatar & Added crown to Skull icon (#201) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(skull_with_crown): Removed Cartridge avatar + Added crown to skull icon * feat(skull_with_crown): Added skull color to end-game screen * feat(skull_with_crown): Refactor of the Skull icon from code review * feat(skull_with_crown): Removed the tag for 💀 --------- Co-authored-by: akhercha --- web/src/components/Leaderboard.tsx | 11 +- .../components/avatar/avatars/Catridge.tsx | 136 ------------------ web/src/components/avatar/avatars/index.tsx | 2 - web/src/components/icons/Skull.tsx | 30 +++- web/src/pages/[gameId]/end.tsx | 2 +- 5 files changed, 33 insertions(+), 148 deletions(-) delete mode 100644 web/src/components/avatar/avatars/Catridge.tsx diff --git a/web/src/components/Leaderboard.tsx b/web/src/components/Leaderboard.tsx index cf25391b4..ed606c7db 100644 --- a/web/src/components/Leaderboard.tsx +++ b/web/src/components/Leaderboard.tsx @@ -120,7 +120,7 @@ const Leaderboard = ({ > {score.dead ? ( - + ) : ( {"."} - {formatCash(score.cash)} + + {formatCash(score.cash)} + ); diff --git a/web/src/components/avatar/avatars/Catridge.tsx b/web/src/components/avatar/avatars/Catridge.tsx deleted file mode 100644 index edb104786..000000000 --- a/web/src/components/avatar/avatars/Catridge.tsx +++ /dev/null @@ -1,136 +0,0 @@ -import { AvatarPathProps } from "../Avatar"; - -export const Catridge = ({ color, hasCrown }: AvatarPathProps) => { - let path; - switch (color) { - // Green color - case "green": - path = hasCrown ? ( - - - - - - - - - - - - - - - - - - - - - - - - - - - ) : ( - - - - - - - - - - - - - - - - - - - - - - - - - ); - break; - // Yellow color - case "yellow": - path = hasCrown ? ( - - - - - - - - - - - - - - - - - - - - - - - - - - - ) : ( - - - - - - - - - - - - - - - - - - - - - - - - - ); - break; - } - return path; -}; diff --git a/web/src/components/avatar/avatars/index.tsx b/web/src/components/avatar/avatars/index.tsx index 8a768bc0e..aef861c34 100644 --- a/web/src/components/avatar/avatars/index.tsx +++ b/web/src/components/avatar/avatars/index.tsx @@ -1,4 +1,3 @@ -import { Catridge } from "./Catridge"; import { PersonA } from "./PersonA"; import { PersonB } from "./PersonB"; import { PersonC } from "./PersonC"; @@ -13,7 +12,6 @@ import { PersonK } from "./PersonK"; import { PersonL } from "./PersonL"; export const avatars = { - Catridge: Catridge, PersonA: PersonA, PersonB: PersonB, PersonC: PersonC, diff --git a/web/src/components/icons/Skull.tsx b/web/src/components/icons/Skull.tsx index 78b869654..944080dc4 100644 --- a/web/src/components/icons/Skull.tsx +++ b/web/src/components/icons/Skull.tsx @@ -1,9 +1,33 @@ import { Icon, IconProps } from "."; +import { AvatarPathProps } from "@/components/avatar/Avatar"; -export const Skull = (props: IconProps) => { +export const Skull = ({ + hasCrown, + color, + ...props +}: IconProps & AvatarPathProps) => { return ( - - + + <> + + {hasCrown && ( + <> + + + + )} + ); }; diff --git a/web/src/pages/[gameId]/end.tsx b/web/src/pages/[gameId]/end.tsx index 7a2396f57..f7b241b86 100644 --- a/web/src/pages/[gameId]/end.tsx +++ b/web/src/pages/[gameId]/end.tsx @@ -117,7 +117,7 @@ export default function End() { : } + icon={isDead ? : } /> {/*