2020-07-09 06:19:08 +03:00
|
|
|
import * as React from "react";
|
|
|
|
import * as Constants from "~/common/constants";
|
|
|
|
import * as SVG from "~/components/system/svg";
|
2020-04-09 00:29:13 +03:00
|
|
|
|
2020-07-09 06:19:08 +03:00
|
|
|
import { css } from "@emotion/react";
|
2020-04-09 00:29:13 +03:00
|
|
|
|
2020-08-02 09:00:04 +03:00
|
|
|
import MediaObject from "~/components/core/MediaObject";
|
2020-04-09 00:29:13 +03:00
|
|
|
|
|
|
|
const STYLES_FLEX = css`
|
|
|
|
display: flex;
|
|
|
|
width: 100%;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
flex-direction: column;
|
2020-08-10 13:18:43 +03:00
|
|
|
height: 100vh;
|
2020-08-02 10:29:24 +03:00
|
|
|
background-color: ${Constants.system.pitchBlack};
|
2020-04-09 00:29:13 +03:00
|
|
|
`;
|
|
|
|
|
|
|
|
const STYLES_TOP = css`
|
|
|
|
background: ${Constants.system.pitchBlack};
|
2020-06-09 21:00:36 +03:00
|
|
|
border-bottom: 1px solid ${Constants.system.black};
|
2020-04-09 00:29:13 +03:00
|
|
|
color: ${Constants.system.white};
|
|
|
|
width: 100%;
|
2020-08-02 10:29:24 +03:00
|
|
|
padding: 12px 16px 12px 16px;
|
2020-04-09 00:29:13 +03:00
|
|
|
flex-shrink: 0;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const STYLES_LEFT = css`
|
|
|
|
min-width: 10%;
|
|
|
|
width: 100%;
|
2020-08-02 10:29:24 +03:00
|
|
|
padding-right: 16px;
|
2020-04-09 00:29:13 +03:00
|
|
|
`;
|
|
|
|
|
|
|
|
const STYLES_RIGHT = css`
|
|
|
|
flex-shrink: 0;
|
|
|
|
cursor: pointer;
|
|
|
|
height: 100%;
|
2020-08-02 10:29:24 +03:00
|
|
|
padding-top: 4px;
|
2020-04-09 00:29:13 +03:00
|
|
|
transition: 200ms ease color;
|
2020-08-02 10:29:24 +03:00
|
|
|
user-select: none;
|
2020-04-09 00:29:13 +03:00
|
|
|
|
|
|
|
:hover {
|
|
|
|
color: ${Constants.system.brand};
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const STYLES_BOTTOM = css`
|
|
|
|
background: ${Constants.system.pitchBlack};
|
|
|
|
color: ${Constants.system.white};
|
|
|
|
padding: 12px 16px 12px 48px;
|
|
|
|
width: 100%;
|
|
|
|
flex-shrink: 0;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const STYLES_PATH = css`
|
2020-07-09 06:19:08 +03:00
|
|
|
font-family: "mono";
|
2020-04-09 00:29:13 +03:00
|
|
|
color: ${Constants.system.white};
|
|
|
|
font-size: 12px;
|
|
|
|
text-transform: uppercase;
|
|
|
|
overflow-wrap: break-word;
|
2020-08-02 10:29:24 +03:00
|
|
|
user-select: none;
|
2020-04-09 00:29:13 +03:00
|
|
|
`;
|
|
|
|
|
|
|
|
export default class SceneFile extends React.Component {
|
|
|
|
render() {
|
2020-08-02 09:00:04 +03:00
|
|
|
const fileURL = this.props.data.url ? this.props.data.url : `https://hub.textile.io${this.props.data.ipfs}`;
|
2020-04-09 00:29:13 +03:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div css={STYLES_FLEX}>
|
|
|
|
<div css={STYLES_TOP}>
|
|
|
|
<div css={STYLES_LEFT}>
|
2020-08-02 10:29:24 +03:00
|
|
|
<a css={STYLES_PATH} href={fileURL} target="_blank">
|
|
|
|
{fileURL}
|
|
|
|
</a>
|
2020-04-09 00:29:13 +03:00
|
|
|
</div>
|
|
|
|
<div css={STYLES_RIGHT} onClick={() => this.props.onBack()}>
|
|
|
|
<SVG.Dismiss height="24px" />
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-08-02 09:00:04 +03:00
|
|
|
<MediaObject data={this.props.data} />
|
2020-04-09 00:29:13 +03:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|