diff --git a/src/App.re b/src/App.re index 236879d6..e9dea9c3 100644 --- a/src/App.re +++ b/src/App.re @@ -70,13 +70,6 @@ module Menu = { let make = () => {
{"Home" |> E.ste} - {Models.all - |> E.A.fmap((model: Prop.Model.t) => { - - {model.name |> E.ste} - - }) - |> ReasonReact.array} {"Dist Builder" |> E.ste} @@ -115,7 +108,7 @@ let make = () => { | DistBuilder => | DistBuilder2 => | DistBuilder3 => - | Home =>
{"Welcome" |> E.ste}
+ | Home => | _ =>
{"Page is not found" |> E.ste}
}}
; diff --git a/src/pages/Home.re b/src/pages/Home.re new file mode 100644 index 00000000..001ef4a1 --- /dev/null +++ b/src/pages/Home.re @@ -0,0 +1,85 @@ +type route = + | Model(string); + +let routeToPath = route => + switch (route) { + | Model(modelId) => "/m/" ++ modelId + }; + +module Models = { + let all = [| + EAFunds.Interface.model, + GlobalCatastrophe.Interface.model, + Human.Interface.model, + |]; + let getById = id => E.A.getBy(all, r => r.id == id); +}; + +module Styles = { + open Css; + let h3 = style([fontSize(`em(1.5)), marginBottom(`em(1.5))]); + let card = style([marginTop(`em(2.)), marginBottom(`em(2.))]); +}; + +module Table = { + module TableStyles = { + open Css; + let row = style([display(`flex), height(`em(4.))]); + let col = (~f=1.0, ()) => { + style([flex(`num(f))]); + }; + }; + + module Item = { + [@react.component] + let make = (~model: Prop.Model.t, ~children) => { +
+
+ { + e->ReactEvent.Synthetic.preventDefault; + ReasonReactRouter.push(routeToPath(Model(model.id))); + }}> + children + +
+
+ {model.description |> E.ste} +
+
{model.author |> E.ste}
+
; + }; + }; + + module ColumnsTitles = { + [@react.component] + let make = () => { +
+
{"Name" |> E.ste}
+
+ {"Description" |> E.ste} +
+
{"Author" |> E.ste}
+
; + }; + }; + + [@react.component] + let make = () => { + <> +

{"Probability Models" |> E.ste}

+ + {Models.all + |> E.A.fmap((model: Prop.Model.t) => { + {model.name |> E.ste} + }) + |> ReasonReact.array} + ; + }; +}; + +[@react.component] +let make = () => { +
; +}; \ No newline at end of file