upgrade and code mods v0.26 and v0.27

This commit is contained in:
David S Price
2021-03-10 23:26:51 -08:00
parent 6254e24801
commit 5c7f9832f9
7 changed files with 957 additions and 239 deletions

View File

@@ -1,24 +1,25 @@
import { AuthProvider } from '@redwoodjs/auth'
import netlifyIdentity from 'netlify-identity-widget'
import ReactDOM from 'react-dom'
import { FatalErrorBoundary } from '@redwoodjs/web'
import { RedwoodApolloProvider } from '@redwoodjs/web/apollo'
import FatalErrorPage from 'src/pages/FatalErrorPage'
import { isBrowser } from '@redwoodjs/prerender/browserUtils'
import Routes from 'src/Routes'
import './scaffold.css'
import './index.css'
netlifyIdentity.init()
isBrowser && netlifyIdentity.init()
ReactDOM.render(
const App = () => (
<FatalErrorBoundary page={FatalErrorPage}>
<AuthProvider client={netlifyIdentity} type="netlify">
<RedwoodApolloProvider>
<Routes />
</RedwoodApolloProvider>
</AuthProvider>
</FatalErrorBoundary>,
document.getElementById('redwood-app')
</FatalErrorBoundary>
)
export default App

View File

@@ -22,7 +22,7 @@ const Routes = () => {
<Route path="/admin/posts/{id:Int}" page={PostPage} name="post" />
<Route path="/admin/posts" page={PostsPage} name="posts" />
</Private>
<Route notfound page={NotFoundPage} />
<Route notfound page={NotFoundPage} prerender />
</Router>
)
}

View File

@@ -7,6 +7,8 @@
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body class="h-full bg-gray-200">
<div id="redwood-app"></div>
<div id="redwood-app">
<%= prerenderPlaceholder %>
</div>
</body>
</html>