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; width: 100%; overflow-wrap: break-word; white-space: pre-wrap; max-width: 768px; `; const STYLES_SUBGROUP = css` padding-left: 24px; width: 100%; overflow-wrap: break-word; white-space: pre-wrap; `; const STYLES_LEFT = css` padding: 12px 0 0 0; min-width: 10%; overflow-wrap: break-word; white-space: pre-wrap; `; const STYLES_RIGHT = css` padding-left: 48px; padding-top: 24px; flex-shrink: 0; `; export default class SceneSettings extends React.Component { state = { ...this.props.viewer }; _deferredSave = null; _handleSave = async () => { this.setState({ loading: true }); await Actions.updateViewer({ type: "SET_DEFAULT_STORAGE_CONFIG", data: { settings_deals_auto_approve: this.state.settings_deals_auto_approve, }, config: { hot: { enabled: this.state.settings_hot_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, }, }, }, }, }); await this.props.onRehydrate(); this.setState({ loading: false }); }; _handleChange = (e) => { this.setState({ [e.target.name]: e.target.value }); }; render() { return ( Filecoin settings Storage defaults
Save
{this.state.settings_cold_enabled ? (
Enable auto renew for Filecoin Network deals.
) : null}
Save
{this.state.settings_hot_enabled ? (
IPFS allow unfreeze setting description.
) : null}
Save
); } }