Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions client/modules/IDE/components/ShareModal.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import PropTypes from 'prop-types';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
import CopyableInput from './CopyableInput';
// import getConfig from '../../../utils/getConfig';

const ShareModal = ({ projectId, ownerUsername, projectName }) => {
const ShareModal = () => {
const { t } = useTranslation();

// TODO: store these as nested properties instead of top-level
const projectId = useSelector((state) => state.ide.shareModalProjectId);
const projectName = useSelector((state) => state.ide.shareModalProjectName);
const ownerUsername = useSelector(
(state) => state.ide.shareModalProjectUsername
);

const hostname = window.location.origin;
// const previewUrl = getConfig('PREVIEW_URL');
return (
Expand Down Expand Up @@ -35,10 +43,4 @@ const ShareModal = ({ projectId, ownerUsername, projectName }) => {
);
};

ShareModal.propTypes = {
projectId: PropTypes.string.isRequired,
ownerUsername: PropTypes.string.isRequired,
projectName: PropTypes.string.isRequired
};

export default ShareModal;
9 changes: 1 addition & 8 deletions client/modules/IDE/pages/IDEView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -409,11 +409,7 @@ class IDEView extends React.Component {
ariaLabel={this.props.t('IDEView.ShareARIA')}
closeOverlay={this.props.closeShareModal}
>
<ShareModal
projectId={this.props.ide.shareModalProjectId}
projectName={this.props.ide.shareModalProjectName}
ownerUsername={this.props.ide.shareModalProjectUsername}
/>
<ShareModal />
</Overlay>
)}
{this.props.ide.keyboardShortcutVisible && (
Expand Down Expand Up @@ -462,9 +458,6 @@ IDEView.propTypes = {
errorType: PropTypes.string,
keyboardShortcutVisible: PropTypes.bool.isRequired,
shareModalVisible: PropTypes.bool.isRequired,
shareModalProjectId: PropTypes.string.isRequired,
shareModalProjectName: PropTypes.string.isRequired,
shareModalProjectUsername: PropTypes.string.isRequired,
previousPath: PropTypes.string.isRequired,
previewIsRefreshing: PropTypes.bool.isRequired,
isPlaying: PropTypes.bool.isRequired,
Expand Down