diff --git a/src/components/BoxGrid.tsx b/src/components/BoxGrid.tsx index 507a0bbc183..b1fca4dc9d5 100644 --- a/src/components/BoxGrid.tsx +++ b/src/components/BoxGrid.tsx @@ -1,12 +1,10 @@ import React, { useState } from "react" -import { Box, Flex, GridItem, SimpleGrid } from "@chakra-ui/react" import { cn } from "@/lib/utils/cn" import { MatomoEventOptions, trackCustomEvent } from "@/lib/utils/matomo" +import { Flex } from "./ui/flex" import Emoji from "./Emoji" -import OldHeading from "./OldHeading" -import Text from "./OldText" export interface BoxItem { emoji: string @@ -32,54 +30,33 @@ const hashCode = (stringPhrase: string): number => { // Theme variables from Theme.js const colors = [ - "gridYellow", - "gridRed", - "gridBlue", - "gridGreen", - "warning", - "gridPink", - "gridPurple", + "bg-[#ffe78e]", + "bg-[#ef7d7d]", + "bg-[#a7d0f4]", + "bg-[#6fc4a0]", + "bg-[#ffe3d3]", + "bg-[#ffa1c3]", + "bg-[#a4a4ff]", ] const BoxGrid = ({ items }: BoxGridProps) => { const [indexOpen, setOpenIndex] = useState(0) return ( - +
{items.map((item, idx: number) => { - let columnNumber = idx + 1 - if (columnNumber > 4) { - columnNumber = columnNumber - 3 - } const colorIdx = hashCode(item.emoji) % colors.length const color = colors[colorIdx] const isOpen = idx === indexOpen return ( - { setOpenIndex(idx) trackCustomEvent({ @@ -99,26 +76,20 @@ const BoxGrid = ({ items }: BoxGridProps) => { )} text={item.emoji} /> - - +
+

{item.title} - +

{isOpen && ( - +

{item.description} - +

)} - - +
+ ) })} - +
) }