Make glyph optional

Summary:
Make it optional to display the icon (glyph) with a default of true.

Not used in this diff, but it will in future diffs.

Reviewed By: ivanmisuno

Differential Revision: D43186605

fbshipit-source-id: b525e126bcc46604e0abc0f83b6ff33a7ce78962
This commit is contained in:
Lorenzo Blasa
2023-02-10 06:04:04 -08:00
committed by Facebook GitHub Bot
parent 5fc0bcb631
commit ada748170f

View File

@@ -14,16 +14,22 @@ import {theme} from 'flipper-plugin';
type NoDataProps = { type NoDataProps = {
message: string; message: string;
displayIcon?: boolean;
}; };
export const NoData: React.FC<NoDataProps> = ({message}) => { export const NoData: React.FC<NoDataProps> = ({
message,
displayIcon = true,
}) => {
return ( return (
<div style={{textAlign: 'center'}}> <div style={{textAlign: 'center'}}>
<Glyph {displayIcon && (
name="stop" <Glyph
size={24} name="stop"
style={{margin: 20}} size={24}
color={theme.primaryColor} style={{margin: 20}}
/> color={theme.primaryColor}
/>
)}
<p>{message}</p> <p>{message}</p>
</div> </div>
); );