Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const releases = 'https://github.com/cncjs/cncjs/releases';
const newUpdateAvailableTooltip = () => {
return (
<div>{i18n._('New update available')}</div>
);
};
class Header extends PureComponent {
static propTypes = {
...withRouter.propTypes
};
state = this.getInitialState();
actions = {
requestPushPermission: () => {
const onGranted = () => {
this.setState({ pushPermission: Push.Permission.GRANTED });
};
const onDenied = () => {
this.setState({ pushPermission: Push.Permission.DENIED });
};
// Note that if "Permission.DEFAULT" is returned, no callback is executed
const permission = Push.Permission.request(onGranted, onDenied);
if (permission === Push.Permission.DEFAULT) {
this.setState({ pushPermission: Push.Permission.DEFAULT });
const WAIT = '%wait';
const startWaiting = () => {
// Adds the 'wait' class to
const root = document.documentElement;
root.classList.add('wait');
};
const stopWaiting = () => {
// Adds the 'wait' class to
const root = document.documentElement;
root.classList.remove('wait');
};
class Workspace extends PureComponent {
static propTypes = {
...withRouter.propTypes
};
state = {
mounted: false,
port: '',
modal: {
name: MODAL_NONE,
params: {}
},
isDraggingFile: false,
isDraggingWidget: false,
isUploading: false,
showPrimaryContainer: store.get('workspace.container.primary.show'),
showSecondaryContainer: store.get('workspace.container.secondary.show'),
inactiveCount: _.size(widgetManager.getInactiveWidgets())
};
import Workspace from './Workspace';
import MachineProfiles from './MachineProfiles';
import UserAccounts from './UserAccounts';
import Controller from './Controller';
import Commands from './Commands';
import Events from './Events';
import About from './About';
import styles from './index.styl';
const mapSectionPathToId = (path = '') => {
return _camelCase(path.split('/')[0] || '');
};
class Settings extends PureComponent {
static propTypes = {
...withRouter.propTypes
};
sections = [
{
id: 'general',
path: 'general',
title: i18n._('General'),
component: (props) =>
},
{
id: 'workspace',
path: 'workspace',
title: i18n._('Workspace'),
component: (props) =>
},
{
import React, { PureComponent } from 'react';
import { withRouter, Redirect } from 'react-router-dom';
import Anchor from 'app/components/Anchor';
import { Notification } from 'app/components/Notifications';
import Space from 'app/components/Space';
import settings from 'app/config/settings';
import controller from 'app/lib/controller';
import i18n from 'app/lib/i18n';
import log from 'app/lib/log';
import * as user from 'app/lib/user';
import store from 'app/store';
import styles from './index.styl';
class Login extends PureComponent {
static propTypes = {
...withRouter.propTypes
};
state = this.getDefaultState();
actions = {
showAlertMessage: (msg) => {
this.setState({ alertMessage: msg });
},
clearAlertMessage: () => {
this.setState({ alertMessage: '' });
},
handleSignIn: (event) => {
event.preventDefault();
this.setState({
alertMessage: '',
return (
);
}}
/>
);
ProtectedRoute.propTypes = {
...withRouter.propTypes
};
export default ProtectedRoute;
import React, { PureComponent } from 'react';
import { Redirect, withRouter } from 'react-router-dom';
import { trackPage } from '../lib/analytics';
import Header from './Header';
import Sidebar from './Sidebar';
import Workspace from './Workspace';
import Settings from './Settings';
import styles from './App.styl';
class App extends PureComponent {
static propTypes = {
...withRouter.propTypes
};
render() {
const { location } = this.props;
const accepted = ([
'/workspace',
'/settings',
'/settings/general',
'/settings/workspace',
'/settings/machine-profiles',
'/settings/user-accounts',
'/settings/controller',
'/settings/commands',
'/settings/events',
'/settings/about'
].indexOf(location.pathname) >= 0);
import classNames from 'classnames';
import React, { PureComponent } from 'react';
import { Link, withRouter } from 'react-router-dom';
import i18n from '../../lib/i18n';
import styles from './index.styl';
class Sidebar extends PureComponent {
static propTypes = {
...withRouter.propTypes
};
render() {
const { pathname = '' } = this.props.location;
return (
<nav>
<ul>
<li>
</li></ul></nav>