mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 14:45:35 +00:00
More refactoring and porting to React
This commit is contained in:
@@ -2,12 +2,12 @@ import React from 'react';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import InterfaceEvents from '../utils/InterfaceEvents';
|
||||
|
||||
export default class DeleteAllModal extends TranslatedComponent {
|
||||
export default class ModalExport extends TranslatedComponent {
|
||||
|
||||
static propTypes = {
|
||||
title: React.propTypes.string,
|
||||
promise: : React.propTypes.func,
|
||||
data: React.propTypes.oneOfType[React.propTypes.string, React.propTypes.object]
|
||||
title: React.PropTypes.string,
|
||||
promise: React.PropTypes.func,
|
||||
data: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.object])
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
@@ -19,7 +19,7 @@ export default class DeleteAllModal extends TranslatedComponent {
|
||||
} else if(typeof props.data == 'string') {
|
||||
exportJson = props.data;
|
||||
} else {
|
||||
exportJson = JSON.stringify(this.props.data);
|
||||
exportJson = JSON.stringify(this.props.data, null, 2);
|
||||
}
|
||||
|
||||
this.state = { exportJson };
|
||||
@@ -41,7 +41,7 @@ export default class DeleteAllModal extends TranslatedComponent {
|
||||
<h2>{translate(this.props.title || 'Export')}</h2>
|
||||
{description}
|
||||
<div>
|
||||
<textarea className='cb json' onFocus={ (e) => e.target.select() }>{this.state.exportJson}</textarea>
|
||||
<textarea className='cb json' onFocus={ (e) => e.target.select() } readOnly value={this.state.exportJson} />
|
||||
</div>
|
||||
<button className={'r dismiss cap'} onClick={InterfaceEvents.hideModal}>{translate('close')}</button>
|
||||
</div>;
|
||||
|
||||
Reference in New Issue
Block a user