aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/pages/shared/version_drop_down.tsx
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-11-29 01:16:35 +0800
committerFabio Berger <me@fabioberger.com>2017-11-29 01:16:35 +0800
commit3472bdcfd4ea0a6145dd68972f563e483baf7e6b (patch)
tree6ed8d25cd58cd243aaf94af37f4e9d1d6a98fc85 /packages/website/ts/pages/shared/version_drop_down.tsx
parent78f0ab36823127b67c1ea24b7245c51ba814b16a (diff)
downloaddexon-sol-tools-3472bdcfd4ea0a6145dd68972f563e483baf7e6b.tar.gz
dexon-sol-tools-3472bdcfd4ea0a6145dd68972f563e483baf7e6b.tar.zst
dexon-sol-tools-3472bdcfd4ea0a6145dd68972f563e483baf7e6b.zip
Refactor docs to be more declarative, put all hard-coded doc-related data in one place so it easier to add new doc pages
Diffstat (limited to 'packages/website/ts/pages/shared/version_drop_down.tsx')
-rw-r--r--packages/website/ts/pages/shared/version_drop_down.tsx5
1 files changed, 2 insertions, 3 deletions
diff --git a/packages/website/ts/pages/shared/version_drop_down.tsx b/packages/website/ts/pages/shared/version_drop_down.tsx
index 8f4f1a35b..4af9a834f 100644
--- a/packages/website/ts/pages/shared/version_drop_down.tsx
+++ b/packages/website/ts/pages/shared/version_drop_down.tsx
@@ -8,7 +8,7 @@ import {constants} from 'ts/utils/constants';
interface VersionDropDownProps {
selectedVersion: string;
versions: string[];
- doc: Docs;
+ docPath: string;
}
interface VersionDropDownState {}
@@ -40,7 +40,6 @@ export class VersionDropDown extends React.Component<VersionDropDownProps, Versi
return items;
}
private updateSelectedVersion(e: any, index: number, value: string) {
- const docPath = constants.docToPath[this.props.doc];
- window.location.href = `${docPath}/${value}${window.location.hash}`;
+ window.location.href = `${this.props.docPath}/${value}${window.location.hash}`;
}
}