slate/components/system/ViewSourceLink.js

37 lines
850 B
JavaScript
Raw Normal View History

import * as React from "react";
import * as Constants from "~/common/constants";
import * as SVG from "~/common/svg";
2020-11-30 08:24:22 +03:00
import { css } from "@emotion/react";
const STYLES_VIEW_SOURCE_LINK = css`
font-size: 14px;
font-family: ${Constants.font.semiBold};
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}`}
target="_blank"
>
<SVG.ExpandBox height="12px" style={{ marginRight: 2 }} /> View Source
</a>
);
}
}