Commit 62d5ff14 authored by Yoelis Acourt's avatar Yoelis Acourt

feat: add helper hide function

parent dc896c1b
...@@ -53,6 +53,13 @@ feature = R2.renderLeaf "" $ ...@@ -53,6 +53,13 @@ feature = R2.renderLeaf "" $
render shouldRender render shouldRender
) )
hide = R2.renderLeaf "" $
( \{ keys, render } _ -> do
shouldRender <- useFeatureFlag keys
pure $
if shouldRender then render else H.text ""
)
hideBehind :: forall a. Array String -> R2.Component a -> R2.Component a hideBehind :: forall a. Array String -> R2.Component a -> R2.Component a
hideBehind keys cpt = R2.renderComponent "" \props children -> do hideBehind keys cpt = R2.renderComponent "" \props children -> do
shouldRender <- useFeatureFlag keys shouldRender <- useFeatureFlag keys
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment