mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-25 20:50:14 -05:00
add event images
This commit is contained in:
@@ -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, "-")}`}
|
||||
|
||||
@@ -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`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
public/events/lobstercrossfire.png
Normal file
BIN
public/events/lobstercrossfire.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 869 KiB |
BIN
public/events/lowink.png
Normal file
BIN
public/events/lowink.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 296 KiB |
BIN
public/events/swimorsink.png
Normal file
BIN
public/events/swimorsink.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
Reference in New Issue
Block a user