File tree Expand file tree Collapse file tree 7 files changed +9
-30
lines changed
Expand file tree Collapse file tree 7 files changed +9
-30
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,6 @@ let loader: ReactRouter.Loader.t<loaderData> = async args => {
110110 let data = {
111111 // TODO POST RR7: refactor this function to only return the module and not the toctree
112112 // or move the toc logic to this function
113- // TODO move the loader function to its own file
114113 try {
115114 await ApiDocs .getStaticProps (path )
116115 } catch {
Original file line number Diff line number Diff line change @@ -14,7 +14,14 @@ let transform = (mdx: Mdx.attributes): BlogApi.post => {
1414 frontmatter : {
1515 author : BlogFrontmatter .authors
1616 -> Array .find (author => author .username -> String .includes (mdx .author ))
17- -> Option .getOrThrow , // TODO: this is probably unsafe and needs to be fixed
17+ -> Option .getOr ({
18+ // Fallback to the ReScript Team if we can't find a matching author
19+ username : "rescript-team" ,
20+ fullname : "ReScript Team" ,
21+ role : "Core Development" ,
22+ imgUrl : "https://pbs.twimg.com/profile_images/1358354824660541440/YMKNWE1V_400x400.png" ,
23+ social : X ("rescriptlang" ),
24+ }),
1825 co_authors : (mdx .co_authors -> Nullable .getOr ([]) :> array <BlogFrontmatter .author >),
1926 date : mdx .date ,
2027 previewImg : mdx .previewImg ,
Original file line number Diff line number Diff line change @@ -65,8 +65,6 @@ let make = (
6565 }
6666 })
6767 }
68- // TODO - Replace this with just using tailwind show and transitions?
69- // It's causing a hydration mismatch
7068 <div className >
7169 <div className = "w-full" onClick >
7270 <HeadlessUI .Transition
Original file line number Diff line number Diff line change @@ -46,8 +46,7 @@ module UrlBox = {
4646 let imgEl = <img src = "/hyperlink.svg" className = "mr-2 inline-block" />
4747
4848 @react.component
49- let // TODO: can this href be a Path.t somehow?
50- make = (~text : string , ~href : string , ~children : MdxLegacy .MdxChildren .t ) => {
49+ let make = (~text : string , ~href : string , ~children : MdxLegacy .MdxChildren .t ) => {
5150 let content = switch classify (children ) {
5251 | String (str ) =>
5352 <p >
@@ -117,14 +116,12 @@ module Anchor = {
117116 <span className = "inline group relative" title >
118117 <a
119118 title
120- // TODO RR7: the scroll margin might need some tweaking for media breakpoints
121119 className = "scroll-mt-30 invisible text-gray-60 opacity-50 hover:opacity-100 hover:text-gray-60 hover:cursor-pointer group-hover:visible"
122120 href = {"#" ++ id }
123121 id = {"#" ++ id }
124122 >
125123 <Icon .Hyperlink className = "inline-block align-middle text-gray-40" />
126124 </a >
127- // <a className="absolute -top-28" id />
128125 </span >
129126 }
130127}
@@ -139,7 +136,6 @@ module H2 = {
139136 @react.component
140137 let make = (~id , ~children ) => {
141138 // Children may not be a string
142- // TODO: RR7 - this can be improved, but I need to figure out what the other possible types are
143139 let title = {
144140 try {
145141 childrenToString (children )-> Url .normalizeAnchor
Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ let make = (
4949
5050 let full = (ctrlKey ? "CTRL+" : "" ) ++ key
5151
52- // TODO RR7 test keyboard input
5352 switch full {
5453 | "Escape" => onClear ()
5554 | "Tab" =>
Original file line number Diff line number Diff line change @@ -76,25 +76,6 @@ let make = (
7676 let (isSidebarOpen , setSidebarOpen ) = React .useState (_ => false )
7777 let toggleSidebar = () => setSidebarOpen (prev => ! prev )
7878
79- React .useEffect (() => {
80- // TODO: replicate this for React Router
81- // open Next.Router.Events
82- // let {Next.Router.events: events} = router
83-
84- // let onChangeComplete = _url => setSidebarOpen(_ => false)
85-
86- // events->on(#routeChangeComplete(onChangeComplete))
87- // events->on(#hashChangeComplete(onChangeComplete))
88-
89- // Some(
90- // () => {
91- // events->off(#routeChangeComplete(onChangeComplete))
92- // events->off(#hashChangeComplete(onChangeComplete))
93- // },
94- // )
95- None
96- }, [])
97-
9879 let navigate = ReactRouter .useNavigate ()
9980
10081 let preludeSection =
Original file line number Diff line number Diff line change @@ -292,7 +292,6 @@ let make = (
292292 | None => React .null
293293 }
294294
295- // TODO: RR7 figure this out
296295 let pagination = switch categories {
297296 | Some (categories ) =>
298297 let items = categories -> Array .flatMap (c => c .items )
You can’t perform that action at this time.
0 commit comments