p5.js-web-editor/client/modules/IDE/components/ShareModal.jsx
Basile Pesin 996a1b988a Fixes #692 (#713)
* Got the basis covered, now I need to style all this

* Corrected and upgraded Share window

* Changed the routes again, and set correct design

* Made some of the requested changes

* Removed PreviewFrame errors

* Redesigned Preview Header

* Corrected style of the FullView

* Corrected most of the css mistakes

* Corrected logo size
2018-10-18 14:10:37 -04:00

42 lines
1.1 KiB
JavaScript

import PropTypes from 'prop-types';
import React from 'react';
import CopyableInput from './CopyableInput';
class ShareModal extends React.PureComponent {
render() {
const {
projectId,
ownerUsername,
projectName
} = this.props;
const hostname = window.location.origin;
return (
<div className="share-modal">
<h3 className="share-modal__project-name">
{projectName}
</h3>
<CopyableInput
label="Embed"
value={`<iframe src="${hostname}/${ownerUsername}/embed/${projectId}"></iframe>`}
/>
<CopyableInput
label="Fullscreen"
hasPreviewLink
value={`${hostname}/${ownerUsername}/full/${projectId}`}
/>
<CopyableInput
label="Edit"
value={`${hostname}/${ownerUsername}/sketches/${projectId}`}
/>
</div>
);
}
}
ShareModal.propTypes = {
projectId: PropTypes.string.isRequired,
ownerUsername: PropTypes.string.isRequired,
projectName: PropTypes.string.isRequired
};
export default ShareModal;