Browse Source

Cleaning up jsx

all-modes^2
Miika Turunen 7 years ago
parent
commit
9f7a0aecf2
  1. 124
      react/src/components/dashboard/settings/settings.addNodePanel.js
  2. 106
      react/src/components/dashboard/settings/settings.appInfoPanel.js
  3. 42
      react/src/components/dashboard/settings/settings.appSettingsPanel.js
  4. 2
      react/src/components/dashboard/settings/settings.appUpdatePanel.js
  5. 5
      react/src/components/dashboard/settings/settings.cliPanel.js
  6. 130
      react/src/components/dashboard/settings/settings.debugLogPanel.js
  7. 92
      react/src/components/dashboard/settings/settings.exportKeysPanel.js
  8. 6
      react/src/components/dashboard/settings/settings.fiatCurrencyPanel.js
  9. 69
      react/src/components/dashboard/settings/settings.importKeysPanel.js
  10. 2
      react/src/components/dashboard/settings/settings.supportPanel.js
  11. 6
      react/src/components/dashboard/settings/settings.walletBackupPanel.js

124
react/src/components/dashboard/settings/settings.addNodePanel.js

@ -96,75 +96,73 @@ class AddNodePanel extends React.Component {
render() {
return (
<div className="panel-body">
<div className="row">
<div className="col-sm-6">
<div className="col-sm-12">
<p>{ translate('INDEX.USE_THIS_SECTION') }</p>
</div>
<div className="col-sm-8 col-xs-12">
<div className="form-group">
<select
className="form-control form-material"
name="getPeersCoin"
onChange={ this.updateInput }>
<option>{ translate('INDEX.SELECT_COIN') }</option>
<AddCoinOptionsCrypto />
<AddCoinOptionsAC />
<AddCoinOptionsACFiat />
</select>
</div>
</div>
<div className="col-sm-4 col-xs-12 text-align-center">
<button
type="button"
className="btn btn-primary waves-effect waves-light"
onClick={ this.checkNodes }>{ translate('INDEX.CHECK_NODES') }</button>
</div>
<div className="col-sm-12">
<h5>
SuperNET Peers:
</h5>
<div>{ this.renderSNPeersList() }</div>
<h5>
Raw Peers:
</h5>
<div>{ this.renderPeersList() }</div>
<div className="row">
<div className="col-sm-6">
<div className="col-sm-12">
<p>{ translate('INDEX.USE_THIS_SECTION') }</p>
</div>
<div className="col-sm-8 col-xs-12">
<div className="form-group">
<select
className="form-control form-material"
name="getPeersCoin"
onChange={ this.updateInput }>
<option>{ translate('INDEX.SELECT_COIN') }</option>
<AddCoinOptionsCrypto />
<AddCoinOptionsAC />
<AddCoinOptionsACFiat />
</select>
</div>
</div>
<div className="col-sm-4 col-xs-12 text-align-center">
<button
type="button"
className="btn btn-primary waves-effect waves-light"
onClick={ this.checkNodes }>{ translate('INDEX.CHECK_NODES') }</button>
</div>
<div className="col-sm-12">
<h5>
SuperNET Peers:
</h5>
<div>{ this.renderSNPeersList() }</div>
<h5>
Raw Peers:
</h5>
<div>{ this.renderPeersList() }</div>
</div>
</div>
<div className="col-sm-6">
<div className="col-sm-12">
<p>{ translate('INDEX.USE_THIS_SECTION_PEER') }</p>
</div>
<div className="col-sm-8 col-xs-12">
<div className="form-group">
<select
className="form-control form-material"
name="addNodeCoin"
onChange={ this.updateInput }>
<option>{ translate('INDEX.SELECT_COIN') }</option>
<AddCoinOptionsCrypto />
<AddCoinOptionsAC />
<AddCoinOptionsACFiat />
</select>
</div>
<div className="form-group">
<input
type="text"
className="form-control"
name="addPeerIP"
placeholder={ translate('SETTINGS.ADD_PEER_IP') }
onChange={ this.updateInput } />
</div>
<div className="col-sm-6">
<div className="col-sm-12">
<p>{ translate('INDEX.USE_THIS_SECTION_PEER') }</p>
</div>
<div className="col-sm-8 col-xs-12">
<div className="form-group">
<select
className="form-control form-material"
name="addNodeCoin"
onChange={ this.updateInput }>
<option>{ translate('INDEX.SELECT_COIN') }</option>
<AddCoinOptionsCrypto />
<AddCoinOptionsAC />
<AddCoinOptionsACFiat />
</select>
</div>
<div className="col-sm-4 col-xs-12 text-align-center">
<button
type="button"
className="btn btn-primary waves-effect waves-light"
onClick={ this.addNode }>{ translate('INDEX.ADD_NODE') }</button>
<div className="form-group">
<input
type="text"
className="form-control"
name="addPeerIP"
placeholder={ translate('SETTINGS.ADD_PEER_IP') }
onChange={ this.updateInput } />
</div>
</div>
<div className="col-sm-4 col-xs-12 text-align-center">
<button
type="button"
className="btn btn-primary waves-effect waves-light"
onClick={ this.addNode }>{ translate('INDEX.ADD_NODE') }</button>
</div>
</div>
</div>
);

106
react/src/components/dashboard/settings/settings.appInfoPanel.js

@ -14,72 +14,48 @@ class AppInfoPanel extends React.Component {
return null
} else {
return (
<div className="panel-body">
<div className="row">
<div className="col-sm-12 padding-top-15">
<div className="row">
<h5>{ translate('SETTINGS.APP_RELEASE') }</h5>
<div>
{ translate('SETTINGS.NAME') }: { this.props.Settings.appInfo.releaseInfo.name }
</div>
<div>
{ translate('SETTINGS.VERSION') }: { `${this.props.Settings.appInfo.releaseInfo.version.replace('version=', '')}-beta` }
</div>
<div>
{ translate('SETTINGS.APP_SESSION') }: { this.props.Settings.appInfo.appSession }
</div>
</div>
</div>
<div className="col-sm-12 padding-top-20">
<div className="row">
<h5>{ translate('SETTINGS.SYS_INFO') }</h5>
<div>
{ translate('SETTINGS.ARCH') }: { this.props.Settings.appInfo.sysInfo.arch }
</div>
<div>
{ translate('SETTINGS.OS_TYPE') }: { this.props.Settings.appInfo.sysInfo.os_type }
</div>
<div>
{ translate('SETTINGS.OS_PLATFORM') }: { this.props.Settings.appInfo.sysInfo.platform }
</div>
<div>
{ translate('SETTINGS.OS_RELEASE') }: { this.props.Settings.appInfo.sysInfo.os_release }
</div>
<div>
{ translate('SETTINGS.CPU') }: { this.props.Settings.appInfo.sysInfo.cpu }
</div>
<div>
{ translate('SETTINGS.CPU_CORES') }: { this.props.Settings.appInfo.sysInfo.cpu_cores }
</div>
<div>
{ translate('SETTINGS.MEM') }: { this.props.Settings.appInfo.sysInfo.totalmem_readable }
</div>
</div>
</div>
<div className="col-sm-12 padding-top-20">
<div className="row">
<h5>{ translate('SETTINGS.LOCATIONS') }</h5>
<div>
{ translate('SETTINGS.CACHE') }: { this.props.Settings.appInfo.dirs.cacheLocation }
</div>
<div>
{ translate('SETTINGS.CONFIG') }: { this.props.Settings.appInfo.dirs.configLocation }
</div>
<div>
Iguana { translate('SETTINGS.BIN') }: { this.props.Settings.appInfo.dirs.iguanaBin }
</div>
<div>
Iguana { translate('SETTINGS.DIR') }: { this.props.Settings.appInfo.dirs.iguanaDir }
</div>
<div>
Komodo { translate('SETTINGS.BIN') }: { this.props.Settings.appInfo.dirs.komododBin }
</div>
<div>
Komodo { translate('SETTINGS.DIR') }: { this.props.Settings.appInfo.dirs.komodoDir }
</div>
<div>
Komodo wallet.dat: { this.props.Settings.appInfo.dirs.komodoDir }
</div>
</div>
<h5>{ translate('SETTINGS.APP_RELEASE') }</h5>
<p>
{ translate('SETTINGS.NAME') }: { this.props.Settings.appInfo.releaseInfo.name }
<br />
{ translate('SETTINGS.VERSION') }: { `${this.props.Settings.appInfo.releaseInfo.version.replace('version=', '')}-beta` }
<br />
{ translate('SETTINGS.APP_SESSION') }: { this.props.Settings.appInfo.appSession }
</p>
<h5>{ translate('SETTINGS.SYS_INFO') }</h5>
<p>
{ translate('SETTINGS.ARCH') }: { this.props.Settings.appInfo.sysInfo.arch }
<br />
{ translate('SETTINGS.OS_TYPE') }: { this.props.Settings.appInfo.sysInfo.os_type }
<br />
{ translate('SETTINGS.OS_PLATFORM') }: { this.props.Settings.appInfo.sysInfo.platform }
<br />
{ translate('SETTINGS.OS_RELEASE') }: { this.props.Settings.appInfo.sysInfo.os_release }
<br />
{ translate('SETTINGS.CPU') }: { this.props.Settings.appInfo.sysInfo.cpu }
<br />
{ translate('SETTINGS.CPU_CORES') }: { this.props.Settings.appInfo.sysInfo.cpu_cores }
<br />
{ translate('SETTINGS.MEM') }: { this.props.Settings.appInfo.sysInfo.totalmem_readable }
</p>
<h5>{ translate('SETTINGS.LOCATIONS') }</h5>
<p>
{ translate('SETTINGS.CACHE') }: { this.props.Settings.appInfo.dirs.cacheLocation }
<br />
{ translate('SETTINGS.CONFIG') }: { this.props.Settings.appInfo.dirs.configLocation }
<br />
Iguana { translate('SETTINGS.BIN') }: { this.props.Settings.appInfo.dirs.iguanaBin }
<br />
Iguana { translate('SETTINGS.DIR') }: { this.props.Settings.appInfo.dirs.iguanaDir }
<br />
Komodo { translate('SETTINGS.BIN') }: { this.props.Settings.appInfo.dirs.komododBin }
<br />
Komodo { translate('SETTINGS.DIR') }: { this.props.Settings.appInfo.dirs.komodoDir }
<br />
Komodo wallet.dat: { this.props.Settings.appInfo.dirs.komodoDir }
</p>
</div>
</div>
);

42
react/src/components/dashboard/settings/settings.appSettingsPanel.js

@ -283,26 +283,30 @@ class AppSettingsPanel extends React.Component {
render() {
return (
<div className="panel-body">
<p>
<strong>{ translate('SETTINGS.CONFIG_RESTART_REQUIRED') }</strong>
</p>
<div className="col-sm-12 padding-top-15">
<table>
<tbody>
{ this.renderConfigEditForm() }
</tbody>
</table>
<div>
<div className="row">
<div className="col-sm-12 padding-top-15">
<p>
<strong>{ translate('SETTINGS.CONFIG_RESTART_REQUIRED') }</strong>
</p>
<table>
<tbody>
{ this.renderConfigEditForm() }
</tbody>
</table>
</div>
</div>
<div className="col-sm-12 col-xs-12 text-align-center padding-top-35 padding-bottom-30">
<button
type="button"
className="btn btn-primary waves-effect waves-light"
onClick={ this._saveAppConfig }>{ translate('SETTINGS.SAVE_APP_CONFIG') }</button>
<button
type="button"
className="btn btn-primary waves-effect waves-light margin-left-30"
onClick={ this._resetAppConfig }>Reset to default</button>
<div className="row">
<div className="col-sm-12 col-xs-12 text-align-center padding-top-35 padding-bottom-30">
<button
type="button"
className="btn btn-primary waves-effect waves-light"
onClick={ this._saveAppConfig }>{ translate('SETTINGS.SAVE_APP_CONFIG') }</button>
<button
type="button"
className="btn btn-primary waves-effect waves-light margin-left-30"
onClick={ this._resetAppConfig }>Reset to default</button>
</div>
</div>
</div>
);

2
react/src/components/dashboard/settings/settings.appUpdatePanel.js

@ -107,7 +107,7 @@ class AppUpdatePanel extends React.Component {
render() {
return (
<div className="panel-body">
<div className="row">
<div className="col-sm-4 padding-top-15">
<h5>{ translate('INDEX.UI_UPDATE') }</h5>
<div className="padding-top-15">

5
react/src/components/dashboard/settings/settings.cliPanel.js

@ -143,9 +143,9 @@ class CliPanel extends React.Component {
render() {
return (
<div className="panel-body">
<div className="row">
<div className="col-sm-12">
<p>{ translate('INDEX.CLI_SELECT_A_COIN') }</p>
<div className="col-sm-12"></div>
<form
className="execute-cli-cmd-form"
method="post"
@ -189,6 +189,7 @@ class CliPanel extends React.Component {
</div>
</div>
</form>
</div>
</div>
);
};

130
react/src/components/dashboard/settings/settings.debugLogPanel.js

@ -102,70 +102,74 @@ class DebugLogPanel extends React.Component {
render() {
return (
<div className="panel-body">
<p>{ translate('INDEX.DEBUG_LOG_DESC') }</p>
<div className="margin-top-30">
<span className="pointer toggle">
<label className="switch">
<input
type="checkbox"
name="settings-app-debug-toggle"
value={ this.state.toggleAppRuntimeLog }
checked={ this.state.toggleAppRuntimeLog } />
<div
className="slider"
onClick={ this.toggleAppRuntimeLog }></div>
</label>
<span
className="title"
onClick={ this.toggleAppRuntimeLog }>Show app runtime log</span>
</span>
<div className="row">
<div className="col-sm-12">
<p>{ translate('INDEX.DEBUG_LOG_DESC') }</p>
<div className="margin-top-30">
<span className="pointer toggle">
<label className="switch">
<input
type="checkbox"
name="settings-app-debug-toggle"
value={ this.state.toggleAppRuntimeLog }
checked={ this.state.toggleAppRuntimeLog } />
<div
className="slider"
onClick={ this.toggleAppRuntimeLog }></div>
</label>
<span
className="title"
onClick={ this.toggleAppRuntimeLog }>Show app runtime log</span>
</span>
</div>
{ !this.state.toggleAppRuntimeLog &&
<form
className="read-debug-log-import-form"
method="post"
action="javascript:"
autoComplete="off">
<div className="form-group form-material floating">
<input
type="text"
className="form-control"
name="debugLinesCount"
id="readDebugLogLines"
value={ this.state.debugLinesCount }
onChange={ this.updateInput } />
<label
className="floating-label"
htmlFor="readDebugLogLines">{ translate('INDEX.DEBUG_LOG_LINES') }</label>
</div>
<div className="form-group form-material floating">
<select
className="form-control form-material"
name="debugTarget"
id="settingsDelectDebugLogOptions"
onChange={ this.updateInput }>
<option value="iguana" className={ this.state.nativeOnly ? 'hide' : '' }>Iguana</option>
<option value="komodo">Komodo</option>
</select>
<label
className="floating-label"
htmlFor="settingsDelectDebugLogOptions">{ translate('INDEX.TARGET') }</label>
</div>
<div className="col-sm-12 col-xs-12 text-align-center">
<button
type="button"
className="btn btn-primary waves-effect waves-light"
onClick={ this.readDebugLog }>{ translate('INDEX.LOAD_DEBUG_LOG') }</button>
</div>
<div className="row">
<div className="col-sm-12 col-xs-12 text-align-left">
<div className="padding-top-40 padding-bottom-20 horizontal-padding-0">{ this.renderDebugLogData() }</div>
</div>
</div>
</form>
}
{ this.state.toggleAppRuntimeLog &&
<div className="margin-top-20">{ this.renderAppRuntimeLog() }</div>
}
</div>
{ !this.state.toggleAppRuntimeLog &&
<form
className="read-debug-log-import-form"
method="post"
action="javascript:"
autoComplete="off">
<div className="form-group form-material floating">
<input
type="text"
className="form-control"
name="debugLinesCount"
id="readDebugLogLines"
value={ this.state.debugLinesCount }
onChange={ this.updateInput } />
<label
className="floating-label"
htmlFor="readDebugLogLines">{ translate('INDEX.DEBUG_LOG_LINES') }</label>
</div>
<div className="form-group form-material floating">
<select
className="form-control form-material"
name="debugTarget"
id="settingsDelectDebugLogOptions"
onChange={ this.updateInput }>
<option value="iguana" className={ this.state.nativeOnly ? 'hide' : '' }>Iguana</option>
<option value="komodo">Komodo</option>
</select>
<label
className="floating-label"
htmlFor="settingsDelectDebugLogOptions">{ translate('INDEX.TARGET') }</label>
</div>
<div className="col-sm-12 col-xs-12 text-align-center">
<button
type="button"
className="btn btn-primary waves-effect waves-light"
onClick={ this.readDebugLog }>{ translate('INDEX.LOAD_DEBUG_LOG') }</button>
</div>
<div className="col-sm-12 col-xs-12 text-align-left">
<div className="padding-top-40 padding-bottom-20 horizontal-padding-0">{ this.renderDebugLogData() }</div>
</div>
</form>
}
{ this.state.toggleAppRuntimeLog &&
<div className="margin-top-20">{ this.renderAppRuntimeLog() }</div>
}
</div>
);
};

92
react/src/components/dashboard/settings/settings.exportKeysPanel.js

@ -157,53 +157,57 @@ class ExportKeysPanel extends React.Component {
render() {
return (
<div className="panel-body">
<div>
<div className="padding-bottom-20">{ this.renderLB('INDEX.ONLY_ACTIVE_WIF_KEYS') }</div>
<div className="padding-bottom-20">
<i>{ this.renderLB('SETTINGS.EXPORT_KEYS_NOTE') }</i>
<div>
<div className="row">
<div className="col-sm-12">
<div className="padding-bottom-20">{ this.renderLB('INDEX.ONLY_ACTIVE_WIF_KEYS') }</div>
<div className="padding-bottom-20">
<i>{ this.renderLB('SETTINGS.EXPORT_KEYS_NOTE') }</i>
</div>
<strong>
<i>{ translate('INDEX.PLEASE_KEEP_KEYS_SAFE') }</i>
</strong>
</div>
<strong>
<i>{ translate('INDEX.PLEASE_KEEP_KEYS_SAFE') }</i>
</strong>
</div>
<div className="col-sm-12"></div>
<form
className="wifkeys-form"
method="post"
action="javascript:"
autoComplete="off">
<div className="form-group form-material floating">
<input
type="password"
className={ !this.state.seedInputVisibility ? 'form-control' : 'hide' }
name="wifkeysPassphrase"
id="wifkeysPassphrase"
onChange={ this.updateInput }
value={ this.state.wifkeysPassphrase } />
<textarea
className={ this.state.seedInputVisibility ? 'form-control' : 'hide' }
id="wifkeysPassphraseTextarea"
name="wifkeysPassphrase"
onChange={ this.updateInput }
value={ this.state.wifkeysPassphrase }></textarea>
<i
className={ 'seed-toggle fa fa-eye' + (!this.state.seedInputVisibility ? '-slash' : '') }
onClick={ this.toggleSeedInputVisibility }></i>
<label
className="floating-label"
htmlFor="wifkeysPassphrase">{ translate('INDEX.PASSPHRASE') }</label>
</div>
<div className="col-sm-12 col-xs-12 text-align-center">
<button
type="button"
className="btn btn-primary waves-effect waves-light"
onClick={ this.exportWifKeys }>{ translate('INDEX.GET_WIF_KEYS') }</button>
<div className="row">
<div className="col-sm-12">
<form
className="wifkeys-form"
method="post"
action="javascript:"
autoComplete="off">
<div className="form-group form-material floating">
<input
type="password"
className={ !this.state.seedInputVisibility ? 'form-control' : 'hide' }
name="wifkeysPassphrase"
id="wifkeysPassphrase"
onChange={ this.updateInput }
value={ this.state.wifkeysPassphrase } />
<textarea
className={ this.state.seedInputVisibility ? 'form-control' : 'hide' }
id="wifkeysPassphraseTextarea"
name="wifkeysPassphrase"
onChange={ this.updateInput }
value={ this.state.wifkeysPassphrase }></textarea>
<i
className={ 'seed-toggle fa fa-eye' + (!this.state.seedInputVisibility ? '-slash' : '') }
onClick={ this.toggleSeedInputVisibility }></i>
<label
className="floating-label"
htmlFor="wifkeysPassphrase">{ translate('INDEX.PASSPHRASE') }</label>
</div>
<div className="col-sm-12 col-xs-12 text-align-center">
<button
type="button"
className="btn btn-primary waves-effect waves-light"
onClick={ this.exportWifKeys }>{ translate('INDEX.GET_WIF_KEYS') }</button>
</div>
</form>
</div>
</form>
<div className="col-sm-12 padding-top-15">
<div className="row">
</div>
<div className="row">
<div className="col-sm-12 padding-top-15">
<table className="table">
{ this.renderWifKeys() }
</table>

6
react/src/components/dashboard/settings/settings.fiatCurrencyPanel.js

@ -9,7 +9,11 @@ class FiatCurrencyPanel extends React.Component {
render() {
return (
<div className="panel-body">Fiat currency settings section to be updated soon.</div>
<div className="row">
<div className="col-sm-12">
<p>Fiat currency settings section to be updated soon.</p>
</div>
</div>
);
};
}

69
react/src/components/dashboard/settings/settings.importKeysPanel.js

@ -26,39 +26,46 @@ class ImportKeysPanel extends React.Component {
render() {
return (
<div className="panel-body">
<div>{ translate('INDEX.IMPORT_KEYS_DESC_P1') }</div><br/>
<div>{ translate('INDEX.IMPORT_KEYS_DESC_P2') }</div><br/>
<div>{ translate('INDEX.IMPORT_KEYS_DESC_P3') }</div><br/>
<div>
<strong>
<i>{ translate('INDEX.PLEASE_KEEP_KEYS_SAFE') }</i>
</strong>
</div>
<div className="col-sm-12"></div>
<form
className="wifkeys-import-form"
method="post"
action="javascript:"
autoComplete="off">
<div className="form-group form-material floating">
<input
type="text"
className="form-control"
name="importWifKey"
id="importWifkey"
onChange={ this.updateInput } />
<label
className="floating-label"
htmlFor="importWifkey">{ translate('INDEX.INPUT_PRIV_KEY') }</label>
<div>
<div className="row">
<div className="col-sm-12">
<p>{ translate('INDEX.IMPORT_KEYS_DESC_P1') }</p>
<p>{ translate('INDEX.IMPORT_KEYS_DESC_P2') }</p>
<p>{ translate('INDEX.IMPORT_KEYS_DESC_P3') }</p>
<p>
<strong>
<i>{ translate('INDEX.PLEASE_KEEP_KEYS_SAFE') }</i>
</strong>
</p>
</div>
<div className="col-sm-12 col-xs-12 text-align-center">
<button
type="button"
className="btn btn-primary waves-effect waves-light"
onClick={ this.importWifKey }>{ translate('INDEX.IMPORT_PRIV_KEY') }</button>
</div>
<div className="row">
<div className="col-sm-12">
<form
className="wifkeys-import-form"
method="post"
action="javascript:"
autoComplete="off">
<div className="form-group form-material floating">
<input
type="text"
className="form-control"
name="importWifKey"
id="importWifkey"
onChange={ this.updateInput } />
<label
className="floating-label"
htmlFor="importWifkey">{ translate('INDEX.INPUT_PRIV_KEY') }</label>
</div>
<div className="col-sm-12 col-xs-12 text-align-center">
<button
type="button"
className="btn btn-primary waves-effect waves-light"
onClick={ this.importWifKey }>{ translate('INDEX.IMPORT_PRIV_KEY') }</button>
</div>
</form>
</div>
</form>
</div>
</div>
);
}

2
react/src/components/dashboard/settings/settings.supportPanel.js

@ -27,7 +27,7 @@ class SupportPanel extends React.Component {
render() {
return (
<div className="panel-body">
<div className="row">
<div className="col-sm-12 no-padding-left">
<div className="support-box-wrapper">
<div

6
react/src/components/dashboard/settings/settings.walletBackupPanel.js

@ -9,7 +9,11 @@ class WalletBackupPanel extends React.Component {
render() {
return (
<div className="panel-body">Wallet Backup section to be updated soon.</div>
<div className="row">
<div className="col-sm-12">
<p>Wallet Backup section to be updated soon.</p>
</div>
</div>
);
};
}

Loading…
Cancel
Save