Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 1 addition & 8 deletions client/modules/IDE/components/IDEOverlays.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ export default function IDEOverlays() {
preferencesIsVisible,
keyboardShortcutVisible,
shareModalVisible,
shareModalProjectId,
shareModalProjectName,
shareModalProjectUsername,
errorType,
previousPath
} = useSelector((state) => state.ide);
Expand Down Expand Up @@ -87,11 +84,7 @@ export default function IDEOverlays() {
ariaLabel={t('IDEView.ShareARIA')}
closeOverlay={() => dispatch(closeShareModal())}
>
<ShareModal
projectId={shareModalProjectId}
projectName={shareModalProjectName}
ownerUsername={shareModalProjectUsername}
/>
<ShareModal />
</Overlay>
)}
{keyboardShortcutVisible && (
Expand Down
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;