From 03e1bf361ad2d9b2928505f04768c19fb15ccab9 Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Thu, 4 Jun 2020 22:52:23 +0200 Subject: [PATCH] Add show if component Signed-off-by: Tilman Vatteroth --- src/components/common/show-if.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/components/common/show-if.tsx diff --git a/src/components/common/show-if.tsx b/src/components/common/show-if.tsx new file mode 100644 index 000000000..740e2782e --- /dev/null +++ b/src/components/common/show-if.tsx @@ -0,0 +1,9 @@ +import React, { Fragment } from 'react' + +export interface ShowIfProps { + condition: boolean +} + +export const ShowIf: React.FC = ({ children, condition }) => { + return condition ? {children} : null +}