From 3592ebef0800fe3c32c9f1e4870b667a07a322bb Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sat, 3 Mar 2018 19:55:40 +0100 Subject: Move over AnchorTitle and associated elements --- .../website/ts/components/inputs/hash_input.tsx | 3 +- packages/website/ts/components/token_balances.tsx | 2 +- packages/website/ts/components/top_bar/top_bar.tsx | 3 +- .../ts/pages/documentation/documentation.tsx | 2 +- .../ts/pages/documentation/event_definition.tsx | 4 +- .../ts/pages/documentation/method_block.tsx | 4 +- packages/website/ts/pages/documentation/type.tsx | 9 ++- .../ts/pages/documentation/type_definition.tsx | 4 +- packages/website/ts/pages/faq/faq.tsx | 3 +- packages/website/ts/pages/shared/anchor_title.tsx | 86 ---------------------- .../ts/pages/shared/markdown_link_block.tsx | 3 +- .../website/ts/pages/shared/markdown_section.tsx | 3 +- .../ts/pages/shared/nested_sidebar_menu.tsx | 6 +- .../website/ts/pages/shared/section_header.tsx | 3 +- packages/website/ts/pages/wiki/wiki.tsx | 3 +- packages/website/ts/types.ts | 10 --- packages/website/ts/utils/constants.ts | 2 - packages/website/ts/utils/utils.ts | 3 - 18 files changed, 28 insertions(+), 125 deletions(-) delete mode 100644 packages/website/ts/pages/shared/anchor_title.tsx (limited to 'packages') diff --git a/packages/website/ts/components/inputs/hash_input.tsx b/packages/website/ts/components/inputs/hash_input.tsx index 5a3d34fe6..28305637d 100644 --- a/packages/website/ts/components/inputs/hash_input.tsx +++ b/packages/website/ts/components/inputs/hash_input.tsx @@ -1,10 +1,11 @@ import { Order, ZeroEx } from '0x.js'; +import { Styles } from '@0xproject/react-shared'; import * as _ from 'lodash'; import * as React from 'react'; import ReactTooltip = require('react-tooltip'); import { Blockchain } from 'ts/blockchain'; import { FakeTextField } from 'ts/components/ui/fake_text_field'; -import { HashData, Styles } from 'ts/types'; +import { HashData } from 'ts/types'; import { constants } from 'ts/utils/constants'; const styles: Styles = { diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx index 894edf0a8..b569a9165 100644 --- a/packages/website/ts/components/token_balances.tsx +++ b/packages/website/ts/components/token_balances.tsx @@ -1,4 +1,5 @@ import { ZeroEx } from '0x.js'; +import { styles } from '@0xproject/react-shared'; import { BigNumber } from '@0xproject/utils'; import DharmaLoanFrame from 'dharma-loan-frame'; import * as _ from 'lodash'; @@ -29,7 +30,6 @@ import { EtherscanLinkSuffixes, Networks, ScreenWidths, - Styles, Token, TokenByAddress, TokenVisibility, diff --git a/packages/website/ts/components/top_bar/top_bar.tsx b/packages/website/ts/components/top_bar/top_bar.tsx index b2b2d2ebd..829225440 100644 --- a/packages/website/ts/components/top_bar/top_bar.tsx +++ b/packages/website/ts/components/top_bar/top_bar.tsx @@ -1,3 +1,4 @@ +import { styles } from '@0xproject/react-shared'; import * as _ from 'lodash'; import Drawer from 'material-ui/Drawer'; import Menu from 'material-ui/Menu'; @@ -14,7 +15,7 @@ import { Identicon } from 'ts/components/ui/identicon'; import { DocsInfo } from 'ts/pages/documentation/docs_info'; import { NestedSidebarMenu } from 'ts/pages/shared/nested_sidebar_menu'; import { Dispatcher } from 'ts/redux/dispatcher'; -import { Deco, DocsMenu, Key, MenuSubsectionsBySection, ProviderType, Styles, WebsitePaths } from 'ts/types'; +import { Deco, DocsMenu, Key, MenuSubsectionsBySection, ProviderType, WebsitePaths } from 'ts/types'; import { colors } from 'ts/utils/colors'; import { constants } from 'ts/utils/constants'; import { Translate } from 'ts/utils/translate'; diff --git a/packages/website/ts/pages/documentation/documentation.tsx b/packages/website/ts/pages/documentation/documentation.tsx index 699bef7a8..ce5f7eb6c 100644 --- a/packages/website/ts/pages/documentation/documentation.tsx +++ b/packages/website/ts/pages/documentation/documentation.tsx @@ -1,3 +1,4 @@ +import { styles } from '@0xproject/react-shared'; import * as _ from 'lodash'; import CircularProgress from 'material-ui/CircularProgress'; import * as React from 'react'; @@ -23,7 +24,6 @@ import { Networks, Property, SolidityMethod, - Styles, SupportedDocJson, TypeDefinitionByName, TypescriptMethod, diff --git a/packages/website/ts/pages/documentation/event_definition.tsx b/packages/website/ts/pages/documentation/event_definition.tsx index e62c9ecbd..7ac17e608 100644 --- a/packages/website/ts/pages/documentation/event_definition.tsx +++ b/packages/website/ts/pages/documentation/event_definition.tsx @@ -1,9 +1,9 @@ +import { AnchorTitle, HeaderSizes } from '@0xproject/react-shared/anchor_title'; import * as _ from 'lodash'; import * as React from 'react'; import { DocsInfo } from 'ts/pages/documentation/docs_info'; import { Type } from 'ts/pages/documentation/type'; -import { AnchorTitle } from 'ts/pages/shared/anchor_title'; -import { Event, EventArg, HeaderSizes } from 'ts/types'; +import { Event, EventArg } from 'ts/types'; import { colors } from 'ts/utils/colors'; interface EventDefinitionProps { diff --git a/packages/website/ts/pages/documentation/method_block.tsx b/packages/website/ts/pages/documentation/method_block.tsx index d2c96bf8c..e1f09346b 100644 --- a/packages/website/ts/pages/documentation/method_block.tsx +++ b/packages/website/ts/pages/documentation/method_block.tsx @@ -1,11 +1,11 @@ +import { AnchorTitle, HeaderSizes, Styles } from '@0xproject/react-shared/anchor_title'; import * as _ from 'lodash'; import * as React from 'react'; import { Comment } from 'ts/pages/documentation/comment'; import { DocsInfo } from 'ts/pages/documentation/docs_info'; import { MethodSignature } from 'ts/pages/documentation/method_signature'; import { SourceLink } from 'ts/pages/documentation/source_link'; -import { AnchorTitle } from 'ts/pages/shared/anchor_title'; -import { HeaderSizes, Parameter, SolidityMethod, Styles, TypeDefinitionByName, TypescriptMethod } from 'ts/types'; +import { Parameter, SolidityMethod, TypeDefinitionByName, TypescriptMethod } from 'ts/types'; import { colors } from 'ts/utils/colors'; import { typeDocUtils } from 'ts/utils/typedoc_utils'; diff --git a/packages/website/ts/pages/documentation/type.tsx b/packages/website/ts/pages/documentation/type.tsx index b306fa053..2fec4c95f 100644 --- a/packages/website/ts/pages/documentation/type.tsx +++ b/packages/website/ts/pages/documentation/type.tsx @@ -1,3 +1,4 @@ +import { constants as sharedConstants, utils as sharedUtils } from '@0xproject/react-shared'; import * as _ from 'lodash'; import * as React from 'react'; import { Link as ScrollLink } from 'react-scroll'; @@ -178,12 +179,12 @@ export function Type(props: TypeProps): any { {_.isUndefined(typeDefinition) || utils.isUserOnMobile() ? ( {typeName} @@ -192,7 +193,7 @@ export function Type(props: TypeProps): any { { - constructor(props: AnchorTitleProps) { - super(props); - this.state = { - isHovering: false, - }; - } - public render() { - let opacity = 0; - if (this.props.shouldShowAnchor) { - opacity = this.state.isHovering ? 0.6 : 1; - } - return ( -
-
- {this.props.title} -
- - - -
- ); - } - private _setHoverState(isHovering: boolean) { - this.setState({ - isHovering, - }); - } -} diff --git a/packages/website/ts/pages/shared/markdown_link_block.tsx b/packages/website/ts/pages/shared/markdown_link_block.tsx index e4553c87f..b1f68c915 100644 --- a/packages/website/ts/pages/shared/markdown_link_block.tsx +++ b/packages/website/ts/pages/shared/markdown_link_block.tsx @@ -1,3 +1,4 @@ +import { utils as sharedUtils } from '@0xproject/react-shared'; import * as _ from 'lodash'; import * as React from 'react'; import { configs } from 'ts/utils/configs'; @@ -41,6 +42,6 @@ export class MarkdownLinkBlock extends React.Component { const w = window as any; return new Promise((resolve: (isSupported: boolean) => void) => { -- cgit v1.2.3