diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-20 07:06:42 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-20 07:06:42 +0800 |
commit | ac2d93ab2261e19f87870f4143806d62c1d1c619 (patch) | |
tree | f356b7ec0ca78e7aa458b59a8fd5bc33d296e739 /packages/instant/src | |
parent | 092d010c2dcdeffa7c44c147d380255c33649679 (diff) | |
download | dexon-sol-tools-ac2d93ab2261e19f87870f4143806d62c1d1c619.tar dexon-sol-tools-ac2d93ab2261e19f87870f4143806d62c1d1c619.tar.gz dexon-sol-tools-ac2d93ab2261e19f87870f4143806d62c1d1c619.tar.bz2 dexon-sol-tools-ac2d93ab2261e19f87870f4143806d62c1d1c619.tar.lz dexon-sol-tools-ac2d93ab2261e19f87870f4143806d62c1d1c619.tar.xz dexon-sol-tools-ac2d93ab2261e19f87870f4143806d62c1d1c619.tar.zst dexon-sol-tools-ac2d93ab2261e19f87870f4143806d62c1d1c619.zip |
Small refacotor of icons or amounts part
Diffstat (limited to 'packages/instant/src')
-rw-r--r-- | packages/instant/src/components/instant_heading.tsx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/packages/instant/src/components/instant_heading.tsx b/packages/instant/src/components/instant_heading.tsx index 7ae509e3a..856e4d43e 100644 --- a/packages/instant/src/components/instant_heading.tsx +++ b/packages/instant/src/components/instant_heading.tsx @@ -22,6 +22,7 @@ export interface InstantHeadingProps { const placeholderColor = ColorOption.white; export class InstantHeading extends React.Component<InstantHeadingProps, {}> { public render(): React.ReactNode { + const iconOrAmounts = this._renderIcon() || this._renderAmountsSection(); return ( <Container backgroundColor={ColorOption.primaryColor} @@ -44,19 +45,14 @@ export class InstantHeading extends React.Component<InstantHeadingProps, {}> { <Flex direction="row" justify="space-between"> <SelectedAssetAmountInput fontSize="45px" /> <Flex direction="column" justify="space-between"> - {this._renderIconOrAmounts()} + {iconOrAmounts} </Flex> </Flex> </Container> ); } - private _renderIconOrAmounts(): React.ReactNode { - const icon = this._renderIcon(); - if (icon) { - return icon; - } - + private _renderAmountsSection(): React.ReactNode { return ( <Container> <Container marginBottom="5px">{this._placeholderOrAmount(this._ethAmount)}</Container> |