import React, {PureComponent} from 'react'; import autobind from 'autobind-decorator'; import * as electron from 'electron'; import {createPlugin, getPlugins} from '../../../plugins/index'; import Button from '../base/button'; import CopyButton from '../base/copy-button'; import {showPrompt} from '../modals/index'; import {trackEvent} from '../../../analytics/index'; @autobind class Plugins extends PureComponent { constructor (props) { super(props); this.state = { plugins: getPlugins(true) }; } _handleOpenDirectory (directory) { electron.remote.shell.showItemInFolder(directory); } _handleGeneratePlugin () { showPrompt({ headerName: 'Plugin Name', defaultValue: 'My Plugin', submitName: 'Generate Plugin', selectText: true, placeholder: 'My Cool Plugin', label: 'Plugin Name', onComplete: async name => { await createPlugin(name); this._handleRefreshPlugins(); trackEvent('Plugins', 'Generate'); } }); } _handleRefreshPlugins () { this.setState({plugins: getPlugins(true)}); trackEvent('Plugins', 'Refresh'); } render () { const {plugins} = this.state; return (

Plugins are experimental and compatibility may break in future releases

{plugins.map(plugin => ( ))}
Name Version Folder
{plugin.name} {plugin.version} Copy Path {' '}

{' '}

); } } Plugins.propTypes = {}; export default Plugins;