diff --git a/pac-man-board-game/ClientApp/src/components/gameTile.tsx b/pac-man-board-game/ClientApp/src/components/gameTile.tsx index 9bfd35c..e24590c 100644 --- a/pac-man-board-game/ClientApp/src/components/gameTile.tsx +++ b/pac-man-board-game/ClientApp/src/components/gameTile.tsx @@ -2,7 +2,6 @@ import React, {useEffect, useState} from "react"; import {TileType} from "../game/tileType"; import {Character, Dummy} from "../game/character"; import {Direction} from "../game/direction"; -import {getBgCSSColour} from "../utils/colours"; import {Colour} from "../game/colour"; interface TileWithCharacterProps extends ComponentProps { @@ -51,7 +50,8 @@ export const GameTile: Component = ( const Circle: Component<{ colour?: Colour } & ComponentProps> = ({colour = Colour.White, className}) => (
-
+
); diff --git a/pac-man-board-game/ClientApp/src/utils/colours.ts b/pac-man-board-game/ClientApp/src/utils/colours.ts deleted file mode 100644 index edd3ec0..0000000 --- a/pac-man-board-game/ClientApp/src/utils/colours.ts +++ /dev/null @@ -1,10 +0,0 @@ -import {Colour} from "../game/colour"; - -/** - * Converts the given enum Colour to a Tailwind CSS class name. - * @param colour The colour to convert - * @returns The Tailwind CSS class name - */ -export function getBgCSSColour(colour: Colour): string { - return `bg-${colour}${colour !== Colour.White ? "-500" : ""}`; -} diff --git a/pac-man-board-game/ClientApp/tests/utils/colours.test.ts b/pac-man-board-game/ClientApp/tests/utils/colours.test.ts deleted file mode 100644 index 2e1bf1e..0000000 --- a/pac-man-board-game/ClientApp/tests/utils/colours.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import {expect, test} from "vitest" -import {getBgCSSColour} from "../../src/utils/colours"; -import {Colour} from "../../src/game/colour"; - -test('white should not use -500', () => { - const cssColour = getBgCSSColour(Colour.White); - expect(cssColour).toBe("bg-white"); -}); - -test('purple should use -500', () => { - const cssColour = getBgCSSColour(Colour.Purple); - expect(cssColour).toBe("bg-purple-500"); -}); - -test("yellow should use -500", () => { - const cssColour = getBgCSSColour(Colour.Yellow); - expect(cssColour).toBe("bg-yellow-500"); -}); diff --git a/pac-man-board-game/pac-man-board-game.csproj b/pac-man-board-game/pac-man-board-game.csproj index b3e6af1..f00e90c 100644 --- a/pac-man-board-game/pac-man-board-game.csproj +++ b/pac-man-board-game/pac-man-board-game.csproj @@ -46,6 +46,11 @@ + + + + +