diff --git a/desktop/flipper-ui-core/src/sandy-chrome/LeftRail.tsx b/desktop/flipper-ui-core/src/sandy-chrome/LeftRail.tsx index 5b3701919..53ed50f1c 100644 --- a/desktop/flipper-ui-core/src/sandy-chrome/LeftRail.tsx +++ b/desktop/flipper-ui-core/src/sandy-chrome/LeftRail.tsx @@ -97,16 +97,8 @@ export function LeftRailButton({ title?: string; onClick?: React.MouseEventHandler; }) { - let iconElement = + const iconElement = icon && cloneElement(icon, {style: {fontSize: small ? 16 : 24}}); - if (count !== undefined) { - iconElement = - count === true ? ( - {iconElement} - ) : ( - {iconElement} - ); - } let res = ( ); + if (count !== undefined) { + res = + count === true ? ( + + {res} + + ) : ( + + {res} + + ); + } + if (title) { res = (