-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(client): drop multi color theme in favor of light and dark theme
- Loading branch information
Ivo
committed
Apr 22, 2023
1 parent
12398cc
commit f5bdc6a
Showing
17 changed files
with
172 additions
and
502 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { GetServerSidePropsContext, GetServerSidePropsResult } from "next"; | ||
import { getServerSession } from "next-auth"; | ||
|
||
import { authOptions } from "@app/pages/api/auth/[...nextauth]"; | ||
|
||
type IncomingGSSP<P> = (ctx: GetServerSidePropsContext) => Promise<P>; | ||
|
||
type WithAuthServerSidePropsResult = GetServerSidePropsResult<{ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
[key: string]: any; | ||
}>; | ||
|
||
type WithSSRAuthOptions = { | ||
// any options you eventually would like to pass (required role...) | ||
}; | ||
|
||
export function withSSRGuest( | ||
incomingGSSP?: IncomingGSSP<WithAuthServerSidePropsResult> | null, | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
options?: WithSSRAuthOptions | ||
) { | ||
return async ( | ||
ctx: GetServerSidePropsContext | ||
): Promise<WithAuthServerSidePropsResult> => { | ||
const session = await getServerSession(ctx.req, ctx.res, authOptions); | ||
|
||
if (session !== null) { | ||
return { | ||
redirect: { | ||
destination: "/my-dynamics", | ||
permanent: false | ||
} | ||
}; | ||
} | ||
|
||
if (incomingGSSP) { | ||
const incomingGSSPResult = await incomingGSSP(ctx); | ||
|
||
if ("props" in incomingGSSPResult) { | ||
return { | ||
props: { | ||
...incomingGSSPResult.props, | ||
session | ||
} | ||
}; | ||
} | ||
|
||
if ("redirect" in incomingGSSPResult) { | ||
return { redirect: { ...incomingGSSPResult.redirect } }; | ||
} | ||
|
||
if ("notFound" in incomingGSSPResult) { | ||
return { notFound: incomingGSSPResult.notFound }; | ||
} | ||
} | ||
|
||
return { | ||
props: { | ||
session | ||
} | ||
}; | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.