aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-21 02:20:16 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-21 02:20:16 +0800
commitcd4600b081b9ee467471174fe6736efab6247759 (patch)
treedf132a340280024a062442f54ddee0e1353f312f /packages/instant/src
parent83f4fa92a5619afc129dd1098877f4c889dc27c4 (diff)
downloaddexon-sol-tools-cd4600b081b9ee467471174fe6736efab6247759.tar
dexon-sol-tools-cd4600b081b9ee467471174fe6736efab6247759.tar.gz
dexon-sol-tools-cd4600b081b9ee467471174fe6736efab6247759.tar.bz2
dexon-sol-tools-cd4600b081b9ee467471174fe6736efab6247759.tar.lz
dexon-sol-tools-cd4600b081b9ee467471174fe6736efab6247759.tar.xz
dexon-sol-tools-cd4600b081b9ee467471174fe6736efab6247759.tar.zst
dexon-sol-tools-cd4600b081b9ee467471174fe6736efab6247759.zip
fix(instant): Right align amounts
Diffstat (limited to 'packages/instant/src')
-rw-r--r--packages/instant/src/components/instant_heading.tsx4
-rw-r--r--packages/instant/src/components/ui/text.tsx4
2 files changed, 6 insertions, 2 deletions
diff --git a/packages/instant/src/components/instant_heading.tsx b/packages/instant/src/components/instant_heading.tsx
index 002695269..ace577824 100644
--- a/packages/instant/src/components/instant_heading.tsx
+++ b/packages/instant/src/components/instant_heading.tsx
@@ -107,7 +107,7 @@ export class InstantHeading extends React.Component<InstantHeadingProps, {}> {
private readonly _renderEthAmount = (): React.ReactNode => {
return (
- <Text fontSize="16px" fontColor={ColorOption.white} fontWeight={500}>
+ <Text fontSize="16px" textAlign="right" width="100%" fontColor={ColorOption.white} fontWeight={500}>
{format.ethBaseUnitAmount(
this.props.totalEthBaseUnitAmount,
4,
@@ -119,7 +119,7 @@ export class InstantHeading extends React.Component<InstantHeadingProps, {}> {
private readonly _renderDollarAmount = (): React.ReactNode => {
return (
- <Text fontSize="16px" fontColor={ColorOption.white}>
+ <Text fontSize="16px" textAlign="right" width="100%" fontColor={ColorOption.white}>
{format.ethBaseUnitAmountInUsd(
this.props.totalEthBaseUnitAmount,
this.props.ethUsdPrice,
diff --git a/packages/instant/src/components/ui/text.tsx b/packages/instant/src/components/ui/text.tsx
index fd14cc4d1..8e573d7b9 100644
--- a/packages/instant/src/components/ui/text.tsx
+++ b/packages/instant/src/components/ui/text.tsx
@@ -11,6 +11,7 @@ export interface TextProps {
fontSize?: string;
opacity?: number;
letterSpacing?: string;
+ textAlign?: string;
textTransform?: string;
lineHeight?: string;
className?: string;
@@ -22,6 +23,7 @@ export interface TextProps {
noWrap?: boolean;
display?: string;
href?: string;
+ width?: string;
}
export const Text: React.StatelessComponent<TextProps> = ({ href, onClick, ...rest }) => {
@@ -51,6 +53,8 @@ export const StyledText =
${props => (props.display ? `display: ${props.display}` : '')};
${props => (props.letterSpacing ? `letter-spacing: ${props.letterSpacing}` : '')};
${props => (props.textTransform ? `text-transform: ${props.textTransform}` : '')};
+ ${props => (props.textAlign ? `text-align: ${props.textAlign}` : '')};
+ ${props => (props.width ? `width: ${props.width}` : '')};
&:hover {
${props =>
props.onClick ? `color: ${darken(darkenOnHoverAmount, props.theme[props.fontColor || 'white'])}` : ''};