Skip to content

Commit 93e52c1

Browse files
Unify version select labels between docs and playground
1 parent 52b886f commit 93e52c1

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"unified": "^8.4.0"
5858
},
5959
"scripts": {
60-
"dev": "NODE_OPTIONS='--inspect' next dev",
60+
"dev": "next",
6161
"build": "rescript && npm run update-index && next build",
6262
"test": "node scripts/test-examples.mjs && node scripts/test-hrefs.mjs",
6363
"reanalyze": "reanalyze -all-cmt .",

src/Playground.res

+2-6
Original file line numberDiff line numberDiff line change
@@ -969,9 +969,7 @@ module Settings = {
969969
cmp(b) - cmp(a)
970970
})
971971
<>
972-
<option disabled=true className="py-4">
973-
{React.string("--- Experimental ---")}
974-
</option>
972+
<VersionSelect.SectionHeader value=Constants.dropdownLabelNext />
975973
{versionByOrder
976974
->Array.map(version => {
977975
let version = Semver.toString(version)
@@ -980,9 +978,7 @@ module Settings = {
980978
</option>
981979
})
982980
->React.array}
983-
<option disabled=true className="py-4">
984-
{React.string("--- Official Releases ---")}
985-
</option>
981+
<VersionSelect.SectionHeader value=Constants.dropdownLabelReleased />
986982
</>
987983
}}
988984
{switch stableVersions {

src/common/Constants.res

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ let nextVersion =
2525

2626
let allReactVersions = [("latest", "v0.12.0"), ("v0.11.0", "v0.11.0"), ("v0.10.0", "v0.10.0")]
2727

28+
let dropdownLabelNext = "--- Next ---"
29+
let dropdownLabelReleased = "--- Released ---"
30+
2831
// Used for the DocsOverview and collapsible navigation
2932
let languageManual = version => {
3033
[

src/components/VersionSelect.res

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
module SectionHeader = {
2+
@react.component
3+
let make = (~value) =>
4+
<option disabled=true key=value className="py-4"> {React.string(value)} </option>
5+
}
6+
17
@react.component
28
let make = (
39
~onChange,
@@ -18,13 +24,9 @@ let make = (
1824
| None => React.null
1925
| Some((value, label)) =>
2026
<>
21-
<option disabled=true key="next-heading" className="py-4">
22-
{React.string("--- Next ---")}
23-
</option>
27+
<SectionHeader value=Constants.dropdownLabelNext />
2428
<option className="py-4" key=value value> {React.string(label)} </option>
25-
<option disabled=true key="released-heading" className="py-4">
26-
{React.string("--- Released ---")}
27-
</option>
29+
<SectionHeader value=Constants.dropdownLabelReleased />
2830
</>
2931
}}
3032
{React.array(children)}

src/components/VersionSelect.resi

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
module SectionHeader: {
2+
@react.component
3+
let make: (~value: string) => React.element
4+
}
5+
16
@react.component
27
let make: (
38
~onChange: ReactEvent.Form.t => unit,

0 commit comments

Comments
 (0)