Fix new button,
also redirects if user is not signed in
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
import { useEffect } from 'react'
|
||||
import { useAuth } from '@redwoodjs/auth'
|
||||
import { navigate, routes } from '@redwoodjs/router'
|
||||
|
||||
import MainLayout from 'src/layouts/MainLayout'
|
||||
import Part2Cell from 'src/components/Part2Cell'
|
||||
|
||||
|
||||
const NewPart2Page = ({userName}) => {
|
||||
const { currentUser } = useAuth()
|
||||
const { isAuthenticated, currentUser } = useAuth()
|
||||
useEffect(() => {!isAuthenticated &&
|
||||
navigate(routes.home())},
|
||||
[currentUser])
|
||||
return (
|
||||
<MainLayout>
|
||||
<Part2Cell
|
||||
|
||||
Reference in New Issue
Block a user