fix: rewriting rules for my-pages
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
.content {
|
||||
display: grid;
|
||||
padding-bottom: 7.7rem;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 950px) {
|
||||
.content {
|
||||
gap: 10rem;
|
||||
grid-template-columns: 25rem 1fr;
|
||||
padding-bottom: 17.5rem;
|
||||
padding-left: 2.4rem;
|
||||
padding-right: 2.4rem;
|
||||
padding-top: 5.8rem;
|
||||
}
|
||||
}
|
||||
|
||||
.blocks {
|
||||
display: grid;
|
||||
gap: 4.2rem;
|
||||
padding-top: 4rem;
|
||||
padding-left: 1.6rem;
|
||||
padding-right: 1.6rem;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 950px) {
|
||||
.blocks {
|
||||
gap: 6.4rem;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
45
app/[lang]/(live)/(protected)/my-pages/[...path]/page.tsx
Normal file
45
app/[lang]/(live)/(protected)/my-pages/[...path]/page.tsx
Normal file
@@ -0,0 +1,45 @@
|
||||
import { myPages } from "@/constants/routes/myPages"
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
|
||||
import MaxWidth from "@/components/MaxWidth"
|
||||
import Content from "@/components/MyPages/AccountPage/Content"
|
||||
import Breadcrumbs from "@/components/MyPages/Breadcrumbs"
|
||||
import Sidebar from "@/components/MyPages/Sidebar"
|
||||
|
||||
import styles from "./page.module.css"
|
||||
|
||||
import type { LangParams, PageArgs } from "@/types/params"
|
||||
|
||||
export default async function MyPages({
|
||||
params,
|
||||
}: PageArgs<LangParams & { path: string[] }>) {
|
||||
const baseUrl = myPages[params.lang].replace(`/${params.lang}`, "")
|
||||
const pathUrl = params.path.join("/")
|
||||
|
||||
const accountPage = await serverClient().contentstack.accountPage.get({
|
||||
url: `${baseUrl}/${pathUrl}`,
|
||||
lang: params.lang,
|
||||
})
|
||||
|
||||
const breadcrumbs = await serverClient().contentstack.breadcrumbs.get({
|
||||
href: `${baseUrl}/${pathUrl}`,
|
||||
locale: params.lang,
|
||||
})
|
||||
|
||||
return (
|
||||
<>
|
||||
<Breadcrumbs breadcrumbs={breadcrumbs} />
|
||||
|
||||
<div className={styles.content}>
|
||||
<Sidebar lang={params.lang} />
|
||||
<MaxWidth className={styles.blocks} tag="main">
|
||||
{accountPage.content.length ? (
|
||||
<Content lang={params.lang} content={accountPage.content} />
|
||||
) : (
|
||||
<p>No content published</p>
|
||||
)}
|
||||
</MaxWidth>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user