2020-07-02 11:24:14 +03:00
|
|
|
import { css } from "@emotion/react";
|
2020-06-22 14:15:04 +03:00
|
|
|
|
2020-07-02 11:24:14 +03:00
|
|
|
import * as React from "react";
|
|
|
|
import * as Constants from "~/common/constants";
|
|
|
|
import * as SVG from "~/common/svg";
|
2020-06-22 14:15:04 +03:00
|
|
|
|
|
|
|
const STYLES_VIEW_SOURCE_LINK = css`
|
|
|
|
font-size: 14px;
|
2020-07-02 11:24:14 +03:00
|
|
|
font-family: ${Constants.font.semiBold};
|
2020-06-22 14:15:04 +03:00
|
|
|
display: inline-block;
|
|
|
|
transition: 200ms ease all;
|
|
|
|
cursor: pointer;
|
|
|
|
color: ${Constants.system.darkGray};
|
|
|
|
|
|
|
|
:hover {
|
|
|
|
color: ${Constants.system.brand};
|
|
|
|
}
|
|
|
|
|
|
|
|
:visited {
|
|
|
|
color: ${Constants.system.green};
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export default class ViewSourceLink extends React.Component {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<a
|
|
|
|
css={STYLES_VIEW_SOURCE_LINK}
|
2020-09-10 14:03:03 +03:00
|
|
|
href={`https://github.com/filecoin-project/slate/blob/main/pages/_/${this.props.file}`}
|
2020-07-02 11:24:14 +03:00
|
|
|
target="_blank"
|
|
|
|
>
|
2020-06-22 14:15:04 +03:00
|
|
|
<SVG.ExpandBox height="12px" style={{ marginRight: 2 }} /> View Source
|
|
|
|
</a>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|