Merge pull request #1363 from ethereum/react-warning

Fix react warning in settings tab
bunsenstraat-patch-2
David Disu 3 years ago committed by GitHub
commit 15234d211a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 70
      libs/remix-ui/settings/src/lib/remix-ui-settings.tsx

@ -71,39 +71,47 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
} }
} }
const generalConfig = () => ( const generalConfig = () => {
<div className="$border-top"> const isMetadataChecked = props.config.get('settings/generate-contract-metadata') || false
<div className="card-body pt-3 pb-2"> const isEthereumVMChecked = props.config.get('settings/always-use-vm') || false
<h6 className="card-title">General settings</h6> const isEditorWrapChecked = props.config.get('settings/text-wrap') || false
<div className="mt-2 custom-control custom-checkbox mb-1"> const isPersonalChecked = props.config.get('settings/personal-mode') || false
<input onChange={onchangeGenerateContractMetadata} id="generatecontractmetadata" data-id="settingsTabGenerateContractMetadata" type="checkbox" className="custom-control-input" name="contractMetadata" checked = { props.config.get('settings/generate-contract-metadata') }/> const isMatomoChecked = props.config.get('settings/matomo-analytics') || false
<label className={`form-check-label custom-control-label align-middle ${getTextClass('settings/generate-contract-metadata')}`} data-id="settingsTabGenerateContractMetadataLabel" htmlFor="generatecontractmetadata">{generateContractMetadataText}</label>
</div> return (
<div className="fmt-2 custom-control custom-checkbox mb-1"> <div className="$border-top">
<input onChange={onchangeOption} className="custom-control-input" id="alwaysUseVM" data-id="settingsTabAlwaysUseVM" type="checkbox" name="ethereumVM" checked={ props.config.get('settings/always-use-vm') }/> <div className="card-body pt-3 pb-2">
<label className={`form-check-label custom-control-label align-middle ${getTextClass('settings/always-use-vm')}`} htmlFor="alwaysUseVM">{ethereunVMText}</label> <h6 className="card-title">General settings</h6>
</div> <div className="mt-2 custom-control custom-checkbox mb-1">
<div className="mt-2 custom-control custom-checkbox mb-1"> <input onChange={onchangeGenerateContractMetadata} id="generatecontractmetadata" data-id="settingsTabGenerateContractMetadata" type="checkbox" className="custom-control-input" name="contractMetadata" checked = { isMetadataChecked }/>
<input id="editorWrap" className="custom-control-input" type="checkbox" onChange={textWrapEvent} checked = { props.config.get('settings/text-wrap')}/> <label className={`form-check-label custom-control-label align-middle ${getTextClass('settings/generate-contract-metadata')}`} data-id="settingsTabGenerateContractMetadataLabel" htmlFor="generatecontractmetadata">{generateContractMetadataText}</label>
<label className={`form-check-label custom-control-label align-middle ${getTextClass('settings/text-wrap')}`} htmlFor="editorWrap">{wordWrapText}</label> </div>
</div> <div className="fmt-2 custom-control custom-checkbox mb-1">
<div className="custom-control custom-checkbox mb-1"> <input onChange={onchangeOption} className="custom-control-input" id="alwaysUseVM" data-id="settingsTabAlwaysUseVM" type="checkbox" name="ethereumVM" checked={ isEthereumVMChecked }/>
<input onChange={onchangePersonal} id="personal" type="checkbox" className="custom-control-input" checked = { props.config.get('settings/personal-mode')}/> <label className={`form-check-label custom-control-label align-middle ${getTextClass('settings/always-use-vm')}`} htmlFor="alwaysUseVM">{ethereunVMText}</label>
<label className={`form-check-label custom-control-label align-middle ${getTextClass('settings/personal-mode')}`} htmlFor="personal"> </div>
<i className="fas fa-exclamation-triangle text-warning" aria-hidden="true"></i> <span> </span> <div className="mt-2 custom-control custom-checkbox mb-1">
<span> </span>{enablePersonalModeText} {warnText} <input id="editorWrap" className="custom-control-input" type="checkbox" onChange={textWrapEvent} checked = { isEditorWrapChecked }/>
</label> <label className={`form-check-label custom-control-label align-middle ${getTextClass('settings/text-wrap')}`} htmlFor="editorWrap">{wordWrapText}</label>
</div> </div>
<div className="custom-control custom-checkbox mb-1"> <div className="custom-control custom-checkbox mb-1">
<input onChange={onchangeMatomoAnalytics} id="settingsMatomoAnalytics" type="checkbox" className="custom-control-input" checked={ props.config.get('settings/matomo-analytics')}/> <input onChange={onchangePersonal} id="personal" type="checkbox" className="custom-control-input" checked = { isPersonalChecked }/>
<label className={`form-check-label custom-control-label align-middle ${getTextClass('settings/matomo-analytics')}`} htmlFor="settingsMatomoAnalytics"> <label className={`form-check-label custom-control-label align-middle ${getTextClass('settings/personal-mode')}`} htmlFor="personal">
<span>{matomoAnalytics}</span> <i className="fas fa-exclamation-triangle text-warning" aria-hidden="true"></i> <span> </span>
<a href="https://medium.com/p/66ef69e14931/" target="_blank"> Analytics in Remix IDE</a> <span>&</span> <a target="_blank" href="https://matomo.org/free-software">Matomo</a> <span> </span>{enablePersonalModeText} {warnText}
</label> </label>
</div>
<div className="custom-control custom-checkbox mb-1">
<input onChange={onchangeMatomoAnalytics} id="settingsMatomoAnalytics" type="checkbox" className="custom-control-input" checked={ isMatomoChecked }/>
<label className={`form-check-label custom-control-label align-middle ${getTextClass('settings/matomo-analytics')}`} htmlFor="settingsMatomoAnalytics">
<span>{matomoAnalytics}</span>
<a href="https://medium.com/p/66ef69e14931/" target="_blank"> Analytics in Remix IDE</a> <span>&</span> <a target="_blank" href="https://matomo.org/free-software">Matomo</a>
</label>
</div>
</div> </div>
</div> </div>
</div> )
) }
const saveToken = () => { const saveToken = () => {
saveTokenToast(props.config, dispatchToast, tokenValue) saveTokenToast(props.config, dispatchToast, tokenValue)

Loading…
Cancel
Save