aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--packages/react-docs/src/components/type.tsx2
-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
5 files changed, 6 insertions, 17 deletions
diff --git a/packages/react-docs/src/components/type.tsx b/packages/react-docs/src/components/type.tsx
index 5c018f5dd..2e0003198 100644
--- a/packages/react-docs/src/components/type.tsx
+++ b/packages/react-docs/src/components/type.tsx
@@ -228,7 +228,7 @@ export const Type: React.SFC<TypeProps> = (props: TypeProps): any => {
offset={0}
hashSpy={true}
duration={sharedConstants.DOCS_SCROLL_DURATION_MS}
- containerId={sharedConstants.DOCS_CONTAINER_ID}
+ containerId={sharedConstants.SCROLL_CONTAINER_ID}
>
{sharedUtils.isUserOnMobile() || props.isInPopover || isExportedClassReference ? (
<span style={{ color: colors.lightBlueA700, cursor: 'pointer' }}>{typeName}</span>
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,