From 831295f8688cf1ea5d0e8d1ca6efd612bf038bb2 Mon Sep 17 00:00:00 2001 From: Roman Galochkin Date: Fri, 10 Apr 2020 12:04:08 +0300 Subject: [PATCH] Revert "Adds a Home page with models table" This reverts commit 36e4a003 --- src/App.re | 9 ++++- src/pages/Home.re | 85 ----------------------------------------------- 2 files changed, 8 insertions(+), 86 deletions(-) delete mode 100644 src/pages/Home.re diff --git a/src/App.re b/src/App.re index e9dea9c3..236879d6 100644 --- a/src/App.re +++ b/src/App.re @@ -70,6 +70,13 @@ 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} @@ -108,7 +115,7 @@ let make = () => { | DistBuilder => | DistBuilder2 => | DistBuilder3 => - | Home => + | Home =>
{"Welcome" |> E.ste}
| _ =>
{"Page is not found" |> E.ste}
}}
; diff --git a/src/pages/Home.re b/src/pages/Home.re deleted file mode 100644 index 001ef4a1..00000000 --- a/src/pages/Home.re +++ /dev/null @@ -1,85 +0,0 @@ -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