From 5f2cd33da07a7acc65f2e05acb35755f74af75a4 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 5 Oct 2018 13:54:37 +0100 Subject: Remove style prop from Link --- packages/react-docs/src/components/source_link.tsx | 8 ++--- packages/react-shared/src/components/link.tsx | 12 ++++--- .../ts/components/documentation/docs_logo.tsx | 8 ++--- .../ts/components/documentation/docs_top_bar.tsx | 6 ++-- .../components/dropdowns/developers_drop_down.tsx | 21 ++++------- packages/website/ts/components/fill_order.tsx | 2 +- packages/website/ts/components/footer.tsx | 7 +--- .../ts/components/inputs/token_amount_input.tsx | 3 +- .../ts/components/top_bar/top_bar_menu_item.tsx | 2 +- .../website/ts/components/ui/custom_menu_item.tsx | 3 +- packages/website/ts/pages/about/about.tsx | 2 +- packages/website/ts/pages/documentation/home.tsx | 41 ++++++++++++---------- packages/website/ts/pages/landing/landing.tsx | 5 +-- 13 files changed, 56 insertions(+), 64 deletions(-) (limited to 'packages') diff --git a/packages/react-docs/src/components/source_link.tsx b/packages/react-docs/src/components/source_link.tsx index 3096ad8d5..c6dd09adb 100644 --- a/packages/react-docs/src/components/source_link.tsx +++ b/packages/react-docs/src/components/source_link.tsx @@ -1,4 +1,4 @@ -import { colors } from '@0xproject/react-shared'; +import { colors, Link } from '@0xproject/react-shared'; import { Source } from '@0xproject/types'; import * as React from 'react'; @@ -13,9 +13,9 @@ export const SourceLink = (props: SourceLinkProps) => { const sourceCodeUrl = `${props.sourceUrl}/${src.fileName}#L${src.line}`; return (
- - Source - + + {'Source'} +
); }; diff --git a/packages/react-shared/src/components/link.tsx b/packages/react-shared/src/components/link.tsx index 51ffa1e1d..60891dd7a 100644 --- a/packages/react-shared/src/components/link.tsx +++ b/packages/react-shared/src/components/link.tsx @@ -10,11 +10,12 @@ interface LinkProps { to: string; type?: LinkType; shouldOpenInNewTab?: boolean; - style?: React.CSSProperties; className?: string; onMouseOver?: (event: React.MouseEvent) => void; onMouseLeave?: (event: React.MouseEvent) => void; onMouseEnter?: (event: React.MouseEvent) => void; + textDecoration?: string; + fontColor?: string; } export interface LinkState {} @@ -29,11 +30,12 @@ export class Link extends React.Component { public static defaultProps: Partial = { type: LinkType.ReactRoute, shouldOpenInNewTab: false, - style: {}, className: '', onMouseOver: _.noop.bind(_), onMouseLeave: _.noop.bind(_), onMouseEnter: _.noop.bind(_), + textDecoration: 'none', + fontColor: 'inherit', }; private _outerReactScrollSpan: HTMLSpanElement | null; constructor(props: LinkProps) { @@ -46,11 +48,13 @@ export class Link extends React.Component { } const styleWithDefault = { - textDecoration: 'none', + textDecoration: this.props.textDecoration, cursor: 'pointer', - ...this.props.style, + color: this.props.fontColor, }; + console.log('styleWithDefault', styleWithDefault); + switch (this.props.type) { case LinkType.External: return ( diff --git a/packages/website/ts/components/documentation/docs_logo.tsx b/packages/website/ts/components/documentation/docs_logo.tsx index 6f3c3c6e8..b727fea36 100644 --- a/packages/website/ts/components/documentation/docs_logo.tsx +++ b/packages/website/ts/components/documentation/docs_logo.tsx @@ -9,11 +9,9 @@ export interface DocsLogoProps { export const DocsLogo: React.StatelessComponent = props => { return ( -
- - - -
+ + + ); }; diff --git a/packages/website/ts/components/documentation/docs_top_bar.tsx b/packages/website/ts/components/documentation/docs_top_bar.tsx index 3fea1c714..0b563a76b 100644 --- a/packages/website/ts/components/documentation/docs_top_bar.tsx +++ b/packages/website/ts/components/documentation/docs_top_bar.tsx @@ -68,7 +68,7 @@ export class DocsTopBar extends React.Component @@ -86,7 +86,9 @@ export class DocsTopBar extends React.Component - + + + {this._renderLinkSection(usefulLinksToLinkInfo)} - +
{this.props.translate.get(Key.ViewAllDocumentation, Deco.Upper)} @@ -159,10 +154,6 @@ export class DevelopersDropDown extends React.Component { @@ -179,8 +170,10 @@ export class DevelopersDropDown extends React.Component - - {linkText} + + + {linkText} +
); diff --git a/packages/website/ts/components/fill_order.tsx b/packages/website/ts/components/fill_order.tsx index 99939ce43..c1bbadfde 100644 --- a/packages/website/ts/components/fill_order.tsx +++ b/packages/website/ts/components/fill_order.tsx @@ -323,7 +323,7 @@ export class FillOrder extends React.Component { return (
Order successfully filled. See the trade details in your{' '} - + trade history
diff --git a/packages/website/ts/components/footer.tsx b/packages/website/ts/components/footer.tsx index 02770c073..d90f2f708 100644 --- a/packages/website/ts/components/footer.tsx +++ b/packages/website/ts/components/footer.tsx @@ -12,11 +12,6 @@ import { Translate } from 'ts/utils/translate'; const ICON_DIMENSION = 16; -const linkStyle = { - color: colors.white, - cursor: 'pointer', -}; - const languageToMenuTitle = { [Language.English]: 'English', [Language.Russian]: 'Русский', @@ -187,7 +182,7 @@ export class Footer extends React.Component { const iconIfExists = titleToIcon[link.title]; return (
- +
{!_.isUndefined(iconIfExists) ? (
diff --git a/packages/website/ts/components/inputs/token_amount_input.tsx b/packages/website/ts/components/inputs/token_amount_input.tsx index 562f670e2..134d1cc76 100644 --- a/packages/website/ts/components/inputs/token_amount_input.tsx +++ b/packages/website/ts/components/inputs/token_amount_input.tsx @@ -111,7 +111,8 @@ export class TokenAmountInput extends React.Component Set allowance diff --git a/packages/website/ts/components/top_bar/top_bar_menu_item.tsx b/packages/website/ts/components/top_bar/top_bar_menu_item.tsx index d5ee96850..c88db95fa 100644 --- a/packages/website/ts/components/top_bar/top_bar_menu_item.tsx +++ b/packages/website/ts/components/top_bar/top_bar_menu_item.tsx @@ -37,7 +37,7 @@ export class TopBarMenuItem extends React.Component - + {itemContent}
diff --git a/packages/website/ts/components/ui/custom_menu_item.tsx b/packages/website/ts/components/ui/custom_menu_item.tsx index 11f61b336..c25da6be6 100644 --- a/packages/website/ts/components/ui/custom_menu_item.tsx +++ b/packages/website/ts/components/ui/custom_menu_item.tsx @@ -4,7 +4,6 @@ import * as React from 'react'; interface CustomMenuItemProps { to: string; - style?: React.CSSProperties; onClick?: () => void; className?: string; } @@ -30,7 +29,7 @@ export class CustomMenuItem extends React.Component +
{ }} > We are seeking outstanding candidates to{' '} - + join our team . We value passion, diversity and unique perspectives. diff --git a/packages/website/ts/pages/documentation/home.tsx b/packages/website/ts/pages/documentation/home.tsx index 7e34136a8..abe0ae6af 100644 --- a/packages/website/ts/pages/documentation/home.tsx +++ b/packages/website/ts/pages/documentation/home.tsx @@ -446,12 +446,14 @@ export class Home extends React.Component { - + + +
{ @@ -578,23 +580,24 @@ export class Home extends React.Component { - - - {this.props.translate.get(Key.More, Deco.Cap)} - - + + + + {this.props.translate.get(Key.More, Deco.Cap)} + + + - - + + diff --git a/packages/website/ts/pages/landing/landing.tsx b/packages/website/ts/pages/landing/landing.tsx index c819cd8a1..395cdabf8 100644 --- a/packages/website/ts/pages/landing/landing.tsx +++ b/packages/website/ts/pages/landing/landing.tsx @@ -317,10 +317,7 @@ export class Landing extends React.Component { }} > {this.props.translate.get(Key.FullListPrompt)}{' '} - + {this.props.translate.get(Key.FullListLink)}
-- cgit v1.2.3