import * as Constants from 'app/common/constants'; import * as SVG from 'app/common/svg'; import ContentGroup from 'app/components/ContentGroup'; import InputWithButton from 'app/components/InputWithButton'; import NetworkGroupButton from 'app/components/NetworkGroupButton'; import QRCode from 'app/components/QRCode'; import SettingsControl from 'app/components/SettingsControl'; import copyToClipboard from 'copy-to-clipboard'; import * as React from 'react'; import { css } from 'react-emotion'; const STYLES_CONNECTION_SECTION = css` display: flex; align-items: center; justify-content: space-between; `; const STYLES_CONNECTION_SECTION_LEFT = css` min-width: 25%; width: 100%; `; const STYLES_CONNECTION_SECTION_RIGHT = css` flex-shrink: 0; `; const STYLES_URL_SECTION = css` padding: 16px; `; const STYLES_URL_SECTION_BOTTOM = css` font-family: ${Constants.fontFamilies.regular}; font-size: 12px; margin-top: 16px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; `; const STYLES_URL_SECTION_BOTTOM_LEFT = css` flex-shrink: 0; padding-right: 8px; `; const STYLES_URL_SECTION_BOTTOM_RIGHT = css` font-family: ${Constants.fontFamilies.mono}; font-size: 10px; padding-bottom: 3px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; min-width: 25%; width: 100%; `; const STYLES_QR_SECTION = css` padding-top: 16px; `; const STYLES_SUBTITLE = css` font-family: ${Constants.fontFamilies.mono}; color: #555555; font-size: 10px; text-transform: uppercase; margin-bottom: 8px; `; const STYLES_CONTENT_GROUP = css` color: currentColor; text-decoration: none; border-bottom: 1px solid ${Constants.colors.border}; font-family: ${Constants.fontFamilies.demi}; height: 32px; padding: 0 16px 0 16px; display: flex; justify-content: space-between; align-items: center; transition: 200ms ease all; cursor: pointer; :hover { background: ${Constants.colors.primary}; color: ${Constants.colors.white}; } `; const STYLES_CONTENT_GROUP_DISABLED = css` opacity: 0.5; cursor: not-allowed; :hover { background: unset; color: currentColor; } `; const STYLES_CONTENT_GROUP_LEFT = css` min-width: 25%; width: 100%; `; const STYLES_CONTENT_GROUP_RIGHT = css` flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; `; function SidebarOption({ children, onClick, tooltip, isDisabled = false }) { return (
{children}
); } function PlatformSidebarOption({ platform, ...props }) { return ( ); } export default class ProjectManagerSidebarOptions extends React.Component { state = { isSendFormVisible: false, showCopiedMessage: false }; _handleShowPublishView = () => { this.props.onUpdateState({ isPublishing: !this.props.isPublishing, isActiveDeviceIOS: false, isActiveDeviceAndroid: false, }); }; _handleCopyLink = () => { copyToClipboard(this.props.url, {}); this.setState({ showCopiedMessage: true }); setTimeout(() => { this.setState({ showCopiedMessage: false }); }, 2000); }; _handleSendHeaderClick = () => { this.setState(state => ({ isSendFormVisible: !state.isSendFormVisible })); }; render() { const { showCopiedMessage, isSendFormVisible } = this.state; const isDisabled = !this.props.url; const sendHeader = ( Send link with email… ); return (
Run on Android device/emulator Run on iOS simulator Run in web browser Send {this.props.user ? (
Publish or republish project…
) : null}
Production Mode
Connection
{!isDisabled && !this.props.hostTypeLoading ? this.props.url : '-'}
{showCopiedMessage ?

Copied!

: null}
); } }