Skip to content

Commit 251447f

Browse files
authored
feat: add colors to the framework filters on partner screen (#463)
1 parent 9e97fb5 commit 251447f

File tree

3 files changed

+33
-22
lines changed

3 files changed

+33
-22
lines changed

src/routes/_libraries/maintainers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ function RouteComponent() {
679679
}
680680
`}</style>
681681

682-
<div className="flex flex-col max-w-full min-h-screen gap-12 p-4 md:p-8 pb-0">
682+
<div className="flex flex-col w-full min-h-screen gap-12 p-4 md:p-8 pb-0">
683683
<div className="flex-1 flex flex-col gap-16 w-full max-w-4xl mx-auto">
684684
<header className="text-center pt-8">
685685
<h1 className="text-center text-3xl leading-8 font-extrabold tracking-tight sm:text-4xl sm:leading-10 lg:leading-none mb-6">

src/routes/_libraries/partners.tsx

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,36 @@
11
import { Footer } from '~/components/Footer'
22
import { partners } from '~/utils/partners'
33
import { seo } from '~/utils/seo'
4-
import { Link, useNavigate } from '@tanstack/react-router'
54
import { z } from 'zod'
65
import { Library } from '~/libraries'
76
import { useState } from 'react'
87
import * as React from 'react'
98
import { MdClose, MdFilterList } from 'react-icons/md'
9+
import { startProject } from '~/libraries/start'
10+
import { routerProject } from '~/libraries/router'
11+
import { queryProject } from '~/libraries/query'
12+
import { tableProject } from '~/libraries/table'
13+
import { configProject } from '~/libraries/config'
14+
import { dbProject } from '~/libraries/db'
15+
import { formProject } from '~/libraries/form'
16+
import { pacerProject } from '~/libraries/pacer'
17+
import { rangerProject } from '~/libraries/ranger'
18+
import { storeProject } from '~/libraries/store'
19+
import { virtualProject } from '~/libraries/virtual'
20+
21+
const availableLibraries = [
22+
startProject,
23+
routerProject,
24+
queryProject,
25+
tableProject,
26+
formProject,
27+
virtualProject,
28+
rangerProject,
29+
storeProject,
30+
pacerProject,
31+
dbProject,
32+
configProject,
33+
]
1034

1135
const librarySchema = z.enum([
1236
'start',
@@ -21,6 +45,7 @@ const librarySchema = z.enum([
2145
'db',
2246
'config',
2347
'react-charts',
48+
'devtools',
2449
'create-tsrouter-app',
2550
])
2651

@@ -48,7 +73,6 @@ interface FilterProps {
4873
onStatusChange: (status: 'active' | 'inactive' | undefined) => void
4974
onClearAll: () => void
5075
}
51-
5276
function PartnersFilter({
5377
selectedLibraries,
5478
selectedStatus,
@@ -58,20 +82,6 @@ function PartnersFilter({
5882
}: FilterProps) {
5983
const [isOpen, setIsOpen] = useState(false)
6084

61-
const availableLibraries: Array<{ id: Library['id']; name: string }> = [
62-
{ id: 'start', name: 'TanStack Start' },
63-
{ id: 'router', name: 'TanStack Router' },
64-
{ id: 'query', name: 'TanStack Query' },
65-
{ id: 'table', name: 'TanStack Table' },
66-
{ id: 'form', name: 'TanStack Form' },
67-
{ id: 'virtual', name: 'TanStack Virtual' },
68-
{ id: 'ranger', name: 'TanStack Ranger' },
69-
{ id: 'store', name: 'TanStack Store' },
70-
{ id: 'pacer', name: 'TanStack Pacer' },
71-
{ id: 'db', name: 'TanStack DB' },
72-
{ id: 'config', name: 'TanStack Config' },
73-
]
74-
7585
const toggleLibrary = (libraryId: Library['id']) => {
7686
if (!selectedLibraries) {
7787
onLibrariesChange([libraryId])
@@ -196,14 +206,16 @@ function PartnersFilter({
196206
const isSelected =
197207
selectedLibraries?.includes(library.id) || false
198208

209+
const bgStyle = library.bgStyle ?? 'bg-gray-500'
210+
199211
return (
200212
<button
201213
key={library.id}
202214
onClick={() => toggleLibrary(library.id)}
203215
className={`text-left px-3 py-2 rounded-md text-sm transition-colors ${
204216
isSelected
205-
? 'bg-blue-500 text-white'
206-
: 'bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600'
217+
? `${bgStyle} text-white`
218+
: `${bgStyle}/30 text-gray-700 dark:text-gray-300 hover:${bgStyle}/40`
207219
}`}
208220
>
209221
{library.name}
@@ -287,10 +299,9 @@ export default function RouteComp() {
287299
const hasResults = filteredPartners.length > 0
288300
const isShowingPrevious = search.status === 'inactive'
289301
const isShowingActive = search.status === 'active'
290-
const isShowingAll = !search.status
291302

292303
return (
293-
<div className="flex flex-col max-w-full min-h-screen gap-12 p-4 md:p-8 pb-0">
304+
<div className="flex flex-col w-full min-h-screen gap-12 p-4 md:p-8 pb-0">
294305
<div className="flex-1 space-y-16 w-full max-w-4xl mx-auto">
295306
<header className="text-center pt-8">
296307
<h1 className="text-center text-3xl leading-8 font-extrabold tracking-tight sm:text-4xl sm:leading-10 lg:leading-none mb-6">

src/styles/app.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
}
4343

4444
/* Safelist for dynamic colors */
45-
@source inline('{bg-blue-{4,5,6}00,bg-emerald-500,bg-purple-500,bg-pink-500,bg-cyan-500,bg-slate-{4,5}00,bg-twine-700,bg-orange-{5,6,7}00,bg-yellow-500,bg-lime-700,bg-red-500,bg-green-500}/{20,40,80}');
45+
@source inline('{bg-blue-{4,5,6}00,bg-emerald-500,bg-purple-500,bg-pink-500,bg-cyan-500,bg-slate-{4,5}00,bg-twine-700,bg-orange-{5,6,7}00,bg-yellow-500,bg-lime-700,bg-red-500,bg-green-500}/{20,30,40,80}');
4646
@source inline('{hover:{bg-blue-{4,5,6}00,bg-emerald-500,bg-purple-500,bg-pink-500,bg-cyan-500,bg-slate-{4,5}00,bg-twine-700,bg-orange-{5,6,7}00,bg-yellow-500,bg-lime-700,bg-red-500,bg-green-500}/40}');
4747

4848
@layer base {

0 commit comments

Comments
 (0)