From 88cad48cd9e31b5fe48d1d7fe559b94efaf0a96c Mon Sep 17 00:00:00 2001 From: Akin909 Date: Sun, 20 Jan 2019 14:44:56 +0000 Subject: [PATCH] Convert even more examples... --- examples/DefaultButton.re | 35 ++++++------- examples/Flexbox.re | 101 ++++++++++++++------------------------ examples/Focus.re | 52 +++++++++----------- examples/Overflow.re | 64 ++++++++++++------------ 4 files changed, 107 insertions(+), 145 deletions(-) diff --git a/examples/DefaultButton.re b/examples/DefaultButton.re index 99c1192a9..f988eaf2d 100644 --- a/examples/DefaultButton.re +++ b/examples/DefaultButton.re @@ -5,36 +5,30 @@ open Revery.Core; module DefaultButtonWithCounter = { let component = React.component("DefaultButtonWithCounter"); - let make = () => { + let make = () => component(slots => { let (count, setCount, _slots: React.Hooks.empty) = React.Hooks.state(0, slots); let increment = () => setCount(count + 1); let containerStyle = - Style.make( - ~justifyContent=JustifyCenter, - ~alignItems=AlignCenter, - (), - ); + Style.[justifyContent(`Center), alignItems(`Center)]; let countContainer = - Style.make( - ~width=300, - ~height=300, - ~alignItems=LayoutTypes.AlignCenter, - ~justifyContent=LayoutTypes.JustifyCenter, - (), - ); + Style.[ + width(300), + height(300), + alignItems(`Center), + justifyContent(`Center), + ]; let countStyle = - Style.make( - ~fontSize=50, - ~margin=24, - ~color=Colors.black, - ~fontFamily="Roboto-Regular.ttf", - (), - ); + Style.[ + fontSize(50), + margin(24), + color(Colors.black), + fontFamily("Roboto-Regular.ttf"), + ]; let countStr = string_of_int(count); @@ -45,7 +39,6 @@ module DefaultButtonWithCounter = {