From daf447361f911acf19a0f0489039244695945218 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Mon, 22 Oct 2018 13:11:29 -0700 Subject: WIP: spinner --- .../src/components/animations/full_rotation.tsx | 15 +++++++++++ packages/instant/src/components/ui/spinner.tsx | 30 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 packages/instant/src/components/animations/full_rotation.tsx create mode 100644 packages/instant/src/components/ui/spinner.tsx (limited to 'packages') diff --git a/packages/instant/src/components/animations/full_rotation.tsx b/packages/instant/src/components/animations/full_rotation.tsx new file mode 100644 index 000000000..0b36fd21f --- /dev/null +++ b/packages/instant/src/components/animations/full_rotation.tsx @@ -0,0 +1,15 @@ +import { keyframes, styled } from '../../style/theme'; + +const rotatingKeyframes = keyframes` +from { + transform: rotate(0deg); +} + +to { + transform: rotate(360deg); +} +`; + +export const FullRotation = styled.div` + animation: ${rotatingKeyframes} 2s linear infinite; +`; diff --git a/packages/instant/src/components/ui/spinner.tsx b/packages/instant/src/components/ui/spinner.tsx new file mode 100644 index 000000000..e5d2808f3 --- /dev/null +++ b/packages/instant/src/components/ui/spinner.tsx @@ -0,0 +1,30 @@ +import * as React from 'react'; + +import { FullRotation } from '../animations/full_rotation'; + +export interface SpinnerProps { + width: number; + height: number; +} +export const Spinner: React.StatelessComponent = props => { + return ( + + + + + + + ); +}; -- cgit From d52a04e725afce3c2d563bcc52bd3273002af318 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Mon, 22 Oct 2018 13:18:37 -0700 Subject: Spinner no longer wobbly --- packages/instant/src/components/animations/full_rotation.tsx | 11 ++++++++++- packages/instant/src/components/ui/spinner.tsx | 10 +++++----- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'packages') diff --git a/packages/instant/src/components/animations/full_rotation.tsx b/packages/instant/src/components/animations/full_rotation.tsx index 0b36fd21f..9adb565f9 100644 --- a/packages/instant/src/components/animations/full_rotation.tsx +++ b/packages/instant/src/components/animations/full_rotation.tsx @@ -1,5 +1,9 @@ import { keyframes, styled } from '../../style/theme'; +interface FullRotationProps { + height: string; + width: string; +} const rotatingKeyframes = keyframes` from { transform: rotate(0deg); @@ -10,6 +14,11 @@ to { } `; -export const FullRotation = styled.div` +export const FullRotation = + styled.div < + FullRotationProps > + ` animation: ${rotatingKeyframes} 2s linear infinite; + height: ${props => props.height}; + width: ${props => props.width}; `; diff --git a/packages/instant/src/components/ui/spinner.tsx b/packages/instant/src/components/ui/spinner.tsx index e5d2808f3..7abf24256 100644 --- a/packages/instant/src/components/ui/spinner.tsx +++ b/packages/instant/src/components/ui/spinner.tsx @@ -3,15 +3,15 @@ import * as React from 'react'; import { FullRotation } from '../animations/full_rotation'; export interface SpinnerProps { - width: number; - height: number; + pxWidth: number; + pxHeight: number; } export const Spinner: React.StatelessComponent = props => { return ( - + Date: Mon, 22 Oct 2018 14:27:38 -0700 Subject: Making SecondaryButton accept children instead of text prop --- .../instant/src/components/placing_order_button.tsx | 19 +++++++++++++++++++ packages/instant/src/components/retry_button.tsx | 2 +- packages/instant/src/components/secondary_button.tsx | 6 ++---- 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 packages/instant/src/components/placing_order_button.tsx (limited to 'packages') diff --git a/packages/instant/src/components/placing_order_button.tsx b/packages/instant/src/components/placing_order_button.tsx new file mode 100644 index 000000000..8dc05c445 --- /dev/null +++ b/packages/instant/src/components/placing_order_button.tsx @@ -0,0 +1,19 @@ +import * as React from 'react'; + +import { ColorOption } from '../style/theme'; + +import { Button } from './ui/button'; +import { Container } from './ui/container'; +import { Spinner } from './ui/spinner'; +import { Text } from './ui/text'; + +export const PlacingOrderButton: React.StatelessComponent<{}> = props => ( + +); diff --git a/packages/instant/src/components/retry_button.tsx b/packages/instant/src/components/retry_button.tsx index 28547ce54..0d6188e6a 100644 --- a/packages/instant/src/components/retry_button.tsx +++ b/packages/instant/src/components/retry_button.tsx @@ -7,5 +7,5 @@ export interface RetryButtonProps { } export const RetryButton: React.StatelessComponent = props => { - return ; + return Try Again; }; diff --git a/packages/instant/src/components/secondary_button.tsx b/packages/instant/src/components/secondary_button.tsx index e073f6061..3c139a233 100644 --- a/packages/instant/src/components/secondary_button.tsx +++ b/packages/instant/src/components/secondary_button.tsx @@ -6,9 +6,7 @@ import { ColorOption } from '../style/theme'; import { Button, ButtonProps } from './ui/button'; import { Text } from './ui/text'; -export interface SecondaryButtonProps extends ButtonProps { - text: string; -} +export interface SecondaryButtonProps extends ButtonProps {} export const SecondaryButton: React.StatelessComponent = props => { const buttonProps = _.omit(props, 'text'); @@ -21,7 +19,7 @@ export const SecondaryButton: React.StatelessComponent = p {...buttonProps} > - {props.text} + {props.children} ); -- cgit From 071f9a5a73eef54b657adce66d938ee444bd1d72 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Mon, 22 Oct 2018 14:28:02 -0700 Subject: Spinner: change prop names and fix svg props --- packages/instant/src/components/ui/spinner.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'packages') diff --git a/packages/instant/src/components/ui/spinner.tsx b/packages/instant/src/components/ui/spinner.tsx index 7abf24256..28ebc2598 100644 --- a/packages/instant/src/components/ui/spinner.tsx +++ b/packages/instant/src/components/ui/spinner.tsx @@ -3,26 +3,26 @@ import * as React from 'react'; import { FullRotation } from '../animations/full_rotation'; export interface SpinnerProps { - pxWidth: number; - pxHeight: number; + widthPx: number; + heightPx: number; } export const Spinner: React.StatelessComponent = props => { return ( - + - + -- cgit From 579a49ba918ef3c10f3eee0c63ff8d8f8be61fdf Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Mon, 22 Oct 2018 14:28:22 -0700 Subject: Placing order button --- packages/instant/src/containers/selected_asset_button.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'packages') diff --git a/packages/instant/src/containers/selected_asset_button.tsx b/packages/instant/src/containers/selected_asset_button.tsx index 8c617804e..6fad365fa 100644 --- a/packages/instant/src/containers/selected_asset_button.tsx +++ b/packages/instant/src/containers/selected_asset_button.tsx @@ -6,6 +6,8 @@ import { SecondaryButton } from '../components/secondary_button'; import { State } from '../redux/reducer'; import { AsyncProcessState } from '../types'; +import { PlacingOrderButton } from '../components/placing_order_button'; + import { SelectedAssetBuyButton } from './selected_asset_buy_button'; import { SelectedAssetRetryButton } from './selected_asset_retry_button'; @@ -23,9 +25,9 @@ const SelectedAssetButtonPresentationComponent: React.StatelessComponent<{ if (props.buyOrderState === AsyncProcessState.FAILURE) { return ; } else if (props.buyOrderState === AsyncProcessState.SUCCESS) { - return ; + return Success; } else if (props.buyOrderState === AsyncProcessState.PENDING) { - return ; + return ; } return ; -- cgit From 194cbc3ba941023a0b6c1845a867ccfd619b754f Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Mon, 22 Oct 2018 15:57:16 -0700 Subject: Make icon a bit better --- packages/instant/src/components/placing_order_button.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/instant/src/components/placing_order_button.tsx b/packages/instant/src/components/placing_order_button.tsx index 8dc05c445..4232e6c22 100644 --- a/packages/instant/src/components/placing_order_button.tsx +++ b/packages/instant/src/components/placing_order_button.tsx @@ -9,7 +9,7 @@ import { Text } from './ui/text'; export const PlacingOrderButton: React.StatelessComponent<{}> = props => (