2018-02-07 19:06:07 +01:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React from 'react';
|
2017-10-30 19:38:41 +01:00
|
|
|
import CopyableInput from './CopyableInput';
|
2017-02-22 20:29:35 +01:00
|
|
|
|
2017-10-30 19:38:41 +01:00
|
|
|
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"
|
2017-07-11 17:37:43 +02:00
|
|
|
value={`<iframe src="${hostname}/embed/${projectId}"></iframe>`}
|
|
|
|
/>
|
2017-10-30 19:38:41 +01:00
|
|
|
<CopyableInput
|
|
|
|
label="Fullscreen"
|
2017-07-11 17:37:43 +02:00
|
|
|
value={`${hostname}/full/${projectId}`}
|
|
|
|
/>
|
2017-10-30 19:38:41 +01:00
|
|
|
<CopyableInput
|
|
|
|
label="Edit"
|
2017-07-11 17:37:43 +02:00
|
|
|
value={`${hostname}/${ownerUsername}/sketches/${projectId}`}
|
|
|
|
/>
|
|
|
|
</div>
|
2017-10-30 19:38:41 +01:00
|
|
|
);
|
|
|
|
}
|
2016-09-07 04:37:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ShareModal.propTypes = {
|
|
|
|
projectId: PropTypes.string.isRequired,
|
2017-10-30 19:38:41 +01:00
|
|
|
ownerUsername: PropTypes.string.isRequired,
|
|
|
|
projectName: PropTypes.string.isRequired
|
2016-09-07 04:37:29 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default ShareModal;
|