diff --git a/src/components/HomeNetwork/HomeNetwork.js b/src/components/HomeNetwork/HomeNetwork.js index 831471ab..7ce3ea76 100644 --- a/src/components/HomeNetwork/HomeNetwork.js +++ b/src/components/HomeNetwork/HomeNetwork.js @@ -1,65 +1,62 @@ -import React, { Component } from "react"; +import React, { useState } from "react"; +import PropTypes from "prop-types"; import CountUp from "react-countup"; import VisibilitySensor from "react-visibility-sensor"; import Fade from "react-reveal/Fade"; +import useStats, { AVAILABLE_STATS } from "./useStats"; import "./HomeNetwork.scss"; import { CircleIcon, FAQ } from "../"; import { SmallOrb, LogoSolid, Deco6, Deco7, Deco8 } from "../../svg"; -const stats = [ - { name: "TB Used", value: 664 }, - { name: "TB Capacity", value: 2315 }, - { name: "Hosts", value: 335 }, - { name: "Storage/TB", value: 91, cent: true }, - { name: "Bandwidth/TB", value: 18, cent: true } +const STATS_MAP = [ + { name: "TB Used", key: AVAILABLE_STATS.STORAGE_USED_TB }, + { name: "TB Capacity", key: AVAILABLE_STATS.NETWORK_CAPACITY_TB }, + { name: "Hosts", key: AVAILABLE_STATS.ONLINE_HOSTS_COUNT }, + { name: "Storage/TB", key: AVAILABLE_STATS.STORAGE_COST_USD, currency: true }, + { name: "Bandwidth/TB", key: AVAILABLE_STATS.BANDWIDTH_DOWN_COST_USD, currency: true } ]; -export default class HomeNetwork extends Component { - state = { - visable: false - }; - - onChange = isVisible => { - if (isVisible && !this.state.visable) { - this.setState({ visable: true }); +export default function HomeNetwork() { + const [visible, setVisible] = useState(false); + const stats = useStats(); + const onChange = isVisible => { + if (isVisible && !visible) { + setVisible(true); } }; - render() { - return ( -
- Skynet Webportals are low cost servers that sit between Skynet and everyday users, - enabling them to access Skynet content without needing to operate any special software. As Skylinks are - generated, they can be shared with anyone to retrieve data from any Webportal. The original uploader - does not need to stay online in order for the file to remain available. The Sia network serves as the - backend storage layer for Skynet and handles all of the pinning, guaranteeing both high speeds and - excellent uptime. -
-+ Skynet Webportals are low cost servers that sit between Skynet and everyday users, + enabling them to access Skynet content without needing to operate any special software. As Skylinks are + generated, they can be shared with anyone to retrieve data from any Webportal. The original uploader does + not need to stay online in order for the file to remain available. The Sia network serves as the backend + storage layer for Skynet and handles all of the pinning, guaranteeing both high speeds and excellent + uptime. +
+- Sia is the leading decentralized cloud storage platform. No signups, no servers, no - trusted third parties. Sia leverages blockchain technology to create a data storage marketplace that is - more robust and more affordable than traditional cloud storage providers. -
++ Sia is the leading decentralized cloud storage platform. No signups, no servers, no + trusted third parties. Sia leverages blockchain technology to create a data storage marketplace that is + more robust and more affordable than traditional cloud storage providers. +
+ +- - Learn more about Sia + Anyone can access files that have been uploaded to Skynet as long as they possess the corresponding + Skylinks. You can use any Webportal to download files! + + read more
-- Anyone can access files that have been uploaded to Skynet as long as they possess the corresponding - Skylinks. You can use any Webportal to download files! - - read more - -
-- Applications can be deployed in under a minute and be immediately available globally. Skynet includes - an API and SDKs which integrate seamlessly with existing applications. - - read more - -
-+ Applications can be deployed in under a minute and be immediately available globally. Skynet includes an + API and SDKs which integrate seamlessly with existing applications. + + read more + +
+- Skynet's speeds rival centralized providers and surpass all decentralized offerings. A typical Skynet - download starts in under 500 ms and can stream at rates as high as 1 Gbps! - - read more - -
-+ Skynet's speeds rival centralized providers and surpass all decentralized offerings. A typical Skynet + download starts in under 500 ms and can stream at rates as high as 1 Gbps! + + read more + +
+- Storage costs 10x lower than centralized providers and bandwidth costs are 100x lower – without - sacrificing performance or reliability. -
-+ Storage costs 10x lower than centralized providers and bandwidth costs are 100x lower – without + sacrificing performance or reliability. +
+