import React from 'react'; import { Redirect } from 'react-router-dom'; import { auth } from '../rebase'; class Admin extends React.Component { renderInsufficientAccess = () => { return (

You have insufficient access.

Click Here to log in again.

) } logout = () => { auth.signOut(); } render() { const logout = ; if (!this.props.user.uid) { return } if (!this.props.user.data.isAdmin) { return this.renderInsufficientAccess(); } return (

Admin

{this.props.user.displayName}

Hello, {this.props.user.displayName}

{logout}
) } } export default Admin;