Refactor most getServerProps to fetch independent request in parallel and projected the data only to return the necessary fields and changed some functions
This commit is contained in:
@@ -61,7 +61,14 @@ export default function App({ Component, pageProps }: AppProps) {
|
||||
|
||||
return pageProps?.user ? (
|
||||
<Layout user={pageProps.user} entities={entities} refreshPage={loading}>
|
||||
{loading ? <UserProfileSkeleton /> : <Component {...pageProps} />}
|
||||
{loading ? (
|
||||
// TODO: Change this later to a better loading screen (example: skeletons for each page)
|
||||
<div className="min-h-screen flex justify-center items-start">
|
||||
<span className="loading loading-infinity w-32" />
|
||||
</div>
|
||||
) : (
|
||||
<Component entities={entities} {...pageProps} />
|
||||
)}
|
||||
</Layout>
|
||||
) : (
|
||||
<Component {...pageProps} />
|
||||
|
||||
Reference in New Issue
Block a user