aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-shared
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-10-05 19:03:15 +0800
committerFabio Berger <me@fabioberger.com>2018-10-05 19:03:15 +0800
commite0355a2e395fc056fd1d5c5e1780784853546acd (patch)
treecab6ee4acf245c31b25119776901ad584e6a9c7f /packages/react-shared
parentf7aee9c7a9df36e20888c10616a249c2a79ed749 (diff)
downloaddexon-sol-tools-e0355a2e395fc056fd1d5c5e1780784853546acd.tar
dexon-sol-tools-e0355a2e395fc056fd1d5c5e1780784853546acd.tar.gz
dexon-sol-tools-e0355a2e395fc056fd1d5c5e1780784853546acd.tar.bz2
dexon-sol-tools-e0355a2e395fc056fd1d5c5e1780784853546acd.tar.lz
dexon-sol-tools-e0355a2e395fc056fd1d5c5e1780784853546acd.tar.xz
dexon-sol-tools-e0355a2e395fc056fd1d5c5e1780784853546acd.tar.zst
dexon-sol-tools-e0355a2e395fc056fd1d5c5e1780784853546acd.zip
Rename scroll container
Diffstat (limited to 'packages/react-shared')
-rw-r--r--packages/react-shared/src/components/anchor_title.tsx2
-rw-r--r--packages/react-shared/src/components/link.tsx2
-rw-r--r--packages/react-shared/src/components/nested_sidebar_menu.tsx14
-rw-r--r--packages/react-shared/src/utils/constants.ts3
4 files changed, 5 insertions, 16 deletions
diff --git a/packages/react-shared/src/components/anchor_title.tsx b/packages/react-shared/src/components/anchor_title.tsx
index 8f7e4af27..a83881b67 100644
--- a/packages/react-shared/src/components/anchor_title.tsx
+++ b/packages/react-shared/src/components/anchor_title.tsx
@@ -71,7 +71,7 @@ export class AnchorTitle extends React.Component<AnchorTitleProps, AnchorTitleSt
hashSpy={true}
offset={headerSizeToScrollOffset[this.props.headerSize]}
duration={constants.DOCS_SCROLL_DURATION_MS}
- containerId={constants.DOCS_CONTAINER_ID}
+ containerId={constants.SCROLL_CONTAINER_ID}
>
<i
className="zmdi zmdi-link"
diff --git a/packages/react-shared/src/components/link.tsx b/packages/react-shared/src/components/link.tsx
index e8a13d506..51ffa1e1d 100644
--- a/packages/react-shared/src/components/link.tsx
+++ b/packages/react-shared/src/components/link.tsx
@@ -93,7 +93,7 @@ export class Link extends React.Component<LinkProps, LinkState> {
offset={0}
hashSpy={true}
duration={constants.DOCS_SCROLL_DURATION_MS}
- containerId={constants.DOCS_CONTAINER_ID}
+ containerId={constants.SCROLL_CONTAINER_ID}
className={this.props.className}
style={styleWithDefault}
>
diff --git a/packages/react-shared/src/components/nested_sidebar_menu.tsx b/packages/react-shared/src/components/nested_sidebar_menu.tsx
index 709d0ace9..0bc516223 100644
--- a/packages/react-shared/src/components/nested_sidebar_menu.tsx
+++ b/packages/react-shared/src/components/nested_sidebar_menu.tsx
@@ -94,12 +94,7 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
: link.title;
return (
<div key={`menuItem-${finalMenuItemName}`}>
- <Link
- to={link.to}
- type={link.type}
- shouldOpenInNewTab={link.shouldOpenInNewTab}
- containerId={constants.DOCS_CONTAINER_ID}
- >
+ <Link to={link.to} type={link.type} shouldOpenInNewTab={link.shouldOpenInNewTab}>
<MenuItem
style={menuItemStyles}
innerDivStyle={menuItemInnerDivStyles}
@@ -136,12 +131,7 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
const name = `${menuItemName}-${link.title}`;
return (
<li key={`menuSubsectionItem-${name}`}>
- <Link
- to={link.to}
- type={link.type}
- shouldOpenInNewTab={link.shouldOpenInNewTab}
- containerId={constants.DOCS_CONTAINER_ID}
- >
+ <Link to={link.to} type={link.type} shouldOpenInNewTab={link.shouldOpenInNewTab}>
<MenuItem
style={{ minHeight: 35 }}
innerDivStyle={{
diff --git a/packages/react-shared/src/utils/constants.ts b/packages/react-shared/src/utils/constants.ts
index 562ab776b..2dca1a078 100644
--- a/packages/react-shared/src/utils/constants.ts
+++ b/packages/react-shared/src/utils/constants.ts
@@ -2,8 +2,7 @@ import { Networks } from '../types';
export const constants = {
DOCS_SCROLL_DURATION_MS: 0,
- DOCS_CONTAINER_ID: 'documentation',
- SCROLL_CONTAINER_ID: 'documentation',
+ SCROLL_CONTAINER_ID: 'scroll_container',
SCROLL_TOP_ID: 'pageScrollTop',
NETWORK_NAME_BY_ID: {
1: Networks.Mainnet,