Skip to content

Commit 814096f

Browse files
committed
feat: migrate MeetupList to tailwind
1 parent df87cb8 commit 814096f

File tree

3 files changed

+44
-76
lines changed

3 files changed

+44
-76
lines changed

src/components/MeetupList.tsx

Lines changed: 38 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,21 @@
11
import { useState } from "react"
22
import sortBy from "lodash/sortBy"
33
import { FaChevronRight } from "react-icons/fa6"
4-
import {
5-
Box,
6-
Flex,
7-
Icon,
8-
LinkBox,
9-
LinkOverlay,
10-
List,
11-
ListItem,
12-
useToken,
13-
VisuallyHidden,
14-
} from "@chakra-ui/react"
154

165
import Emoji from "@/components/Emoji"
176
import InfoBanner from "@/components/InfoBanner"
18-
import Input from "@/components/Input"
19-
import InlineLink, { BaseLink } from "@/components/Link"
20-
import Text from "@/components/OldText"
217
import Translation from "@/components/Translation"
228

9+
import { cn } from "@/lib/utils/cn"
2310
import { trackCustomEvent } from "@/lib/utils/matomo"
2411

2512
import meetups from "@/data/community-meetups.json"
2613

14+
import Input from "../../tailwind/ui/Input"
15+
16+
import { Flex } from "./ui/flex"
17+
import InlineLink, { BaseLink } from "./ui/Link"
18+
2719
export interface Meetup {
2820
title: string
2921
emoji: string
@@ -59,89 +51,59 @@ const MeetupList = () => {
5951
})
6052
}
6153

62-
const primaryBaseColor = useToken("colors", "primary.base")
63-
6454
return (
65-
<Box>
55+
<div>
6656
<Input
67-
mb={6}
57+
className="mb-6 w-full"
6858
onChange={handleSearch}
6959
placeholder={"Search by meetup title or location"}
7060
aria-describedby="input-instruction"
7161
/>
7262
{/* hidden for attachment to input only */}
73-
<VisuallyHidden hidden id="input-instruction">
63+
<span id="input-instruction" className="sr-only">
7464
results update as you type
75-
</VisuallyHidden>
76-
77-
<List
78-
m={0}
79-
border={"2px solid"}
80-
borderColor={"offBackground"}
65+
</span>
66+
<ul
67+
className="m-0 border-2 border-off-background"
8168
aria-label="Event meetup results"
8269
>
8370
{filteredMeetups.map((meetup, idx) => (
84-
<LinkBox
85-
as={ListItem}
71+
<BaseLink
72+
href={meetup.link}
73+
hideArrow
74+
// TODO: create custom class text-decoration-none
75+
className={cn(
76+
"group mb-[0.25px] flex w-full justify-between p-4 text-current no-underline",
77+
"hover:rounded hover:bg-table-background-hover hover:text-current hover:no-underline hover:shadow-[0_0_1px] hover:shadow-primary",
78+
"border-b-2 border-off-background"
79+
)}
8680
key={idx}
87-
display="flex"
88-
justifyContent="space-between"
89-
mb={0.25}
90-
p={4}
91-
w="100%"
92-
_hover={{
93-
textDecoration: "none",
94-
borderRadius: "base",
95-
boxShadow: `0 0 1px ${primaryBaseColor}`,
96-
bg: "tableBackgroundHover",
97-
}}
98-
borderBottom={"2px solid"}
99-
borderColor={"offBackground"}
10081
>
101-
<Flex flex="1 1 75%" me={4}>
102-
<Box me={4} opacity="0.4">
103-
{idx + 1}
104-
</Box>
105-
<Box>
106-
<LinkOverlay
107-
as={BaseLink}
108-
href={meetup.link}
109-
textDecor="none"
110-
color="text"
111-
hideArrow
112-
isExternal
82+
<Flex className="me-4 flex-[1_1_75%]">
83+
<div className="me-4 opacity-40">{idx + 1}</div>
84+
<div>
85+
<p
86+
// TODO: create custom class text-decoration-none
87+
className="no-underline group-hover:text-primary-hover group-hover:underline"
11388
>
11489
{meetup.title}
115-
</LinkOverlay>
116-
</Box>
90+
</p>
91+
</div>
11792
</Flex>
118-
<Flex
119-
textAlign="end"
120-
alignContent="flex-start"
121-
flex="1 1 25%"
122-
me={4}
123-
flexWrap="wrap"
124-
>
93+
<Flex className="me-4 flex-[1_1_25%] flex-wrap content-start items-center text-end">
12594
<Emoji
12695
text={meetup.emoji}
12796
className="me-2 text-md leading-none"
12897
/>
129-
<Text mb={0} opacity={"0.6"}>
130-
{meetup.location}
131-
</Text>
98+
<p className="mb-0 opacity-60">{meetup.location}</p>
13299
</Flex>
133-
<Flex alignItems={"center"}>
134-
<Icon
135-
as={FaChevronRight}
136-
width={{ base: "14px", xl: "18px" }}
137-
height={{ base: "14px", xl: "18px" }}
138-
color={"text"}
139-
/>
100+
<Flex className="items-center">
101+
<FaChevronRight className="h-[14px] w-[14px] xl:h-[18px] xl:w-[18px]" />
140102
</Flex>
141-
</LinkBox>
103+
</BaseLink>
142104
))}
143-
</List>
144-
<Box aria-live="assertive" aria-atomic>
105+
</ul>
106+
<div aria-live="assertive" aria-atomic>
145107
{!filteredMeetups.length && (
146108
<InfoBanner emoji=":information_source:">
147109
<Translation id="page-community:page-community-meetuplist-no-meetups" />{" "}
@@ -150,8 +112,8 @@ const MeetupList = () => {
150112
</InlineLink>
151113
</InfoBanner>
152114
)}
153-
</Box>
154-
</Box>
115+
</div>
116+
</div>
155117
)
156118
}
157119

src/styles/global.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
rgba(145, 234, 228, 0.2) 100%
5050
);
5151
--search-background: var(--background);
52+
--off-background: #f7f7f7;
53+
--table-background-hover: #f2f2f2;
5254
}
5355

5456
.dark {
@@ -83,6 +85,8 @@
8385
rgba(134, 253, 232, 0.08) 100%
8486
);
8587
--search-background: #4c4c4c;
88+
--off-background: #181818;
89+
--table-background-hover: rgba(255,115,36,.013);
8690
}
8791
}
8892

tailwind.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ const config = {
217217
"active-background": "hsla(var(--menu-4-active-background))",
218218
},
219219
},
220+
"off-background": "var(--off-background)",
221+
"table-background-hover": "var(--table-background-hover)",
220222
},
221223

222224
/** @deprecated */

0 commit comments

Comments
 (0)