diff options
-rw-r--r-- | packages/typescript-typings/CHANGELOG.json | 8 | ||||
-rw-r--r-- | packages/typescript-typings/types/react-joyride/index.d.ts | 52 | ||||
-rw-r--r-- | packages/website/package.json | 9 | ||||
-rw-r--r-- | packages/website/ts/components/onboarding/onboarding_flow.tsx | 12 | ||||
-rw-r--r-- | packages/website/ts/components/ui/container.tsx | 2 | ||||
-rw-r--r-- | packages/website/ts/components/ui/island.tsx | 2 | ||||
-rw-r--r-- | packages/website/ts/components/wallet/wallet.tsx | 2 | ||||
-rw-r--r-- | packages/website/ts/containers/portal_onboarding_flow.ts | 5 |
8 files changed, 54 insertions, 38 deletions
diff --git a/packages/typescript-typings/CHANGELOG.json b/packages/typescript-typings/CHANGELOG.json index 2e2998bb3..77a5ffad2 100644 --- a/packages/typescript-typings/CHANGELOG.json +++ b/packages/typescript-typings/CHANGELOG.json @@ -1,5 +1,13 @@ [ { + "version": "0.4.0", + "changes": [ + { + "note": "Add types for `react-joyride`" + } + ] + }, + { "timestamp": 1527009133, "version": "0.3.2", "changes": [ diff --git a/packages/typescript-typings/types/react-joyride/index.d.ts b/packages/typescript-typings/types/react-joyride/index.d.ts index 3aa5852f7..6c1a5b092 100644 --- a/packages/typescript-typings/types/react-joyride/index.d.ts +++ b/packages/typescript-typings/types/react-joyride/index.d.ts @@ -4,31 +4,39 @@ declare module 'react-joyride' { import * as React from 'react'; export interface StyleOptions { - arrowColor?: string, - backgroundColor?: string, - primaryColor?: string, - textColor?: string, - overlayColor?: string, - spotlightShadow?: string, - beaconSize?: number, - zIndex?: number, + arrowColor?: string; + backgroundColor?: string; + primaryColor?: string; + textColor?: string; + overlayColor?: string; + spotlightShadow?: string; + beaconSize?: number; + zIndex?: number; } - - export type Placement = "top" | "top-left" | "top-right" | "bottom" | "bottom-left" | "bottom-right" | "right" | "left"; + + export type Placement = + | 'top' + | 'top-left' + | 'top-right' + | 'bottom' + | 'bottom-left' + | 'bottom-right' + | 'right' + | 'left'; export interface Step { title?: string; content: React.ReactNode; target: string; placement?: Placement; - type?: "click" | "hover"; + type?: 'click' | 'hover'; isFixed?: boolean; allowClicksThruHole?: boolean; disableBeacon?: boolean; style?: StyleOptions; [prop: string]: any; } - + interface StyleOptionsProp { options: StyleOptions; } @@ -43,19 +51,19 @@ declare module 'react-joyride' { debug?: boolean; styles?: StyleOptionsProp; } - + export interface State { - action: string, - controlled: boolean, - index: number, - lifecycle: string, - size: 0, - status: string, + action: string; + controlled: boolean; + index: number; + lifecycle: string; + size: 0; + status: string; } - + export default class Joyride extends React.Component<Props, State> { constructor(props: Props); - + static defaultProps: Props; } -}
\ No newline at end of file +} diff --git a/packages/website/package.json b/packages/website/package.json index 484639746..efe61c4b6 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -11,9 +11,12 @@ "clean": "shx rm -f public/bundle*", "lint": "tslint --project . 'ts/**/*.ts' 'ts/**/*.tsx'", "watch": "webpack-dev-server --content-base public --https", - "deploy_dogfood": "npm run build; aws s3 sync ./public/. s3://dogfood.0xproject.com --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers", - "deploy_staging": "npm run build; aws s3 sync ./public/. s3://staging-0xproject --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers", - "deploy_live": "npm run build; aws s3 sync ./public/. s3://0xproject.com --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers" + "deploy_dogfood": + "npm run build; aws s3 sync ./public/. s3://dogfood.0xproject.com --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers", + "deploy_staging": + "npm run build; aws s3 sync ./public/. s3://staging-0xproject --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers", + "deploy_live": + "npm run build; aws s3 sync ./public/. s3://0xproject.com --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers" }, "author": "Fabio Berger", "license": "Apache-2.0", diff --git a/packages/website/ts/components/onboarding/onboarding_flow.tsx b/packages/website/ts/components/onboarding/onboarding_flow.tsx index 350319c63..dd417856f 100644 --- a/packages/website/ts/components/onboarding/onboarding_flow.tsx +++ b/packages/website/ts/components/onboarding/onboarding_flow.tsx @@ -4,24 +4,19 @@ import Joyride, { Step, StyleOptions } from 'react-joyride'; import { zIndex } from 'ts/utils/style'; -interface OnboardingFlowProps { +export interface OnboardingFlowProps { steps: Step[]; stepIndex: number; isRunning: boolean; onClose: () => void; - onChange?: (options: any) => void; } -const style: StyleOptions = { +const joyrideStyleOptions: StyleOptions = { zIndex: zIndex.overlay, }; // Wrapper around Joyride with defaults and styles set export class OnboardingFlow extends React.Component<OnboardingFlowProps> { - public static defaultProps: Partial<OnboardingFlowProps> = { - onChange: _.noop, - }; - public render(): React.ReactNode { return ( <Joyride @@ -29,7 +24,7 @@ export class OnboardingFlow extends React.Component<OnboardingFlowProps> { debug={true} steps={this.props.steps} stepIndex={this.props.stepIndex} - styles={{ options: style }} + styles={{ options: joyrideStyleOptions }} callback={this._handleChange.bind(this)} /> ); @@ -40,6 +35,5 @@ export class OnboardingFlow extends React.Component<OnboardingFlowProps> { case 'close': this.props.onClose(); } - this.props.onChange(options); } } diff --git a/packages/website/ts/components/ui/container.tsx b/packages/website/ts/components/ui/container.tsx index 7565dd1ae..07868608c 100644 --- a/packages/website/ts/components/ui/container.tsx +++ b/packages/website/ts/components/ui/container.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -interface ContainerProps { +export interface ContainerProps { marginTop?: string | number; marginBottom?: string | number; marginRight?: string | number; diff --git a/packages/website/ts/components/ui/island.tsx b/packages/website/ts/components/ui/island.tsx index da3602c3e..f5480c9c9 100644 --- a/packages/website/ts/components/ui/island.tsx +++ b/packages/website/ts/components/ui/island.tsx @@ -20,7 +20,7 @@ const defaultStyle: React.CSSProperties = { }; export const Island: React.StatelessComponent<IslandProps> = (props: IslandProps) => ( - <props.Component style={{...defaultStyle, ...props.style}} className={props.className}> + <props.Component style={{ ...defaultStyle, ...props.style }} className={props.className}> {props.children} </props.Component> ); diff --git a/packages/website/ts/components/wallet/wallet.tsx b/packages/website/ts/components/wallet/wallet.tsx index 1790f7258..39e591bac 100644 --- a/packages/website/ts/components/wallet/wallet.tsx +++ b/packages/website/ts/components/wallet/wallet.tsx @@ -192,7 +192,7 @@ export class Wallet extends React.Component<WalletProps, WalletState> { const isReadyToRender = this.props.blockchainIsLoaded && this.props.blockchainErr === BlockchainErrs.NoError; const isAddressAvailable = !_.isEmpty(this.props.userAddress); return ( - <Island className="flex flex-column" style={styles.root}> + <Island className="flex flex-column wallet" style={styles.root}> {isReadyToRender && isAddressAvailable ? _.concat(this._renderConnectedHeaderRows(), this._renderBody(), this._renderFooterRows()) : _.concat(this._renderDisconnectedHeaderRows(), this._renderDisconnectedRows())} diff --git a/packages/website/ts/containers/portal_onboarding_flow.ts b/packages/website/ts/containers/portal_onboarding_flow.ts index 64f05ec92..e62e46dd1 100644 --- a/packages/website/ts/containers/portal_onboarding_flow.ts +++ b/packages/website/ts/containers/portal_onboarding_flow.ts @@ -31,4 +31,7 @@ const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({ }, }); -export const PortalOnboardingFlow: React.ComponentClass<PortalOnboardingFlowProps> = connect(mapStateToProps, mapDispatchToProps)(PortalOnboardingFlowComponent); +export const PortalOnboardingFlow: React.ComponentClass<PortalOnboardingFlowProps> = connect( + mapStateToProps, + mapDispatchToProps, +)(PortalOnboardingFlowComponent); |