diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-12-19 05:24:53 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-12-19 05:24:53 +0800 |
commit | 9bd71aeeffbadebb41756a605ef6a0aacbfd47c4 (patch) | |
tree | 9306ea2225370a02d1ed00791faee6616740c59b /packages/website/ts/@next/components/icon.tsx | |
parent | 59d7efa78af41a91617b5a1f253a0f7e17553dca (diff) | |
download | dexon-sol-tools-9bd71aeeffbadebb41756a605ef6a0aacbfd47c4.tar dexon-sol-tools-9bd71aeeffbadebb41756a605ef6a0aacbfd47c4.tar.gz dexon-sol-tools-9bd71aeeffbadebb41756a605ef6a0aacbfd47c4.tar.bz2 dexon-sol-tools-9bd71aeeffbadebb41756a605ef6a0aacbfd47c4.tar.lz dexon-sol-tools-9bd71aeeffbadebb41756a605ef6a0aacbfd47c4.tar.xz dexon-sol-tools-9bd71aeeffbadebb41756a605ef6a0aacbfd47c4.tar.zst dexon-sol-tools-9bd71aeeffbadebb41756a605ef6a0aacbfd47c4.zip |
run prettier on website
Diffstat (limited to 'packages/website/ts/@next/components/icon.tsx')
-rw-r--r-- | packages/website/ts/@next/components/icon.tsx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/packages/website/ts/@next/components/icon.tsx b/packages/website/ts/@next/components/icon.tsx index d9632a3c7..fc9d488f9 100644 --- a/packages/website/ts/@next/components/icon.tsx +++ b/packages/website/ts/@next/components/icon.tsx @@ -2,8 +2,8 @@ import * as React from 'react'; import Loadable from 'react-loadable'; import styled from 'styled-components'; -import {Paragraph} from 'ts/@next/components/text'; -import {getCSSPadding, PaddingInterface} from 'ts/@next/constants/utilities'; +import { Paragraph } from 'ts/@next/components/text'; +import { getCSSPadding, PaddingInterface } from 'ts/@next/constants/utilities'; interface IconProps extends PaddingInterface { name?: string; @@ -14,7 +14,7 @@ interface IconProps extends PaddingInterface { export const Icon: React.FunctionComponent<IconProps> = (props: IconProps) => { if (props.name && !props.component) { const IconSVG = Loadable({ - loader: async () => import(/* webpackChunkName: "icon" */`ts/@next/icons/illustrations/${props.name}.svg`), + loader: async () => import(/* webpackChunkName: "icon" */ `ts/@next/icons/illustrations/${props.name}.svg`), loading: () => <Paragraph>Loading</Paragraph>, }); @@ -26,17 +26,16 @@ export const Icon: React.FunctionComponent<IconProps> = (props: IconProps) => { } if (props.component) { - return ( - <StyledIcon {...props}> - {props.component} - </StyledIcon> - ); + return <StyledIcon {...props}>{props.component}</StyledIcon>; } return null; }; -export const InlineIconWrap = styled.div<PaddingInterface>` +export const InlineIconWrap = + styled.div < + PaddingInterface > + ` margin: ${props => getCSSPadding(props.margin)}; display: flex; align-items: center; @@ -55,7 +54,10 @@ const _getSize = (size: string | number = 'small'): string => { return `${size}px`; }; -const StyledIcon = styled.figure<IconProps>` +const StyledIcon = + styled.figure < + IconProps > + ` width: ${props => _getSize(props.size)}; height: ${props => _getSize(props.size)}; margin: ${props => getCSSPadding(props.margin)}; |