diff --git a/src/App.re b/src/App.re index 8b6ef967..08c337fb 100644 --- a/src/App.re +++ b/src/App.re @@ -1,11 +1,13 @@ type route = | Model(string) + | FormBuilder | Home | NotFound; let routeToPath = route => switch (route) { - | Model(i) => "/m/" ++ i + | Model(modelId) => "/m/" ++ modelId + | FormBuilder => "/form-builder" | Home => "/" | _ => "/" }; @@ -66,11 +68,14 @@ module Menu = { {"Home" |> E.ste} {Models.all |> E.A.fmap((model: Prop.Model.t) => { - + {model.name |> E.ste} }) |> ReasonReact.array} + + {"Form Builder" |> E.ste} + ; }; }; @@ -82,6 +87,7 @@ let make = () => { let routing = switch (url.path) { | ["m", modelId] => Model(modelId) + | ["form-builder"] => FormBuilder | [] => Home | _ => NotFound }; @@ -89,13 +95,14 @@ let make = () => {
{switch (routing) { - | Model(n) => - switch (Models.getById(n)) { - | Some(model) => + | Model(id) => + switch (Models.getById(id)) { + | Some(model) => | None =>
{"Page is not found" |> E.ste}
} + | FormBuilder =>
{"Form Builder" |> E.ste}
| Home =>
{"Welcome" |> E.ste}
| _ =>
{"Page is not found" |> E.ste}
}}
; -}; \ No newline at end of file +};