From fff4dd7e947f7f66e0854dea5d192c72b9e3d674 Mon Sep 17 00:00:00 2001 From: Fred Carlsen Date: Fri, 30 Nov 2018 12:05:08 +0100 Subject: Export svgs as typed pure components --- packages/website/ts/@next/components/icon.tsx | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'packages/website/ts/@next/components/icon.tsx') diff --git a/packages/website/ts/@next/components/icon.tsx b/packages/website/ts/@next/components/icon.tsx index 10916f28e..112d4ed68 100644 --- a/packages/website/ts/@next/components/icon.tsx +++ b/packages/website/ts/@next/components/icon.tsx @@ -3,20 +3,23 @@ import styled from 'styled-components'; interface Props { icon: any; - size?: any; + size?: string; } -const StyledIcon = styled.div` +export const IconClass: React.FunctionComponent = (props: Props) => { + const { icon, size } = props; + + return ( +
+ ); +}; + +export const Icon = styled(IconClass)` margin: auto; flex-shrink: 0; ${(props: Props) => props.size && ` - width: ${props.size}; height: auto; + width: ${props.size}; + height: auto; `} `; - -export const Icon: React.StatelessComponent = ({ icon, ...props }) => ( - <> - - -); -- cgit