import React, { useState, PropsWithChildren } from 'react'; import { useSelector } from 'react-redux'; import Typography from '@material-ui/core/Typography'; import { makeStyles } from '@material-ui/core/styles'; import LinearProgress from '@material-ui/core/LinearProgress'; import Button from '@material-ui/core/Button'; import { State as StoreState, BootstrapState } from '../../store/reducer'; import Header from './Header'; import Footer from './Footer'; type Props = {}; export default function Layout(props: PropsWithChildren) { const { isAppReady } = useSelector((state: StoreState) => { return { isAppReady: state.common.isWalletConnected && state.common.bootstrapState === BootstrapState.Bootstrapped, }; }); const [refresh, setRefresh] = useState(false); return (
{window.localStorage.getItem('consent') ? ( !isAppReady ? ( ) : (
{props.children}
) ) : ( { window.localStorage.setItem('consent', 'true'); setRefresh(!refresh); }} /> )}
); } function RiskBar() { return (
Stake is unaudited software. Use at your own risk.
); } const useStyles = makeStyles(theme => ({ root: { width: '100%', '& > * + *': { marginTop: theme.spacing(2), }, }, })); function RiskDisclosureForm({ onConsent }: { onConsent: () => void }) { return (
No statement or warranty is provided in relation to the utility of this program, the safety of its code or its suitability for your use, and by using it, you agree to bear any risk associated with such potential vulnerabilities, including, but not limited to the potential loss of tokens.
); } function DisconnectedSplash() { const classes = useStyles(); const { network, isDisconnected } = useSelector((state: StoreState) => { return { network: state.common.network, isDisconnected: !state.common.isWalletConnected, }; }); return (
{isDisconnected ? (
Disconnected
) : (
{`Connecting to ${network.label}...`}
)}
); }