aboutsummaryrefslogblamecommitdiffstats
path: root/packages/react-docs/src/components/source_link.tsx
blob: 3096ad8d5c3121fef618230bef29631c46ed0169 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                                 
                                          
                               
 
                                  
                   
                      


                    
                                                       
                             
                                                                            
            

                                                                                                         



                      
  
import { colors } 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 }}>
            <a href={sourceCodeUrl} target="_blank" className="underline" style={{ color: colors.grey }}>
                Source
            </a>
        </div>
    );
};