diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-14 22:18:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-14 22:18:16 +0800 |
commit | e16feb27f4ec1987259a87f360824a0158bd8b10 (patch) | |
tree | e94cb3bc89e215c4df38ab161379023ab8e0c4e9 /packages/react-docs/src/components/source_link.tsx | |
parent | 3f3e8be004818ddaa1921b3dff12bdd46052278b (diff) | |
parent | 83ae7ba08d55fa964bf7b7a985aea0fe1520c5c7 (diff) | |
download | dexon-0x-contracts-e16feb27f4ec1987259a87f360824a0158bd8b10.tar.gz dexon-0x-contracts-e16feb27f4ec1987259a87f360824a0158bd8b10.tar.zst dexon-0x-contracts-e16feb27f4ec1987259a87f360824a0158bd8b10.zip |
Merge pull request #450 from 0xProject/convertScriptsToTs
Convert Scripts to TS & Other Misc. Fixes
Diffstat (limited to 'packages/react-docs/src/components/source_link.tsx')
-rw-r--r-- | packages/react-docs/src/components/source_link.tsx | 23 |
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> + ); +} |