aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs/src/components/source_link.tsx
blob: c6dd09adb0008c5225851a2c48858e829b18118e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { colors, Link } from '@0xproject/react-shared';
import { Source } from '@0xproject/types';
import * as React from 'react';

export interface SourceLinkProps {
    source: Source;
    sourceUrl: string;
    version: string;
}

export const SourceLink = (props: SourceLinkProps) => {
    const src = props.source;
    const sourceCodeUrl = `${props.sourceUrl}/${src.fileName}#L${src.line}`;
    return (
        <div className="pt2" style={{ fontSize: 14 }}>
            <Link to={sourceCodeUrl} shouldOpenInNewTab={true} textDecoration="underline" fontColor={colors.grey}>
                {'Source'}
            </Link>
        </div>
    );
};