import * as React from 'react'; import * as Actions from '~/common/actions'; import * as System from '~/components/system'; import { css } from '@emotion/react'; import ScenePage from '~/components/core/ScenePage'; const STYLES_GROUP = css` display: flex; align-items: center; justify-content: space-between; `; const STYLES_SUBGROUP = css` padding-left: 24px; `; const STYLES_LEFT = css` flex-shrink: 0; padding: 12px 0 0 0; min-width: 480px; `; const STYLES_RIGHT = css` min-width: 10%; padding-left: 48px; padding-top: 24px; width: 100%; `; export default class SceneSettings extends React.Component { state = { ...this.props.viewer }; _deferredSave = null; _handleSave = async () => { await Actions.setDefaultConfig({ config: { hot: { enabled: this.state.settings_cold_enabled, allowUnfreeze: this.state.settings_hot_allow_unfreeze, ipfs: { addTimeout: this.state.settings_hot_ipfs_add_timeout, }, }, cold: { enabled: this.state.settings_cold_enabled, filecoin: { addr: this.state.settings_cold_default_address, dealMinDuration: this.state.settings_cold_default_duration, repFactor: this.state.settings_cold_default_replication_factor, excludedMinersList: this.state.settings_cold_default_excluded_miners, trustedMinersList: this.state.settings_cold_default_trusted_miners, maxPrice: this.state.settings_cold_default_max_price, renew: { enabled: this.state.settings_cold_default_auto_renew, threshold: this.state.settings_cold_default_auto_renew_max_price, }, }, }, }, }); }; _handleChange = (e) => { this.setState({ [e.target.name]: e.target.value }); }; render() { let addresses = {}; this.state.addresses.forEach((a) => { addresses[a.address] = a; }); const currentAddress = addresses[this.state.settings_cold_default_address]; return ( Settings Storage defaults
{this.state.settings_cold_enabled ? (
{currentAddress ? currentAddress.name : 'None'} Enable auto renew for Filecoin Network deals.
Save
) : null}
{this.state.settings_hot_enabled ? (
IPFS allow unfreeze setting description.
Save
) : null}
); } }