Skip to content

Commit cddb340

Browse files
committed
Support dark mode
1 parent 1b9d66f commit cddb340

26 files changed

+66
-48
lines changed

src/components/Tooling/Content/AdditionalInfo/AdditionalInfo.module.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
display: none;
1818
}
1919
.infoBox {
20-
background: #fff;
2120
padding: 18px 20px;
2221
width: 100%;
2322
}
@@ -27,7 +26,6 @@
2726
}
2827

2928
.title {
30-
color: #101010;
3129
font-size: 18px;
3230
font-style: normal;
3331
font-weight: 600;

src/components/Tooling/Content/AdditionalInfo/AdditionalInfo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ const AdditionalInfo = ({ data, selectedTool, onClose }) => {
3737
</div>
3838

3939
{status === Status.HAS_ADDITIONAL_INFO && (
40-
<div className={styles.infoBox}>
41-
<div className={styles.title}>{selectedTool.remarkPluginFrontmatter.name}</div>
40+
<div className={clsx(styles.infoBox, 'bg-[#ffffff] dark:bg-black')}>
41+
<div className={clsx(styles.title, "text-[#101010] dark:text-white")}>{selectedTool.remarkPluginFrontmatter.name}</div>
4242
<div className={styles.content}>{data}</div>
4343
</div>
4444
)}

src/components/Tooling/Content/Category/Category.module.css

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@
1818
margin-bottom: 10px;
1919
border-width: 1px;
2020
border-style: solid;
21-
background: #ffffff;
22-
@apply border-black dark:border-white;
2321
}
2422
.toolsCategory .item.active {
25-
@apply text-white bg-black dark:text-black dark:bg-white;
2623
}
2724
@media screen and (max-width: 50em) {
2825
.toolsCategory .item {

src/components/Tooling/Content/Category/Category.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ const Category = ({ categories, value, onChange }) => {
77
<ul className={styles.toolsCategory}>
88
{categories.map((category) => (
99
<li
10-
className={clsx(styles.item, value.includes(category) ? styles.active : "")}
10+
className={clsx(
11+
styles.item,
12+
value.includes(category)
13+
? "text-white bg-black border-white dark:text-black dark:bg-white dark:border-black"
14+
: "border-black bg-[#ffffff] dark:bg-black dark:border-white",
15+
)}
1116
onClick={() => onChange(category)}
1217
>
1318
{category}

src/components/Tooling/Content/Content.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.toolsContainer {
22
border-radius: 27px;
3-
background: #fff8f3;
3+
/* background: #fff8f3; */
44
padding: 30px;
55
}
66

src/components/Tooling/Content/Content.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ const Content = ({ tools, toolsMarkdown }) => {
6868
searchParams.category.length === 0 ||
6969
searchParams.category.some((category) => tool.remarkPluginFrontmatter.category.includes(category))
7070
const networkMatch =
71-
searchParams.network === "All networks" || tool.remarkPluginFrontmatter.network === searchParams.network
71+
searchParams.network === "All networks" || tool.remarkPluginFrontmatter.network.includes(searchParams.network)
7272
const keywordMatch = tool.remarkPluginFrontmatter.name.toLowerCase().includes(searchParams.keyword.toLowerCase())
7373

7474
return categoryMatch && networkMatch && keywordMatch
7575
})
7676
}, [searchParams])
7777

7878
return (
79-
<div className={styles.toolsContainer}>
79+
<div className={clsx(styles.toolsContainer, 'bg-white dark:bg-dark-normal')}>
8080
<Category categories={categories} value={searchParams.category} onChange={handleChangeCategory} />
8181
<div className="flex">
8282
<SearchInput value={searchParams.keyword} onChange={handleChangeKeyword} />

src/components/Tooling/Content/List/List.module.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.toolsContainerList {
2-
background: #ffffff;
32
border-radius: 15px;
43
height: 532px;
54
overflow: auto;
@@ -9,7 +8,8 @@
98
padding: 20px;
109
}
1110

12-
.toolItem:hover {
11+
.toolItem:hover,
12+
.toolItem.active {
1313
background-color: #f9f9f9;
1414
cursor: pointer;
1515
}
@@ -55,7 +55,6 @@
5555
}
5656

5757
.toolDescription {
58-
color: #5b5b5b;
5958
font-size: 14px;
6059
font-style: normal;
6160
font-weight: 400;

src/components/Tooling/Content/List/List.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import styles from "./List.module.css"
22
import LinesEllipsis from "../../../../components/LinesEllipsis"
3+
import { clsx } from "~/lib"
34

45
const List = ({ tools, onChange, selectedTool }) => {
56
const handleReflow = (value) => {
@@ -11,17 +12,24 @@ const List = ({ tools, onChange, selectedTool }) => {
1112
}
1213

1314
return (
14-
<div className={styles.toolsContainerList}>
15+
<div className={clsx(styles.toolsContainerList, "bg-[#ffffff] dark:bg-dark-normal")}>
1516
{tools.map((tool, index) => (
16-
<div onClick={() => onChange(tool)} className={styles.toolItem}>
17+
<div
18+
onClick={() => onChange(tool)}
19+
className={clsx(
20+
styles.toolItem,
21+
tool.id === selectedTool?.id && "bg-[#f9f9f9] dark:bg-black",
22+
"hover:bg-[#f9f9f9] dark:hover:bg-black"
23+
)}
24+
>
1725
<img
1826
src={tool.remarkPluginFrontmatter.logo.src}
1927
alt={tool.remarkPluginFrontmatter.logo.alt}
2028
className={styles.logo}
2129
/>
2230
<div className={styles.toolInfo}>
2331
<div className="flex justify-between items-center mb-[7px]">
24-
<div className={styles.toolName}>
32+
<div className={clsx(styles.toolName, "dark:text-white dark:hover:text-white")}>
2533
{tool.remarkPluginFrontmatter.name}
2634
<svg
2735
className="ml-[8px] mr-[25px] hover:opacity-70"
@@ -35,7 +43,7 @@ const List = ({ tools, onChange, selectedTool }) => {
3543
<g clip-path="url(#clip0_781_1088)">
3644
<path
3745
d="M11.9944 5.75C11.9944 5.59833 11.9389 5.44922 11.8241 5.33766L7.02413 0.67099C6.90938 0.559063 6.756 0.50474 6.6 0.50474V0.5H3C1.34588 0.5 0 1.80849 0 3.41667V11.5833C0 13.1915 1.34588 14.5 3 14.5H9C10.6541 14.5 12 13.1915 12 11.5833V5.75H11.9944ZM7.2 2.49172L9.95175 5.16703H9C8.00738 5.16703 7.2 4.38208 7.2 3.41703V2.49172ZM9 13.3333H3C2.00738 13.3333 1.2 12.5484 1.2 11.5833V3.41667C1.2 2.45161 2.00738 1.66667 3 1.66667H6V3.41667C6 5.02484 7.34588 6.33333 9 6.33333H10.8V11.5833C10.8 12.5484 9.99263 13.3333 9 13.3333ZM9 11C9 11.3223 8.7315 11.5833 8.4 11.5833H3.6C3.2685 11.5833 3 11.3223 3 11C3 10.6777 3.2685 10.4167 3.6 10.4167H8.4C8.7315 10.4167 9 10.6777 9 11ZM9 8.66667C9 8.98896 8.7315 9.25 8.4 9.25H3.6C3.2685 9.25 3 8.98896 3 8.66667C3 8.34437 3.2685 8.08333 3.6 8.08333H8.4C8.7315 8.08333 9 8.34437 9 8.66667ZM3 6.33333C3 6.01104 3.2685 5.75 3.6 5.75H4.8C5.1315 5.75 5.4 6.01104 5.4 6.33333C5.4 6.65562 5.1315 6.91667 4.8 6.91667H3.6C3.2685 6.91667 3 6.65562 3 6.33333Z"
38-
fill="#5B5B5B"
46+
fill="currentColor"
3947
/>
4048
</g>
4149
<defs>
@@ -52,17 +60,17 @@ const List = ({ tools, onChange, selectedTool }) => {
5260
fill-rule="evenodd"
5361
clip-rule="evenodd"
5462
d="M8 14.5714C11.6286 14.5714 14.5714 11.6286 14.5714 8C14.5714 4.37143 11.6286 1.42857 8 1.42857C4.37143 1.42857 1.42857 4.37143 1.42857 8C1.42857 11.6286 4.37143 14.5714 8 14.5714ZM8 16C12.4171 16 16 12.4171 16 8C16 3.58286 12.4171 0 8 0C3.58286 0 0 3.58286 0 8C0 12.4171 3.58286 16 8 16Z"
55-
fill="#101010"
63+
fill="currentColor"
5664
/>
5765
<path
5866
fill-rule="evenodd"
5967
clip-rule="evenodd"
6068
d="M8 6.35429C8.39429 6.35429 8.71429 6.67429 8.71429 7.06857V11.64C8.71429 12.0343 8.39429 12.3543 8 12.3543C7.60571 12.3543 7.28571 12.0343 7.28571 11.64V7.06857C7.28571 6.67429 7.60571 6.35429 8 6.35429Z"
61-
fill="#101010"
69+
fill="currentColor"
6270
/>
6371
<path
6472
d="M8 5.06857C8.39449 5.06857 8.71429 4.74878 8.71429 4.35429C8.71429 3.9598 8.39449 3.64 8 3.64C7.60551 3.64 7.28571 3.9598 7.28571 4.35429C7.28571 4.74878 7.60551 5.06857 8 5.06857Z"
65-
fill="#101010"
73+
fill="currentColor"
6674
/>
6775
</svg>
6876
)}
@@ -80,7 +88,7 @@ const List = ({ tools, onChange, selectedTool }) => {
8088
maxLine={tool.id === selectedTool?.id ? 100 : 1}
8189
ellipsis={
8290
<>
83-
&thinsp;...&thinsp;<span className="underline text-[#ABABAB]">more</span>
91+
&thinsp;...&thinsp;<span className="underline text-[#ABABAB] dark:text-[#5b5b5b]">more</span>
8492
</>
8593
}
8694
basedOn="words"

src/components/Tooling/Content/Search/SearchInput.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ const SearchInput = ({ value, onChange }) => {
1111
className={clsx(
1212
styles.input,
1313
".focus-visible",
14-
"dark:text-white",
15-
"dark:border-white",
16-
"dark:!bg-[url(/assets/search-white.svg)]"
1714
)}
1815
onChange={onChange}
1916
ref={inputRef}

src/content/config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const docsCollection = defineCollection({
1818
stub: z.string().optional(),
1919
ecosystem: z.string().optional(),
2020
l2healthflag: z.string().optional(),
21+
widerContent: z.boolean().optional(),
2122

2223
metadata: z
2324
.object({
@@ -36,7 +37,8 @@ const toolsCollection = defineCollection({
3637
name: z.string(),
3738
excerpt: z.string(),
3839
category: z.array(z.string()),
39-
network: z.string().optional(),
40+
// network: z.string().optional(),
41+
network: z.array(z.string()).optional(),
4042
logo: z
4143
.object({
4244
src: z.string().optional(),

0 commit comments

Comments
 (0)