import * as React from "react"; import * as System from "~/components/system"; import * as Constants from "~/common/constants"; import * as Actions from "~/common/actions"; import * as Strings from "~/common/strings"; import { css } from "@emotion/react"; import { LoaderSpinner } from "~/components/system/components/Loaders"; import { SecondaryTabGroup } from "~/components/core/TabGroup"; import WebsitePrototypeWrapper from "~/components/core/WebsitePrototypeWrapper"; import ScenePage from "~/components/core/ScenePage"; import ScenePageHeader from "~/components/core/ScenePageHeader"; import SceneSettings from "~/scenes/SceneSettings"; import SceneDeals from "~/scenes/SceneDeals"; import SceneWallet from "~/scenes/SceneWallet"; const STYLES_SPINNER_CONTAINER = css` width: 100%; height: 40vh; display: flex; align-items: center; justify-content: center; `; let mounted = false; export default class SceneArchive extends React.Component { state = { deals: [], dealsLoaded: false, networkViewer: null, allowAutomaticDataStorage: this.props.viewer.allowAutomaticDataStorage, allowEncryptedDataStorage: this.props.viewer.allowEncryptedDataStorage, }; async componentDidMount() { if (mounted) { return null; } mounted = true; let networkViewer; try { const response = await fetch("/api/network"); const json = await response.json(); networkViewer = json.data; } catch (e) {} this.setState({ networkViewer, }); let deals = []; try { const response = await fetch("/api/network-deals"); const json = await response.json(); deals = json.data.deals; } catch (e) {} if (!deals || !deals.length) { this.setState({ dealsLoaded: true }); } this.setState({ deals, dealsLoaded: true }); } _handleCheckboxChange = (e) => { this.setState({ [e.target.name]: e.target.value }); }; _handleSaveFilecoin = async (e) => { this.setState({ changingFilecoin: true }); await Actions.updateViewer({ user: { allowAutomaticDataStorage: this.state.allowAutomaticDataStorage, allowEncryptedDataStorage: this.state.allowEncryptedDataStorage, }, }); this.setState({ changingFilecoin: false }); }; componentWillUnmount() { mounted = false; } render() { let tab = this.props.page.params?.tab || "archive"; return ( {/* Use this section to archive all of your data on to Filecoin through a storage deal. You must have at last 100MB stored to make an archive storage deal. */} {this.state.networkViewer ? ( {tab === "archive" ? ( Use this section to archive all of your data on to Filecoin through a storage deal. You must have at last 100MB stored to make an archive storage deal. Archive all of your data onto the Filecoin Network with a storage deal using your default settings.
this.props.onAction({ type: "SIDEBAR", value: "SIDEBAR_FILECOIN_ARCHIVE", }) } > Archive your data Allow Slate to make archive storage deals on your behalf to the Filecoin Network. You will get a receipt in the Filecoin section. Force encryption on archive storage deals (only you can see retrieved data from the Filecoin network).
Save archiving settings


) : null} {tab === "wallet" ? (

{this.state.dealsLoaded ? ( ) : (
)}
) : null}
) : (
)}
); } }