aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-shared/src/components/anchor_title.tsx
diff options
context:
space:
mode:
authorAugust Skare <post@augustskare.no>2018-11-16 18:28:24 +0800
committerAugust Skare <post@augustskare.no>2018-11-16 18:28:24 +0800
commitc08108144825c33d8db26053c1d2d41460b09359 (patch)
tree6f21ce1e6834e0130b0f6063a097014cc1cc671f /packages/react-shared/src/components/anchor_title.tsx
parent54bd7df900316504e4403bc94cffd92930a6c763 (diff)
parentcabb7432b9a6d4a5bb8da6fc7fe4522d24e4ece5 (diff)
downloaddexon-sol-tools-c08108144825c33d8db26053c1d2d41460b09359.tar
dexon-sol-tools-c08108144825c33d8db26053c1d2d41460b09359.tar.gz
dexon-sol-tools-c08108144825c33d8db26053c1d2d41460b09359.tar.bz2
dexon-sol-tools-c08108144825c33d8db26053c1d2d41460b09359.tar.lz
dexon-sol-tools-c08108144825c33d8db26053c1d2d41460b09359.tar.xz
dexon-sol-tools-c08108144825c33d8db26053c1d2d41460b09359.tar.zst
dexon-sol-tools-c08108144825c33d8db26053c1d2d41460b09359.zip
Merge branch 'development' into dev-tools-pages
Diffstat (limited to 'packages/react-shared/src/components/anchor_title.tsx')
-rw-r--r--packages/react-shared/src/components/anchor_title.tsx18
1 files changed, 3 insertions, 15 deletions
diff --git a/packages/react-shared/src/components/anchor_title.tsx b/packages/react-shared/src/components/anchor_title.tsx
index bd99edcab..a9105e132 100644
--- a/packages/react-shared/src/components/anchor_title.tsx
+++ b/packages/react-shared/src/components/anchor_title.tsx
@@ -1,15 +1,9 @@
import * as React from 'react';
-import { Link as ScrollLink } from 'react-scroll';
import styled from 'styled-components';
+import { Link } from '../components/link';
import { HeaderSizes, Styles } from '../types';
import { colors } from '../utils/colors';
-import { constants } from '../utils/constants';
-
-const headerSizeToScrollOffset: { [headerSize: string]: number } = {
- h2: -20,
- h3: 0,
-};
export interface AnchorTitleProps {
title: string | React.ReactNode;
@@ -73,15 +67,9 @@ export class AnchorTitle extends React.Component<AnchorTitleProps, AnchorTitleSt
{this.props.title}
</div>
{!this.props.isDisabled && (
- <ScrollLink
- to={this.props.id}
- hashSpy={true}
- offset={headerSizeToScrollOffset[this.props.headerSize]}
- duration={constants.DOCS_SCROLL_DURATION_MS}
- containerId={constants.SCROLL_CONTAINER_ID}
- >
+ <Link to={this.props.id}>
<AnchorIcon className="zmdi zmdi-link" shouldShowAnchor={this.props.shouldShowAnchor} />
- </ScrollLink>
+ </Link>
)}
</div>
);