From c7ff6f6266c712ca6152d4038f8b960914282ddb Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Thu, 7 May 2020 11:11:39 -0700 Subject: [PATCH] Improve props for ToolbarIcon Summary: This allows props like `style` to be passed through (so it can be further styled), and makes `active` optional. Reviewed By: jknoxville Differential Revision: D21438791 fbshipit-source-id: bbab4a7768fce5de56e4deff67e50ff69914d123 --- desktop/app/src/ui/components/ToolbarIcon.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/desktop/app/src/ui/components/ToolbarIcon.tsx b/desktop/app/src/ui/components/ToolbarIcon.tsx index cc864476b..f0a55e864 100644 --- a/desktop/app/src/ui/components/ToolbarIcon.tsx +++ b/desktop/app/src/ui/components/ToolbarIcon.tsx @@ -12,32 +12,32 @@ import {colors} from './colors'; import styled from '@emotion/styled'; import React from 'react'; -type Props = { - title: string; +type Props = React.ComponentProps & { + active?: boolean; icon: string; - active: boolean; + title: string; onClick: () => void; }; -const ToolbarIcon = styled.div({ +const ToolbarIconContainer = styled.div({ marginRight: 9, marginTop: -3, marginLeft: 4, position: 'relative', // for settings popover positioning }); -export default function (props: Props) { +export default function ToolbarIcon({active, icon, ...props}: Props) { return ( - + - + ); }