From 1af461a7d3962b8b6b25b1782f60e342a9225006 Mon Sep 17 00:00:00 2001 From: Roman Galochkin Date: Thu, 27 Feb 2020 10:17:10 +0300 Subject: [PATCH] Adds reload buttons --- src/components/DistBuilder.re | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/components/DistBuilder.re b/src/components/DistBuilder.re index 02c674cb..78f6fd79 100644 --- a/src/components/DistBuilder.re +++ b/src/components/DistBuilder.re @@ -103,7 +103,10 @@ module Styles = { ), ]); let parent = - style([selector(".ant-input-number", [width(`percent(100.))])]); + style([ + selector(".ant-input-number", [width(`percent(100.))]), + selector(".anticon", [verticalAlign(`zero)]), + ]); let form = style([backgroundColor(hex("eee")), padding(em(1.))]); let dist = style([padding(em(1.))]); let spacer = style([marginTop(em(1.))]); @@ -139,6 +142,7 @@ module DemoDist = { [@react.component] let make = () => { + let (reloader, setRealoader) = React.useState(() => 1); let reform = Form.use( ~validationStrategy=OnDemand, @@ -237,14 +241,27 @@ let make = () => { reform.state.values.sampleCount |> string_of_int, reform.state.values.outputXYPoints |> string_of_int, reform.state.values.truncateTo |> string_of_int, + reloader |> string_of_int, |], ); + let onRealod = _ => { + setRealoader(_ => reloader + 1); + }; +
demoDist
- E.ste}> + E.ste} + extra={ + + }> @@ -353,6 +370,10 @@ let make = () => { + + {"Update Distribution" |> E.ste} +