diff options
author | Fabio Berger <me@fabioberger.com> | 2018-08-28 18:19:01 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-08-28 18:19:01 +0800 |
commit | cc2000e776b1abf0f545f361c0d0b28b76b6c310 (patch) | |
tree | 6a125b2b6a5d6dbcde86ed05858de27e54d25b5c | |
parent | b8241c0f808518a3f727424cacb952cc9ce80c4c (diff) | |
download | dexon-sol-tools-cc2000e776b1abf0f545f361c0d0b28b76b6c310.tar dexon-sol-tools-cc2000e776b1abf0f545f361c0d0b28b76b6c310.tar.gz dexon-sol-tools-cc2000e776b1abf0f545f361c0d0b28b76b6c310.tar.bz2 dexon-sol-tools-cc2000e776b1abf0f545f361c0d0b28b76b6c310.tar.lz dexon-sol-tools-cc2000e776b1abf0f545f361c0d0b28b76b6c310.tar.xz dexon-sol-tools-cc2000e776b1abf0f545f361c0d0b28b76b6c310.tar.zst dexon-sol-tools-cc2000e776b1abf0f545f361c0d0b28b76b6c310.zip |
Use generatic ObjectMap type
-rw-r--r-- | packages/website/ts/components/dropdowns/developers_drop_down.tsx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/packages/website/ts/components/dropdowns/developers_drop_down.tsx b/packages/website/ts/components/dropdowns/developers_drop_down.tsx index 68f9a2f67..c4eae0c31 100644 --- a/packages/website/ts/components/dropdowns/developers_drop_down.tsx +++ b/packages/website/ts/components/dropdowns/developers_drop_down.tsx @@ -3,20 +3,16 @@ import * as _ from 'lodash'; import * as React from 'react'; import { Link } from 'react-router-dom'; import { DropDown } from 'ts/components/ui/drop_down'; -import { Deco, Key, WebsitePaths } from 'ts/types'; +import { Deco, Key, ObjectMap, WebsitePaths } from 'ts/types'; import { constants } from 'ts/utils/constants'; import { Translate } from 'ts/utils/translate'; -interface KeyToLinkInfo { - [key: string]: LinkInfo; -} - interface LinkInfo { link: string; shouldOpenNewTab: boolean; } -const gettingStartedKeyToLinkInfo1: KeyToLinkInfo = { +const gettingStartedKeyToLinkInfo1: ObjectMap<LinkInfo> = { [Key.BuildARelayer]: { link: `${WebsitePaths.Wiki}#Build-A-Relayer`, shouldOpenNewTab: false, @@ -26,7 +22,7 @@ const gettingStartedKeyToLinkInfo1: KeyToLinkInfo = { shouldOpenNewTab: false, }, }; -const gettingStartedKeyToLinkInfo2: KeyToLinkInfo = { +const gettingStartedKeyToLinkInfo2: ObjectMap<LinkInfo> = { [Key.TradingTutorial]: { link: `${WebsitePaths.Wiki}#Find,-Submit,-Fill-Order-From-Relayer`, shouldOpenNewTab: false, @@ -36,7 +32,7 @@ const gettingStartedKeyToLinkInfo2: KeyToLinkInfo = { shouldOpenNewTab: false, }, }; -const popularDocsToLinkInfos: KeyToLinkInfo = { +const popularDocsToLinkInfos: ObjectMap<LinkInfo> = { [Key.ZeroExJs]: { link: WebsitePaths.ZeroExJs, shouldOpenNewTab: false, @@ -50,7 +46,7 @@ const popularDocsToLinkInfos: KeyToLinkInfo = { shouldOpenNewTab: false, }, }; -const usefulLinksToLinkInfo: KeyToLinkInfo = { +const usefulLinksToLinkInfo: ObjectMap<LinkInfo> = { [Key.Github]: { link: constants.URL_GITHUB_ORG, shouldOpenNewTab: true, @@ -76,6 +72,9 @@ interface DevelopersDropDownState {} export class DevelopersDropDown extends React.Component<DevelopersDropDownProps, DevelopersDropDownState> { public render(): React.ReactNode { const activeNode = ( + <Container + + /> <div className="flex relative" style={{ color: this.props.menuIconStyle.color }}> <div style={{ paddingRight: 10 }}>{this.props.translate.get(Key.Developers, Deco.Cap)}</div> </div> @@ -158,7 +157,7 @@ export class DevelopersDropDown extends React.Component<DevelopersDropDownProps, </div> ); } - private _renderLinkSection(keyToLinkInfo: KeyToLinkInfo): React.ReactNode { + private _renderLinkSection(keyToLinkInfo: ObjectMap<LinkInfo>): React.ReactNode { const linkStyle: React.CSSProperties = { color: colors.lightBlueA700, fontFamily: 'Roboto, Roboto Mono', |