aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs/src/components/source_link.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/react-docs/src/components/source_link.tsx')
-rw-r--r--packages/react-docs/src/components/source_link.tsx23
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/react-docs/src/components/source_link.tsx b/packages/react-docs/src/components/source_link.tsx
new file mode 100644
index 000000000..89956a507
--- /dev/null
+++ b/packages/react-docs/src/components/source_link.tsx
@@ -0,0 +1,23 @@
+import { colors } from '@0xproject/react-shared';
+import * as _ from 'lodash';
+import * as React from 'react';
+
+import { Source } from '../types';
+
+export interface SourceLinkProps {
+ source: Source;
+ sourceUrl: string;
+ version: string;
+}
+
+export function SourceLink(props: SourceLinkProps) {
+ const src = props.source;
+ const sourceCodeUrl = `${props.sourceUrl}/${src.fileName}#L${src.line}`;
+ return (
+ <div className="pt2" style={{ fontSize: 14 }}>
+ <a href={sourceCodeUrl} target="_blank" className="underline" style={{ color: colors.grey }}>
+ Source
+ </a>
+ </div>
+ );
+}