Skip to content

Commit b41007f

Browse files
committed
make a new page
1 parent 5f13dff commit b41007f

File tree

4 files changed

+19
-34
lines changed

4 files changed

+19
-34
lines changed

data/sidebar_community.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"Resources": [
33
"overview",
4+
"content",
45
"roadmap",
56
"code-of-conduct",
67
"translations"
78
]
8-
}
9+
}

pages/community/content.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import CommunityContent from 'src/CommunityContent.mjs';
2+
3+
export default function Content(props) {
4+
return <CommunityContent {...props} />
5+
}

pages/community/overview.mdx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ description: "Community Resources Overview"
44
canonical: "/community/overview"
55
---
66

7-
import CommunityResources from "src/components/CommunityResources";
8-
9-
# Community
7+
# Community Overview
108

119
## Official Channels
1210

@@ -21,9 +19,6 @@ News are broadcasted on this site's blog, on Bluesky and X. Some extra, less imp
2119

2220
**We don't use any other channel to communicate officially**. Any announcement made by users on Reddit, Discord, Medium and others don't necessarily represent our intent.
2321

24-
## Community Resources
25-
<CommunityResources />
26-
2722
## Questions
2823

2924
Your questions can go on:

src/components/CommunityResources.res renamed to src/CommunityContent.res

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ type link = {
55
image: string,
66
}
77

8-
@module("../../data/resources.json")
8+
@module("../data/resources.json")
99
external resources: array<link> = "default"
1010

1111
let simplifyUrl = url =>
@@ -37,33 +37,17 @@ module LinkCard = {
3737
module LinkCards = {
3838
@react.component
3939
let make = () => {
40-
let (seeAll, setSeeAll) = React.useState(() => false)
41-
<>
42-
<div className="grid md:grid-cols-2 gap-6">
43-
{switch seeAll {
44-
| true => resources
45-
| false => resources->Array.slice(~start=0, ~end=6)
40+
<div className="grid md:grid-cols-2 gap-6">
41+
{resources
42+
->Array.map(link =>
43+
switch link.image {
44+
| "" => {...link, image: "/static/Art-3-rescript-launch.jpg"}
45+
| _ => link
4646
}
47-
->Array.map(link =>
48-
switch link.image {
49-
| "" => {...link, image: "/static/Art-3-rescript-launch.jpg"}
50-
| _ => link
51-
}
52-
)
53-
->Array.map(link => <LinkCard link key=link.title />)
54-
->React.array}
55-
</div>
56-
<div className="w-full flex justify-center mt-10">
57-
<Button onClick={_ => setSeeAll(prev => !prev)}>
58-
{React.string(
59-
switch seeAll {
60-
| true => "See less"
61-
| false => "See all"
62-
},
63-
)}
64-
</Button>
65-
</div>
66-
</>
47+
)
48+
->Array.map(link => <LinkCard link key=link.title />)
49+
->React.array}
50+
</div>
6751
}
6852
}
6953

0 commit comments

Comments
 (0)