-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add back embed pages in pages router
- Loading branch information
Showing
7 changed files
with
94 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import withEmbedSsr from "@lib/withEmbedSsr"; | ||
|
||
import PageWrapper from "@components/PageWrapper"; | ||
|
||
import { getServerSideProps as _getServerSideProps } from "@server/lib/[user]/[type]/getServerSideProps"; | ||
|
||
import type { PageProps } from "~/users/views/users-type-public-view"; | ||
import TypePage from "~/users/views/users-type-public-view"; | ||
|
||
export const getServerSideProps = withEmbedSsr(_getServerSideProps); | ||
|
||
const Type = (props: PageProps) => <TypePage {...props} />; | ||
|
||
Type.PageWrapper = PageWrapper; | ||
|
||
export default Type; |
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,15 @@ | ||
import withEmbedSsr from "@lib/withEmbedSsr"; | ||
|
||
import PageWrapper from "@components/PageWrapper"; | ||
|
||
import { getServerSideProps as _getServerSideProps } from "@server/lib/[user]/getServerSideProps"; | ||
|
||
import User, { type PageProps } from "~/users/views/users-public-view"; | ||
|
||
export const getServerSideProps = withEmbedSsr(_getServerSideProps); | ||
|
||
const UserPage = (props: PageProps) => <User {...props} />; | ||
|
||
UserPage.PageWrapper = PageWrapper; | ||
|
||
export default UserPage; |
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,20 @@ | ||
import { getServerSideProps as _getServerSideProps } from "@lib/org/[orgSlug]/[user]/[type]/getServerSideProps"; | ||
import withEmbedSsr from "@lib/withEmbedSsr"; | ||
|
||
import PageWrapper from "@components/PageWrapper"; | ||
|
||
import type { PageProps as TeamTypePageProps } from "~/team/type-view"; | ||
import TeamTypePage from "~/team/type-view"; | ||
import UserTypePage from "~/users/views/users-type-public-view"; | ||
import type { PageProps as UserTypePageProps } from "~/users/views/users-type-public-view"; | ||
|
||
export type PageProps = UserTypePageProps | TeamTypePageProps; | ||
|
||
export default function Page(props: PageProps) { | ||
if ((props as TeamTypePageProps)?.teamId) return <TeamTypePage {...(props as TeamTypePageProps)} />; | ||
return <UserTypePage {...(props as UserTypePageProps)} />; | ||
} | ||
|
||
Page.PageWrapper = PageWrapper; | ||
|
||
export const getServerSideProps = withEmbedSsr(_getServerSideProps); |
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 @@ | ||
export { default, getServerSideProps } from "@pages/[user]/embed"; |
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,14 @@ | ||
import { getServerSideProps as _getServerSideProps } from "@lib/team/[slug]/getServerSideProps"; | ||
import withEmbedSsr from "@lib/withEmbedSsr"; | ||
|
||
import PageWrapper from "@components/PageWrapper"; | ||
|
||
import TeamPage, { type PageProps } from "~/team/team-view"; | ||
|
||
const Page = (props: PageProps) => <TeamPage {...props} />; | ||
|
||
Page.PageWrapper = PageWrapper; | ||
|
||
export default Page; | ||
|
||
export const getServerSideProps = withEmbedSsr(_getServerSideProps); |
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,14 @@ | ||
import { getServerSideProps as _getServerSideProps } from "@lib/team/[slug]/[type]/getServerSideProps"; | ||
import withEmbedSsr from "@lib/withEmbedSsr"; | ||
|
||
import PageWrapper from "@components/PageWrapper"; | ||
|
||
import TypePage, { type PageProps } from "~/team/type-view"; | ||
|
||
export const getServerSideProps = withEmbedSsr(_getServerSideProps); | ||
|
||
const Page = (props: PageProps) => <TypePage {...props} />; | ||
|
||
Page.PageWrapper = PageWrapper; | ||
|
||
export default Page; |
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,14 @@ | ||
import { getServerSideProps as _getServerSideProps } from "@lib/team/[slug]/getServerSideProps"; | ||
import withEmbedSsr from "@lib/withEmbedSsr"; | ||
|
||
import PageWrapper from "@components/PageWrapper"; | ||
|
||
import TeamPage, { type PageProps } from "~/team/team-view"; | ||
|
||
export const getServerSideProps = withEmbedSsr(_getServerSideProps); | ||
|
||
const Page = (props: PageProps) => <TeamPage {...props} />; | ||
|
||
Page.PageWrapper = PageWrapper; | ||
|
||
export default Page; |