Skip to content

Commit 380438d

Browse files
committed
Little correction
1 parent 3795237 commit 380438d

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

src/components/BoxGrid.tsx

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ const hashCode = (stringPhrase: string): number => {
3030

3131
// Theme variables from Theme.js
3232
const colors = [
33-
"#ffe78e",
34-
"#ef7d7d",
35-
"#a7d0f4",
36-
"#6fc4a0",
37-
"#ffe3d3",
38-
"#ffa1c3",
39-
"#a4a4ff",
33+
"bg-[#ffe78e]",
34+
"bg-[#ef7d7d]",
35+
"bg-[#a7d0f4]",
36+
"bg-[#6fc4a0]",
37+
"bg-[#ffe3d3]",
38+
"bg-[#ffa1c3]",
39+
"bg-[#a4a4ff]",
4040
]
4141

4242
const BoxGrid = ({ items }: BoxGridProps) => {
@@ -52,22 +52,16 @@ const BoxGrid = ({ items }: BoxGridProps) => {
5252
const colorIdx = hashCode(item.emoji) % colors.length
5353
const color = colors[colorIdx]
5454
const isOpen = idx === indexOpen
55+
const columnNumberClassName = `col-start-${columnNumber}`
5556

5657
return (
5758
<Flex
5859
className={cn(
5960
"cursor-pointer items-center justify-between border border-body p-6 transition-transform duration-500 hover:-skew-x-6 hover:shadow-table-box-hover lg:items-stretch",
6061
isOpen
61-
? [
62-
"flex-col text-gray-600 sm:flex-col lg:row-start-1 lg:row-end-3 lg:flex-col",
63-
columnNumber === 1 && "lg:col-start-1",
64-
columnNumber === 2 && "lg:col-start-2",
65-
columnNumber === 3 && "lg:col-start-3",
66-
columnNumber === 4 && "lg:col-start-4",
67-
]
62+
? `flex-col text-gray-600 sm:flex-col lg:row-start-1 lg:row-end-3 lg:flex-col ${color} lg:${columnNumberClassName}`
6863
: "flex-col-reverse bg-background text-body hover:bg-background-highlight sm:flex-row-reverse lg:flex-col-reverse"
6964
)}
70-
style={{ backgroundColor: isOpen ? color : "" }}
7165
onClick={() => {
7266
setOpenIndex(idx)
7367
trackCustomEvent({
@@ -88,9 +82,11 @@ const BoxGrid = ({ items }: BoxGridProps) => {
8882
text={item.emoji}
8983
/>
9084
<div>
91-
<h3 className="mb-8 mt-0 leading-xs">{item.title}</h3>
85+
<h3 className="mb-8 mt-0 text-[2.5rem] font-normal leading-xs">
86+
{item.title}
87+
</h3>
9288
{isOpen && (
93-
<p className="mb-6 leading-xs text-gray-600">
89+
<p className="mb-6 text-xl leading-xs text-gray-600">
9490
{item.description}
9591
</p>
9692
)}

0 commit comments

Comments
 (0)