From 723dd2bcde0a3c8277be7a000657f4acde0dfa4e Mon Sep 17 00:00:00 2001 From: Fred Carlsen Date: Wed, 12 Dec 2018 19:45:11 +0100 Subject: WIP configurator --- .../ts/@next/pages/instant/config_generator.tsx | 314 +++++++++++++++++++++ .../ts/@next/pages/instant/configurator.tsx | 109 +++++++ 2 files changed, 423 insertions(+) create mode 100644 packages/website/ts/@next/pages/instant/config_generator.tsx create mode 100644 packages/website/ts/@next/pages/instant/configurator.tsx (limited to 'packages/website/ts/@next/pages/instant') diff --git a/packages/website/ts/@next/pages/instant/config_generator.tsx b/packages/website/ts/@next/pages/instant/config_generator.tsx new file mode 100644 index 000000000..00e491431 --- /dev/null +++ b/packages/website/ts/@next/pages/instant/config_generator.tsx @@ -0,0 +1,314 @@ +import { StandardRelayerAPIOrderProvider } from '@0x/asset-buyer'; +import { getContractAddressesForNetworkOrThrow } from '@0x/contract-addresses'; +import { assetDataUtils } from '@0x/order-utils'; +import { ObjectMap } from '@0x/types'; +import * as _ from 'lodash'; +import * as React from 'react'; + +import { CheckMark } from 'ts/components/ui/check_mark'; +import { Container } from 'ts/components/ui/container'; +import { MultiSelect } from 'ts/components/ui/multi_select'; +import { Select, SelectItemConfig } from 'ts/components/ui/select'; +import { Spinner } from 'ts/components/ui/spinner'; +import { Text } from 'ts/components/ui/text'; +import { ConfigGeneratorAddressInput } from 'ts/pages/instant/config_generator_address_input'; +import { FeePercentageSlider } from 'ts/pages/instant/fee_percentage_slider'; +import { colors } from 'ts/style/colors'; +import { WebsitePaths } from 'ts/types'; +import { constants } from 'ts/utils/constants'; + +// New components +import { Heading, Paragraph } from 'ts/@next/components/text'; + +import { assetMetaDataMap } from '../../../../../instant/src/data/asset_meta_data_map'; +import { ERC20AssetMetaData, ZeroExInstantBaseConfig } from '../../../../../instant/src/types'; + +export interface ConfigGeneratorProps { + value: ZeroExInstantBaseConfig; + onConfigChange: (config: ZeroExInstantBaseConfig) => void; +} + +export interface ConfigGeneratorState { + isLoadingAvailableTokens: boolean; + // Address to token info + availableTokens?: ObjectMap; +} + +const SRA_ENDPOINTS = ['https://api.radarrelay.com/0x/v2/', 'https://sra.bamboorelay.com/0x/v2/']; + +export class ConfigGenerator extends React.Component { + public state: ConfigGeneratorState = { + isLoadingAvailableTokens: true, + }; + public componentDidMount(): void { + // tslint:disable-next-line:no-floating-promises + this._setAvailableAssetsFromOrderProvider(); + } + public componentDidUpdate(prevProps: ConfigGeneratorProps): void { + if (prevProps.value.orderSource !== this.props.value.orderSource) { + // tslint:disable-next-line:no-floating-promises + this._setAvailableAssetsFromOrderProvider(); + const newConfig: ZeroExInstantBaseConfig = { + ...this.props.value, + availableAssetDatas: undefined, + }; + this.props.onConfigChange(newConfig); + } + } + public render(): React.ReactNode { + const { value } = this.props; + if (!_.isString(value.orderSource)) { + throw new Error('ConfigGenerator component only supports string values as an orderSource.'); + } + return ( + + + + + + + + {errMsg} + + + + ); + } + + private readonly _handleChange = (event: React.ChangeEvent): void => { + const address = event.target.value; + const isValidAddress = addressUtils.isAddress(address.toLowerCase()) || address === ''; + const errMsg = isValidAddress ? '' : 'Please enter a valid Ethereum address'; + this.setState({ + errMsg, + }); + this.props.onChange(address, isValidAddress); + }; +} + +const PlainInput: React.StatelessComponent = ({ value, className, placeholder, onChange }) => ( + +); + +export const Input = styled(PlainInput)` + background-color: ${colors.white}; + color: ${colors.textDarkSecondary}; + font-size: 1rem; + width: 100%; + padding: 16px 20px 18px; + border-radius: 4px; + border: 1px solid transparent; + outline: none; + &::placeholder { + color: #333333; + opacity: 0.5; + } +`; \ No newline at end of file diff --git a/packages/website/ts/@next/pages/instant/configurator.tsx b/packages/website/ts/@next/pages/instant/configurator.tsx index 354a7c205..cdba53ca9 100644 --- a/packages/website/ts/@next/pages/instant/configurator.tsx +++ b/packages/website/ts/@next/pages/instant/configurator.tsx @@ -4,8 +4,8 @@ import styled from 'styled-components'; import { colors } from 'ts/style/colors'; +import { CodeDemo } from 'ts/@next/pages/instant/code_demo'; import { ConfigGenerator } from 'ts/@next/pages/instant/config_generator'; -import { CodeDemo } from 'ts/pages/instant/code_demo'; import { Column, FlexWrap, Section } from 'ts/@next/components/newLayout'; import { Heading, Paragraph } from 'ts/@next/components/text'; import { WebsitePaths } from 'ts/types'; @@ -44,7 +44,7 @@ export class Configurator extends React.Component { - Code Snippet + Code Snippet { )}` : '' } - }, 'body'); - - -`; + }, 'body'); + + + `; }; private readonly _renderAvailableAssetDatasString = (availableAssetDatas: string[]): string => { const stringAvailableAssetDatas = availableAssetDatas.map(assetData => `'${assetData}'`); diff --git a/packages/website/ts/@next/pages/instant/select.tsx b/packages/website/ts/@next/pages/instant/select.tsx new file mode 100644 index 000000000..7c601da1c --- /dev/null +++ b/packages/website/ts/@next/pages/instant/select.tsx @@ -0,0 +1,66 @@ +import * as React from 'react'; +import styled from 'styled-components'; + +import { colors } from 'ts/style/colors'; + +import {Column, Section, Wrap, WrapCentered} from 'ts/@next/components/layout'; +import {Heading, Paragraph} from 'ts/@next/components/text'; + +export interface SelectItemConfig { + label: string; + value?: string; + onClick?: () => void; +} + +interface SelectProps { + value?: string; + id: string; + items: SelectItemConfig[]; + emptyText?: string; +} + +export const Select: React.FunctionComponent = ({ value, id, items, emptyText }) => { + return ( + + + + {items.map((item, index) => )} + + + + ); +}; + +Select.defaultProps = { + emptyText: 'Select...', +}; + +const Container = styled.div` + background-color: #fff; + border-radius: 4px; + display: flex; + width: 100%; + position: relative; +`; + +const StyledSelect = styled.select` + appearance: none; + border: 0; + font-size: 1rem; + width: 100%; + padding: 20px 20px 20px 20px; +`; + +const SelectAllButton = styled.button` + appearance: none; + border: 0; + font-size: 0.777777778rem; + display: block; + opacity: 0.75; +`; + +const Caret = styled.svg` + position: absolute; + right: 20px; + top: calc(50% - 4px); +`; -- cgit From 142d29ba57f55aefd5c5e5f669c388ab57152173 Mon Sep 17 00:00:00 2001 From: Fred Carlsen Date: Thu, 13 Dec 2018 17:48:58 +0100 Subject: Tweak padding --- packages/website/ts/@next/pages/instant/configurator.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/website/ts/@next/pages/instant') diff --git a/packages/website/ts/@next/pages/instant/configurator.tsx b/packages/website/ts/@next/pages/instant/configurator.tsx index cdba53ca9..a90176e0c 100644 --- a/packages/website/ts/@next/pages/instant/configurator.tsx +++ b/packages/website/ts/@next/pages/instant/configurator.tsx @@ -39,7 +39,7 @@ export class Configurator extends React.Component { - + -- cgit From 52272cd2906b9d18a5ff77fde08854ea1c6e9e4c Mon Sep 17 00:00:00 2001 From: Fred Carlsen Date: Thu, 13 Dec 2018 18:57:22 +0100 Subject: Hide configurator on smaller screens --- packages/website/ts/@next/pages/instant/configurator.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/website/ts/@next/pages/instant') diff --git a/packages/website/ts/@next/pages/instant/configurator.tsx b/packages/website/ts/@next/pages/instant/configurator.tsx index a90176e0c..af37ea8e7 100644 --- a/packages/website/ts/@next/pages/instant/configurator.tsx +++ b/packages/website/ts/@next/pages/instant/configurator.tsx @@ -39,7 +39,7 @@ export class Configurator extends React.Component { - + -- cgit From e48887bc6f2ba158430a911d4d07376e65401f26 Mon Sep 17 00:00:00 2001 From: Fred Carlsen Date: Thu, 13 Dec 2018 19:39:56 +0100 Subject: Tweak slider --- .../ts/@next/pages/instant/config_generator.tsx | 19 +- .../@next/pages/instant/fee_percentage_slider.tsx | 78 ++++++ .../website/ts/@next/pages/instant/rc-slider.css | 295 +++++++++++++++++++++ 3 files changed, 375 insertions(+), 17 deletions(-) create mode 100644 packages/website/ts/@next/pages/instant/fee_percentage_slider.tsx create mode 100644 packages/website/ts/@next/pages/instant/rc-slider.css (limited to 'packages/website/ts/@next/pages/instant') diff --git a/packages/website/ts/@next/pages/instant/config_generator.tsx b/packages/website/ts/@next/pages/instant/config_generator.tsx index 119311d94..d63ea118b 100644 --- a/packages/website/ts/@next/pages/instant/config_generator.tsx +++ b/packages/website/ts/@next/pages/instant/config_generator.tsx @@ -12,7 +12,7 @@ import { MultiSelect } from 'ts/components/ui/multi_select'; import { Spinner } from 'ts/components/ui/spinner'; import { Text } from 'ts/components/ui/text'; import { ConfigGeneratorAddressInput } from 'ts/@next/pages/instant/config_generator_address_input'; -import { FeePercentageSlider } from 'ts/pages/instant/fee_percentage_slider'; +import { FeePercentageSlider } from 'ts/@next/pages/instant/fee_percentage_slider'; import { colors } from 'ts/style/colors'; import { WebsitePaths } from 'ts/types'; import { constants } from 'ts/utils/constants'; @@ -303,21 +303,6 @@ export const ConfigGeneratorSection: React.StatelessComponent ); -const Mark = ({ checked }) => ( - - {checked && ''} - -); - -const StyledMark = styled.div` - border: 1px solid #ccc; - border-radius: 50%; - width: 16px; - height: 16px; - border-color: ${props => props.checked && colors.brandLight}; - background-color: ${props => props.checked && colors.brandLight}; -`; - ConfigGeneratorSection.defaultProps = { marginBottom: '30px', }; @@ -337,4 +322,4 @@ const CheckboxText = styled.span` const OptionalAction = styled(OptionalText)` cursor: pointer; -`; \ No newline at end of file +`; diff --git a/packages/website/ts/@next/pages/instant/fee_percentage_slider.tsx b/packages/website/ts/@next/pages/instant/fee_percentage_slider.tsx new file mode 100644 index 000000000..47b8d2b8f --- /dev/null +++ b/packages/website/ts/@next/pages/instant/fee_percentage_slider.tsx @@ -0,0 +1,78 @@ +import Slider from 'rc-slider'; +import * as React from 'react'; +import styled from 'styled-components'; +import 'ts/@next/pages/instant/rc-slider.css'; + +import { colors } from 'ts/style/colors'; + +const SliderWithTooltip = (Slider as any).createSliderWithTooltip(Slider); +// tslint:disable-next-line:no-unused-expression + +export interface FeePercentageSliderProps { + value: number; + onChange: (value: number) => void; +} + +export class FeePercentageSlider extends React.Component { + public render(): React.ReactNode { + return ( + + ); + } + private readonly _feePercentageSliderFormatter = (value: number): React.ReactNode => { + return {`${(value * 100).toFixed(2)}%`}; + }; +} + +const StyledSlider = styled(SliderWithTooltip)` + .rc-slider-tooltip__inner { + box-shadow: none !important; + background-color: ${colors.white} !important; + border-radius: 4px !important; + padding: 3px 12px !important; + height: auto !important; + position: relative; + top: 7px; + &:after { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none; + border-width: 6px; + bottom: 100%; + left: 100%; + border-bottom-color: ${colors.white}; + margin-left: -60%; + } + } +`; + +const Text = styled.span` + color: #000000; + font-size: 12px; + line-height: 18px; +`; diff --git a/packages/website/ts/@next/pages/instant/rc-slider.css b/packages/website/ts/@next/pages/instant/rc-slider.css new file mode 100644 index 000000000..a4a521d54 --- /dev/null +++ b/packages/website/ts/@next/pages/instant/rc-slider.css @@ -0,0 +1,295 @@ +.rc-slider { + position: relative; + height: 14px; + padding: 5px 0; + width: 100%; + border-radius: 6px; + -ms-touch-action: none; + touch-action: none; + box-sizing: border-box; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} + +.rc-slider * { + box-sizing: border-box; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} + +.rc-slider-rail { + position: absolute; + width: 100%; + background-color: #e9e9e9; + height: 4px; + border-radius: 6px; +} + +.rc-slider-track { + position: absolute; + left: 0; + height: 4px; + border-radius: 6px; + background-color: #abe2fb; +} + +.rc-slider-handle { + position: absolute; + margin-left: -7px; + margin-top: -5px; + width: 14px; + height: 14px; + cursor: pointer; + cursor: -webkit-grab; + cursor: grab; + border-radius: 50%; + border: solid 2px #96dbfa; + background-color: #fff; + -ms-touch-action: pan-x; + touch-action: pan-x; +} + +.rc-slider-handle:focus { + border-color: #57c5f7; + box-shadow: 0 0 0 5px #96dbfa; + outline: none; +} + +.rc-slider-handle-click-focused:focus { + border-color: #96dbfa; + box-shadow: unset; +} + +.rc-slider-handle:hover { + border-color: #57c5f7; +} + +.rc-slider-handle:active { + border-color: #57c5f7; + box-shadow: 0 0 5px #57c5f7; + cursor: -webkit-grabbing; + cursor: grabbing; +} + +.rc-slider-mark { + position: absolute; + top: 18px; + left: 0; + width: 100%; + font-size: 12px; +} + +.rc-slider-mark-text { + position: absolute; + display: inline-block; + vertical-align: middle; + text-align: center; + cursor: pointer; + color: #999; +} + +.rc-slider-mark-text-active { + color: #666; +} + +.rc-slider-step { + position: absolute; + width: 100%; + height: 4px; + background: transparent; +} + +.rc-slider-dot { + position: absolute; + bottom: -2px; + margin-left: -4px; + width: 8px; + height: 8px; + border: 2px solid #e9e9e9; + background-color: #fff; + cursor: pointer; + border-radius: 50%; + vertical-align: middle; +} + +.rc-slider-dot-active { + border-color: #96dbfa; +} + +.rc-slider-disabled { + background-color: #e9e9e9; +} + +.rc-slider-disabled .rc-slider-track { + background-color: #ccc; +} + +.rc-slider-disabled .rc-slider-handle, +.rc-slider-disabled .rc-slider-dot { + border-color: #ccc; + box-shadow: none; + background-color: #fff; + cursor: not-allowed; +} + +.rc-slider-disabled .rc-slider-mark-text, +.rc-slider-disabled .rc-slider-dot { + cursor: not-allowed !important; +} + +.rc-slider-vertical { + width: 14px; + height: 100%; + padding: 0 5px; +} + +.rc-slider-vertical .rc-slider-rail { + height: 100%; + width: 4px; +} + +.rc-slider-vertical .rc-slider-track { + left: 5px; + bottom: 0; + width: 4px; +} + +.rc-slider-vertical .rc-slider-handle { + margin-left: -5px; + margin-bottom: -7px; + -ms-touch-action: pan-y; + touch-action: pan-y; +} + +.rc-slider-vertical .rc-slider-mark { + top: 0; + left: 18px; + height: 100%; +} + +.rc-slider-vertical .rc-slider-step { + height: 100%; + width: 4px; +} + +.rc-slider-vertical .rc-slider-dot { + left: 2px; + margin-bottom: -4px; +} + +.rc-slider-vertical .rc-slider-dot:first-child { + margin-bottom: -4px; +} + +.rc-slider-vertical .rc-slider-dot:last-child { + margin-bottom: -4px; +} + +.rc-slider-tooltip-zoom-down-enter, +.rc-slider-tooltip-zoom-down-appear { + animation-duration: .3s; + animation-fill-mode: both; + display: block !important; + animation-play-state: paused; +} + +.rc-slider-tooltip-zoom-down-leave { + animation-duration: .3s; + animation-fill-mode: both; + display: block !important; + animation-play-state: paused; +} + +.rc-slider-tooltip-zoom-down-enter.rc-slider-tooltip-zoom-down-enter-active, +.rc-slider-tooltip-zoom-down-appear.rc-slider-tooltip-zoom-down-appear-active { + animation-name: rcSliderTooltipZoomDownIn; + animation-play-state: running; +} + +.rc-slider-tooltip-zoom-down-leave.rc-slider-tooltip-zoom-down-leave-active { + animation-name: rcSliderTooltipZoomDownOut; + animation-play-state: running; +} + +.rc-slider-tooltip-zoom-down-enter, +.rc-slider-tooltip-zoom-down-appear { + transform: scale(0, 0); + animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); +} + +.rc-slider-tooltip-zoom-down-leave { + animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06); +} + +@keyframes rcSliderTooltipZoomDownIn { + 0% { + opacity: 0; + transform-origin: 50% 100%; + transform: scale(0, 0); + } + + 100% { + transform-origin: 50% 100%; + transform: scale(1, 1); + } +} + +@keyframes rcSliderTooltipZoomDownOut { + 0% { + transform-origin: 50% 100%; + transform: scale(1, 1); + } + + 100% { + opacity: 0; + transform-origin: 50% 100%; + transform: scale(0, 0); + } +} + +.rc-slider-tooltip { + position: absolute; + left: -9999px; + top: -9999px; + visibility: visible; + box-sizing: border-box; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} + +.rc-slider-tooltip * { + box-sizing: border-box; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} + +.rc-slider-tooltip-hidden { + display: none; +} + +.rc-slider-tooltip-placement-top { + padding: 4px 0 8px 0; +} + +.rc-slider-tooltip-inner { + padding: 4px 6px 4px; + min-width: 24px; + height: 24px; + font-size: 12px; + line-height: 1; + color: #000; + text-align: center; + text-decoration: none; +} + +.rc-slider-tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} + +.rc-slider-tooltip-placement-top .rc-slider-tooltip-arrow { + bottom: 4px; + left: 50%; + margin-left: -4px; + border-width: 4px 4px 0; + border-top-color: #6c6c6c; +} -- cgit From 66480ccb1e0dc72e6716060ab472b7584bfa910c Mon Sep 17 00:00:00 2001 From: Fred Carlsen Date: Fri, 14 Dec 2018 11:26:59 +0100 Subject: Linting fixes --- packages/website/ts/@next/pages/instant/config_generator.tsx | 10 +++++++--- .../website/ts/@next/pages/instant/fee_percentage_slider.tsx | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'packages/website/ts/@next/pages/instant') diff --git a/packages/website/ts/@next/pages/instant/config_generator.tsx b/packages/website/ts/@next/pages/instant/config_generator.tsx index d63ea118b..c71d2b238 100644 --- a/packages/website/ts/@next/pages/instant/config_generator.tsx +++ b/packages/website/ts/@next/pages/instant/config_generator.tsx @@ -6,13 +6,13 @@ import * as _ from 'lodash'; import * as React from 'react'; import styled from 'styled-components'; +import { ConfigGeneratorAddressInput } from 'ts/@next/pages/instant/config_generator_address_input'; +import { FeePercentageSlider } from 'ts/@next/pages/instant/fee_percentage_slider'; import { CheckMark } from 'ts/components/ui/check_mark'; import { Container } from 'ts/components/ui/container'; import { MultiSelect } from 'ts/components/ui/multi_select'; import { Spinner } from 'ts/components/ui/spinner'; import { Text } from 'ts/components/ui/text'; -import { ConfigGeneratorAddressInput } from 'ts/@next/pages/instant/config_generator_address_input'; -import { FeePercentageSlider } from 'ts/@next/pages/instant/fee_percentage_slider'; import { colors } from 'ts/style/colors'; import { WebsitePaths } from 'ts/types'; import { constants } from 'ts/utils/constants'; @@ -314,7 +314,11 @@ const OptionalText = styled.span` flex-shrink: 0; `; -const CheckboxText = styled.span` +interface CheckboxTextProps { + isSelected?: boolean; +} + +const CheckboxText = styled.span` font-size: 14px; line-height: 18px; color: ${props => props.isSelected ? colors.brandDark : '#666666'} diff --git a/packages/website/ts/@next/pages/instant/fee_percentage_slider.tsx b/packages/website/ts/@next/pages/instant/fee_percentage_slider.tsx index 47b8d2b8f..512ae06b4 100644 --- a/packages/website/ts/@next/pages/instant/fee_percentage_slider.tsx +++ b/packages/website/ts/@next/pages/instant/fee_percentage_slider.tsx @@ -10,6 +10,7 @@ const SliderWithTooltip = (Slider as any).createSliderWithTooltip(Slider); export interface FeePercentageSliderProps { value: number; + isDisabled?: boolean; onChange: (value: number) => void; } -- cgit From 377b87071a4f221279b5c9f033c28ae51c7ef08d Mon Sep 17 00:00:00 2001 From: Fred Carlsen Date: Fri, 14 Dec 2018 15:22:14 +0100 Subject: Tweak configurator code width --- packages/website/ts/@next/pages/instant/configurator.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/website/ts/@next/pages/instant') diff --git a/packages/website/ts/@next/pages/instant/configurator.tsx b/packages/website/ts/@next/pages/instant/configurator.tsx index af37ea8e7..ac7133cf6 100644 --- a/packages/website/ts/@next/pages/instant/configurator.tsx +++ b/packages/website/ts/@next/pages/instant/configurator.tsx @@ -39,10 +39,10 @@ export class Configurator extends React.Component { - + - + Code Snippet Date: Fri, 14 Dec 2018 17:50:27 +0100 Subject: More lint cleanup --- packages/website/ts/@next/pages/instant/code_demo.tsx | 1 - packages/website/ts/@next/pages/instant/config_generator.tsx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'packages/website/ts/@next/pages/instant') diff --git a/packages/website/ts/@next/pages/instant/code_demo.tsx b/packages/website/ts/@next/pages/instant/code_demo.tsx index fe11175d5..35eaf6b2a 100644 --- a/packages/website/ts/@next/pages/instant/code_demo.tsx +++ b/packages/website/ts/@next/pages/instant/code_demo.tsx @@ -4,7 +4,6 @@ import SyntaxHighlighter from 'react-syntax-highlighter'; import { Button } from 'ts/components/ui/button'; import { Container } from 'ts/components/ui/container'; -import { colors } from 'ts/style/colors'; import { styled } from 'ts/style/theme'; import { zIndex } from 'ts/style/z_index'; diff --git a/packages/website/ts/@next/pages/instant/config_generator.tsx b/packages/website/ts/@next/pages/instant/config_generator.tsx index c71d2b238..8857e4fea 100644 --- a/packages/website/ts/@next/pages/instant/config_generator.tsx +++ b/packages/website/ts/@next/pages/instant/config_generator.tsx @@ -18,7 +18,7 @@ import { WebsitePaths } from 'ts/types'; import { constants } from 'ts/utils/constants'; // New components -import { Heading, Paragraph } from 'ts/@next/components/text'; +import { Heading } from 'ts/@next/components/text'; import { Select, SelectItemConfig } from 'ts/@next/pages/instant/select'; import { assetMetaDataMap } from '../../../../../instant/src/data/asset_meta_data_map'; -- cgit From 84321c41f346f11380d49d2b5d882022816abd43 Mon Sep 17 00:00:00 2001 From: Ezekiel Aquino Date: Fri, 14 Dec 2018 18:52:38 +0100 Subject: Cleanup configurator --- packages/website/ts/@next/pages/instant/configurator.tsx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'packages/website/ts/@next/pages/instant') diff --git a/packages/website/ts/@next/pages/instant/configurator.tsx b/packages/website/ts/@next/pages/instant/configurator.tsx index ac7133cf6..15c9ba2ca 100644 --- a/packages/website/ts/@next/pages/instant/configurator.tsx +++ b/packages/website/ts/@next/pages/instant/configurator.tsx @@ -2,26 +2,21 @@ import * as _ from 'lodash'; import * as React from 'react'; import styled from 'styled-components'; -import { colors } from 'ts/style/colors'; - import { CodeDemo } from 'ts/@next/pages/instant/code_demo'; import { ConfigGenerator } from 'ts/@next/pages/instant/config_generator'; -import { Column, FlexWrap, Section } from 'ts/@next/components/newLayout'; -import { Heading, Paragraph } from 'ts/@next/components/text'; -import { WebsitePaths } from 'ts/types'; + import { Link } from 'ts/@next/components/link'; +import { Column, FlexWrap } from 'ts/@next/components/newLayout'; +import { Heading } from 'ts/@next/components/text'; +import { WebsitePaths } from 'ts/types'; import { ZeroExInstantBaseConfig } from '../../../../../instant/src/types'; -export interface ConfiguratorProps { - hash: string; -} - export interface ConfiguratorState { instantConfig: ZeroExInstantBaseConfig; } -export class Configurator extends React.Component { +export class Configurator extends React.Component { public state: ConfiguratorState = { instantConfig: { orderSource: 'https://api.radarrelay.com/0x/v2/', @@ -33,7 +28,6 @@ export class Configurator extends React.Component { }, }; public render(): React.ReactNode { - const { hash } = this.props; const codeToDisplay = this._generateCodeDemoCode(); return ( Date: Fri, 14 Dec 2018 18:53:43 +0100 Subject: Cleanup select --- packages/website/ts/@next/pages/instant/select.tsx | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'packages/website/ts/@next/pages/instant') diff --git a/packages/website/ts/@next/pages/instant/select.tsx b/packages/website/ts/@next/pages/instant/select.tsx index 7c601da1c..ae2a07b3d 100644 --- a/packages/website/ts/@next/pages/instant/select.tsx +++ b/packages/website/ts/@next/pages/instant/select.tsx @@ -1,11 +1,6 @@ import * as React from 'react'; import styled from 'styled-components'; -import { colors } from 'ts/style/colors'; - -import {Column, Section, Wrap, WrapCentered} from 'ts/@next/components/layout'; -import {Heading, Paragraph} from 'ts/@next/components/text'; - export interface SelectItemConfig { label: string; value?: string; @@ -51,14 +46,6 @@ const StyledSelect = styled.select` padding: 20px 20px 20px 20px; `; -const SelectAllButton = styled.button` - appearance: none; - border: 0; - font-size: 0.777777778rem; - display: block; - opacity: 0.75; -`; - const Caret = styled.svg` position: absolute; right: 20px; -- cgit From 96cb278caed79961be08e9145cbd59e91e12d9a4 Mon Sep 17 00:00:00 2001 From: Ezekiel Aquino Date: Fri, 14 Dec 2018 18:56:53 +0100 Subject: Cleanup --- .../ts/@next/pages/instant/config_generator_address_input.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'packages/website/ts/@next/pages/instant') diff --git a/packages/website/ts/@next/pages/instant/config_generator_address_input.tsx b/packages/website/ts/@next/pages/instant/config_generator_address_input.tsx index 01453d445..23cdfcf7f 100644 --- a/packages/website/ts/@next/pages/instant/config_generator_address_input.tsx +++ b/packages/website/ts/@next/pages/instant/config_generator_address_input.tsx @@ -6,7 +6,7 @@ import styled from 'styled-components'; import { colors } from 'ts/style/colors'; import { Container } from 'ts/components/ui/container'; -import { Text } from 'ts/components/ui/text'; + import { Paragraph } from 'ts/@next/components/text'; export interface ConfigGeneratorAddressInputProps { @@ -24,7 +24,6 @@ export interface InputProps { width?: string; fontSize?: string; fontColor?: string; - border?: string; padding?: string; placeholderColor?: string; placeholder?: string; @@ -42,7 +41,6 @@ export class ConfigGeneratorAddressInput extends React.Component< public render(): React.ReactNode { const { errMsg } = this.state; const hasError = !_.isEmpty(errMsg); - const border = hasError ? '1px solid red' : undefined; return ( Date: Fri, 14 Dec 2018 14:46:05 -0800 Subject: fix(website) replace 0xproject.com with 0x.org --- packages/website/ts/@next/pages/instant/configurator.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/website/ts/@next/pages/instant') diff --git a/packages/website/ts/@next/pages/instant/configurator.tsx b/packages/website/ts/@next/pages/instant/configurator.tsx index 15c9ba2ca..e4334eabb 100644 --- a/packages/website/ts/@next/pages/instant/configurator.tsx +++ b/packages/website/ts/@next/pages/instant/configurator.tsx @@ -62,7 +62,7 @@ export class Configurator extends React.Component { - +