,
};
};
-
+/*
+ module Link = {
+ [@bs.config {jsx: 3}];
+
+ [@react.component]
+ let make = (~route: Route.t, ~id=?, ~title=?, ~className=?, ~popup=false, ~role=?, ~children) => {
+ let href = Route.routeToUrl(route);
+
+ children
+ ;
+ };
+
+ module Jsx2 = {
+ let component = ReasonReact.statelessComponent(__MODULE__);
+ let make = (~route: Route.t, ~id=?, ~title=?, ~className=?, ~popup=false, ~role=?, children) => {
+ ReasonReactCompat.wrapReactForReasonReact(
+ make,
+ makeProps(~route?, ~id?, ~title?, ~className?, ~popup?, ~role?, ~children, ()),
+ );
+ };
+ };
+ };
+ */
module Link = {
let component = ReasonReact.statelessComponent("LinkSafe");
diff --git a/client/src/Router.rei b/client/src/Router.rei
index a030d500..10e93da3 100644
--- a/client/src/Router.rei
+++ b/client/src/Router.rei
@@ -23,7 +23,8 @@ module Unload: {
*/
module Provider: {
let make:
- React.childless => React.component(unit, React.noRetainedProps, unit);
+ ReactOld.childless =>
+ ReactOld.component(unit, ReactOld.noRetainedProps, unit);
};
};
@@ -41,7 +42,11 @@ module Link: {
~className: string=?,
~popup: bool=?,
~role: string=?,
- array(React.reactElement)
+ array(ReactOld.reactElement)
) =>
- React.component(React.stateless, React.noRetainedProps, React.actionless);
+ ReactOld.component(
+ ReactOld.stateless,
+ ReactOld.noRetainedProps,
+ ReactOld.actionless,
+ );
};
diff --git a/client/src/Shortcut.re b/client/src/Shortcut.re
index 6fdeabe6..2f895cf5 100644
--- a/client/src/Shortcut.re
+++ b/client/src/Shortcut.re
@@ -74,3 +74,19 @@ module Consumer = {
render: _self => children(Store.subscribe),
};
};
+/* JSX3
+ module Consumer = {
+ [@react.component]
+ let make = (~children) => {children(Store.subscribe);};
+
+ module Jsx2 = {
+ let component = ReasonReact.statelessComponent(__MODULE__);
+ let make = (children) => {
+ ReasonReactCompat.wrapReactForReasonReact(
+ make,
+ makeProps(~children, ()),
+ );
+ };
+ };
+ };
+ */
diff --git a/client/src/components/FontFaceObserver.re b/client/src/components/FontFaceObserver.re
index fa94ba2d..32c0e5d4 100644
--- a/client/src/components/FontFaceObserver.re
+++ b/client/src/components/FontFaceObserver.re
@@ -33,7 +33,7 @@ module Provider = {
let component = ReasonReact.reducerComponent("FontFaceObserver_Provider");
let make:
- (~className: string=?, ~font: string=?, React.childless) =>
+ (~className: string=?, ~font: string=?, ReactOld.childless) =>
ReasonReact.component(unit, 'a, unit) =
(~className="fira-code", ~font="Fira Code", _children) => {
...component,
diff --git a/client/src/components/Layout_WithTopbar.re b/client/src/components/Layout_WithTopbar.re
index a6c31ed6..e1368eb5 100644
--- a/client/src/components/Layout_WithTopbar.re
+++ b/client/src/components/Layout_WithTopbar.re
@@ -1,3 +1,19 @@
+/*
+ [@bs.config {jsx: 3}];
+
+ [@react.component]
+ let make = (~children) => {<> children >};
+
+ module Jsx2 = {
+ let component = ReasonReact.statelessComponent(__MODULE__);
+ let make = (children) => {
+ ReasonReactCompat.wrapReactForReasonReact(
+ make,
+ makeProps(~children, ()),
+ );
+ };
+ };
+ */
let component = ReasonReact.statelessComponent("Layout_WithTopbar");
let make = children => {
diff --git a/client/src/components/UI_DateTime.re b/client/src/components/UI_DateTime.re
index 4ab74459..cf5c5643 100644
--- a/client/src/components/UI_DateTime.re
+++ b/client/src/components/UI_DateTime.re
@@ -1,3 +1,4 @@
+[@bs.config {jsx: 3}];
open Utils;
module Transformer: {
@@ -19,22 +20,22 @@ module Transformer: {
};
};
-let component = ReasonReact.statelessComponent("DateDisplay");
+[@react.component]
+let make = (~date: Js.Json.t, ~transformer=Transformer.relative, ~className=?) => {
+ let date = date |> Js.Json.decodeString;
+ switch (date) {
+ | None => ReasonReact.null
+ | Some(date) =>
+
+ };
+};
-let make =
- (
- ~date: Js.Json.t,
- ~transformer=Transformer.relative,
- ~className=?,
- _children,
- ) => {
- ...component,
- render: _self => {
- let date = date |> Js.Json.decodeString;
- switch (date) {
- | None => ReasonReact.null
- | Some(date) =>
-
- };
- },
+module Jsx2 = {
+ let component = ReasonReact.statelessComponent(__MODULE__);
+ let make = (~date: Js.Json.t, ~transformer=?, ~className=?) => {
+ ReasonReactCompat.wrapReactForReasonReact(
+ make,
+ makeProps(~date, ~transformer?, ~className?, ()),
+ );
+ };
};
diff --git a/client/src/components/UI_NoSketches.re b/client/src/components/UI_NoSketches.re
index 42bd3552..e365ca03 100644
--- a/client/src/components/UI_NoSketches.re
+++ b/client/src/components/UI_NoSketches.re
@@ -7,13 +7,13 @@ let make = (~className=?, _children) => {
...component,
render: _self =>
-
+
"Your sketches will show up here"->str
-
+
"Create New Sketch"->str
,
diff --git a/client/src/components/UI_SketchList.re b/client/src/components/UI_SketchList.re
index 8d3d7987..e9c1ca74 100644
--- a/client/src/components/UI_SketchList.re
+++ b/client/src/components/UI_SketchList.re
@@ -53,7 +53,7 @@ let make =
"last edited"->str
-
diff --git a/client/src/components/UI_SketchOwnerInfo.re b/client/src/components/UI_SketchOwnerInfo.re
index 24954e83..0cc382df 100644
--- a/client/src/components/UI_SketchOwnerInfo.re
+++ b/client/src/components/UI_SketchOwnerInfo.re
@@ -27,7 +27,7 @@ let make = (~owner, ~noteLastEdited=?, ~className=?, _children) => {
noteLastEdited =>
"last edited"->str
-
diff --git a/client/src/components/UI_Topbar.re b/client/src/components/UI_Topbar.re
index 5cb72d2e..de59dc0f 100644
--- a/client/src/components/UI_Topbar.re
+++ b/client/src/components/UI_Topbar.re
@@ -8,7 +8,7 @@ let loginButton =
className="btn btn-primary Topbar__login"
popup=true
route=Route.AuthGithub>
-
+
"Login with Github"->str
;
@@ -32,7 +32,7 @@ let make = _children => {
route={Route.NoteNew(RE)}
className="Topbar__action Topbar__action--highlight"
title="Create new Sketch">
-
+
"New Sketch"->str
diff --git a/client/src_editor/Editor_Blocks.re b/client/src_editor/Editor_Blocks.re
index ea4162c8..44f80094 100644
--- a/client/src_editor/Editor_Blocks.re
+++ b/client/src_editor/Editor_Blocks.re
@@ -578,7 +578,7 @@ let blockControlsButtons = (blockId, isDeleted, send) =>
className="block__controls--button"
ariaLabel="Add code block"
onClick={_ => send(Block_Add(blockId, BTyp_Code))}>
-
+
"+"->str
@@ -587,7 +587,7 @@ let blockControlsButtons = (blockId, isDeleted, send) =>
className="block__controls--button"
ariaLabel="Add text block"
onClick={_ => send(Block_Add(blockId, BTyp_Text))}>
-
+
"+"->str
@@ -597,7 +597,7 @@ let blockControlsButtons = (blockId, isDeleted, send) =>
className="block__controls--button block__controls--danger"
ariaLabel="Delete block"
onClick={_ => send(Block_QueueDelete(blockId))}>
-
+
"-"->str
@@ -606,7 +606,7 @@ let blockControlsButtons = (blockId, isDeleted, send) =>
className="block__controls--button"
ariaLabel="Restore block"
onClick={_ => send(Block_Restore(blockId))}>
-
+
"+"->str
}
@@ -624,7 +624,7 @@ let make =
~onExecute,
~registerExecuteCallback=?,
~registerShortcut: option(Shortcut.subscribeFun)=?,
- _children: React.childless,
+ _children: ReactOld.childless,
) => {
let makeInitialState = () => {
lang,
@@ -805,14 +805,14 @@ let make =
className="block__deleted--button restore"
onClick={_ => send(Block_Restore(b_id))}
ariaLabel="Restore block">
-
+
"Restore"->str
@@ -851,7 +851,7 @@ let make =
{readOnly
- ? React.null
+ ? ReactOld.null
: blockControlsButtons(b_id, b_deleted, send)}
@@ -878,7 +878,7 @@ let make =
/>
{readOnly
- ? React.null
+ ? ReactOld.null
:
{blockControlsButtons(b_id, b_deleted, send)}
}
diff --git a/client/src_editor/Editor_Blocks.rei b/client/src_editor/Editor_Blocks.rei
index 9745559b..55b8a179 100644
--- a/client/src_editor/Editor_Blocks.rei
+++ b/client/src_editor/Editor_Blocks.rei
@@ -39,6 +39,6 @@ let make:
~onExecute: bool => 'a,
~registerExecuteCallback: (unit => unit) => unit=?,
~registerShortcut: Shortcut.subscribeFun=?,
- React.childless
+ ReactOld.childless
) =>
ReasonReact.component(state, ReasonReact.noRetainedProps, action);
diff --git a/client/src_editor/Editor_Links.re b/client/src_editor/Editor_Links.re
index c145d930..6acccd55 100644
--- a/client/src_editor/Editor_Links.re
+++ b/client/src_editor/Editor_Links.re
@@ -112,7 +112,7 @@ module SingleLink = {
}}
{switch (onRefresh) {
@@ -123,9 +123,9 @@ module SingleLink = {
?
- : }
+ : }
{!state.isLinkRefreshing
? ReasonReact.null
: {
@@ -169,7 +169,7 @@ module SingleLink = {
"Revision from "->str
-
+
}}
@@ -236,17 +236,17 @@ module EmptyLink = {
}
disabled={status == Loading}>
{switch (status, state.dirty) {
- | (NotAsked, _) =>
- | (Loading, _) =>
+ | (NotAsked, _) =>
+ | (Loading, _) =>
| (Error(message), false) =>
<>
-
+
{(" " ++ message)->str}
>
- | (Error(_), true) =>
- | (Fetched, _) =>
+ | (Error(_), true) =>
+ | (Fetched, _) =>
}}
@@ -378,7 +378,7 @@ let make = (~currentSketchId, ~links, ~onUpdate, _children) => {
...
@@ -394,7 +394,7 @@ let make = (~currentSketchId, ~links, ~onUpdate, _children) => {
{str("Linkings")}
diff --git a/client/src_editor/Editor_Note.re b/client/src_editor/Editor_Note.re
index 90b32e53..2155ba81 100644
--- a/client/src_editor/Editor_Note.re
+++ b/client/src_editor/Editor_Note.re
@@ -211,10 +211,10 @@ module Editor_Note = {
loading={state.isExecuting} delayMs=500>
...{loading =>
loading
- ?
- :
+ :
}
"Run"->str
@@ -316,7 +316,7 @@ module Editor_Note = {
...{
fun
- | None => React.null
+ | None => ReactOld.null
| Some((user: Js.t('a))) =>
ClassNames.ifTrue("EditorNote__linkMenu--open"),
])}
onClick={_ => send(ToggleLinkMenu)}>
-
+
diff --git a/client/src_editor/Editor_Note_ForkButton.re b/client/src_editor/Editor_Note_ForkButton.re
index 53aaf5bf..9438299c 100644
--- a/client/src_editor/Editor_Note_ForkButton.re
+++ b/client/src_editor/Editor_Note_ForkButton.re
@@ -38,8 +38,8 @@ module ForkButton = {
...{loading =>
loading
- ?
- :
+ ?
+ :
}
"Fork"->str
@@ -263,7 +263,7 @@ let make =
...component,
render: _self =>
switch (noteState) {
- | NoteState_New => React.null
+ | NoteState_New => ReactOld.null
| NoteState_Old =>
...(
diff --git a/client/src_editor/Editor_Note_SaveButton.re b/client/src_editor/Editor_Note_SaveButton.re
index 2b3695d4..f44af31d 100644
--- a/client/src_editor/Editor_Note_SaveButton.re
+++ b/client/src_editor/Editor_Note_SaveButton.re
@@ -17,7 +17,7 @@ module SaveButton = {
~registerShortcut: Shortcut.subscribeFun,
_children,
)
- : React.component(unit, 'a, action) => {
+ : ReactOld.component(unit, 'a, action) => {
...component,
didMount: ({send, onUnmount}) =>
registerShortcut(
@@ -70,8 +70,8 @@ module SaveButton = {
...{loading =>
loading
- ?
- :
+ ?
+ :
}
"Save"->str
diff --git a/client/src_embed/Embed.re b/client/src_embed/Embed.re
index 2c35c603..25c4babf 100644
--- a/client/src_embed/Embed.re
+++ b/client/src_embed/Embed.re
@@ -216,7 +216,7 @@ let make = _children => {
}}