mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-24 18:56:32 -05:00
Add show if component
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
parent
70c6f2cf74
commit
03e1bf361a
1 changed files with 9 additions and 0 deletions
9
src/components/common/show-if.tsx
Normal file
9
src/components/common/show-if.tsx
Normal file
|
@ -0,0 +1,9 @@
|
|||
import React, { Fragment } from 'react'
|
||||
|
||||
export interface ShowIfProps {
|
||||
condition: boolean
|
||||
}
|
||||
|
||||
export const ShowIf: React.FC<ShowIfProps> = ({ children, condition }) => {
|
||||
return condition ? <Fragment>{children}</Fragment> : null
|
||||
}
|
Loading…
Reference in a new issue