add event images

This commit is contained in:
Kalle (Sendou)
2021-04-02 23:04:00 +03:00
parent 97d36cb0d9
commit b66eb0f892
5 changed files with 8 additions and 4 deletions

View File

@@ -164,7 +164,6 @@ const TournamentInfo = ({ event, edit }: EventInfoProps) => {
leftIcon={<FiInfo />}
size="sm"
onClick={() => setExpanded(!expanded)}
variant="outline"
data-cy={`info-button-${event.name
.toLowerCase()
.replace(/ /g, "-")}`}

View File

@@ -86,16 +86,21 @@ export const EVENT_FORMATS = [
{ code: "OTHER", name: t`Other` },
] as const;
const nameToImage = ["tasl"] as const;
const nameToImage = [
{ code: "tasl", name: "tasl" },
{ code: "lowink", name: "low ink" },
{ code: "lobstercrossfire", name: "lobster crossfire" },
{ code: "swimorsink", name: "swim or sink" },
] as const;
/**
* Returns event logo image path based on the event name or undefined if no image saved for the event.
*/
export const eventImage = (eventName: string) => {
const eventNameLower = eventName.toLowerCase();
for (const name of nameToImage) {
for (const { name, code } of nameToImage) {
if (eventNameLower.startsWith(name)) {
return `/events/${name}.png`;
return `/events/${code}.png`;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 869 KiB

BIN
public/events/lowink.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB