import * as React from 'react' import { Button } from '../Button/Button' import { Header } from '../Header/Header' import { StarWalletIcon } from '../StarWalletIcon/StarWalletIcon' import './SignIn.css' export type SignInI18N = { header: React.ReactNode message: React.ReactNode connect: React.ReactNode connecting: React.ReactNode connected: React.ReactNode error: React.ReactNode } export type SignInProps = { center?: boolean isConnected?: boolean isConnecting?: boolean hasError?: boolean onConnect?: () => void i18n?: SignInI18N } export class SignIn extends React.PureComponent { static defaultProps: Partial = { center: true, isConnected: false, isConnecting: false, hasError: false, onConnect: () => undefined, i18n: { header: 'Get Started', message: ( You can use the{' '} MetaMask {' '} extension or a hardware wallet like{' '} Ledger Nano S . ), connect: 'Connect', connecting: 'Connecting...', connected: 'Connected', error: 'Could not connect to wallet.' } } render(): JSX.Element { const { center, isConnecting, isConnected, onConnect, hasError, i18n } = this.props let classes = 'SignIn' if (center) { classes += ' center' } let errorClasses = 'error' if (hasError && !isConnecting && !isConnected) { errorClasses += ' visible' } return (
{i18n.header}

{i18n.message}

{i18n.error}

) } }