Fix source links in 0x.js docs

This commit is contained in:
Fabio Berger
2017-11-27 10:25:53 -06:00
parent 48b3d85265
commit 25ec4cf7b0

View File

@@ -8,10 +8,13 @@ interface SourceLinkProps {
version: string; version: string;
} }
const SUB_PKG = '0x.js';
export function SourceLink(props: SourceLinkProps) { export function SourceLink(props: SourceLinkProps) {
const source = props.source; const src = props.source;
const githubUrl = constants.GITHUB_0X_JS_URL; const url = constants.GITHUB_0X_JS_URL;
const sourceCodeUrl = `${githubUrl}/blob/v${props.version}/${source.fileName}#L${source.line}`; // https://github.com/0xProject/0x.js/blob/0x.js%400.26.1/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
const sourceCodeUrl = `${url}/blob/${SUB_PKG}%40${props.version}/packages/${SUB_PKG}/${src.fileName}#L${src.line}`;
return ( return (
<div className="pt2" style={{fontSize: 14}}> <div className="pt2" style={{fontSize: 14}}>
<a <a