import React from 'react'

export const AuthContext = React.createContext({
  user: null,
})

import React from 'react'

export const AuthContext = React.createContext(null)

export function WhenLoggedIn({ children }) {
  return (
    <AuthContext.Consumer>
      {(user) =>
        user != null
          ? typeof children === 'function'
            ? children(user)
            : children
          : null
      }
    </AuthContext.Consumer>
  )
}

Add WhenLoggedIn utility wrapper component
Add WhenLoggedIn utility wrapper component
