File tree Expand file tree Collapse file tree 17 files changed +54
-57
lines changed
(public-fullwidth)/author/[authorId]
(protected-post)/user/posts/[postId]/edit
public/post/[postIdOrSlug] Expand file tree Collapse file tree 17 files changed +54
-57
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export const metadata = {
88}
99
1010export default async function Page ( props : { params : Promise < { authorId : string } > } ) {
11- const params = await props . params ;
11+ const params = await props . params
1212 const author = await getUserById ( params ?. authorId as string )
1313
1414 return (
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export const metadata = {
88}
99
1010export default async function Page ( props : { params : Promise < { authorId : string } > } ) {
11- const params = await props . params ;
11+ const params = await props . params
1212 const author = await getUserById ( params ?. authorId as string )
1313
1414 return (
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { getPost } from "database"
55import PostForm from "@/molecules/post-form"
66
77export async function generateMetadata ( props ) : Promise < Metadata > {
8- const params = await props . params ;
8+ const params = await props . params
99 const post = await getPost ( { postIdOrSlug : params ?. postId as string } )
1010
1111 return {
@@ -15,7 +15,7 @@ export async function generateMetadata(props): Promise<Metadata> {
1515}
1616
1717export default async function Page ( props : { params : Promise < { postId : string } > } ) {
18- const params = await props . params ;
18+ const params = await props . params
1919 const post = await getPost ( { postIdOrSlug : params ?. postId as string } )
2020
2121 return < PostForm post = { post ?. data } />
Original file line number Diff line number Diff line change @@ -8,15 +8,15 @@ import SearchBar from "@/molecules/nav/search-bar"
88import PostList from "@/molecules/posts/post-list"
99
1010export async function generateMetadata ( props ) : Promise < Metadata > {
11- const searchParams = await props . searchParams ;
11+ const searchParams = await props . searchParams
1212 return {
1313 title : `${ searchParams ?. search } - Search results` ,
1414 description : `Search results for "${ searchParams ?. search } "` ,
1515 }
1616}
1717
1818export default async function Page ( props ) {
19- const searchParams = await props . searchParams ;
19+ const searchParams = await props . searchParams
2020 const t = await getTranslations ( {
2121 namespace : "common" ,
2222 } )
Original file line number Diff line number Diff line change @@ -6,12 +6,10 @@ import UserProfile from "@/molecules/follower/user-profile"
66import { TUserItem } from "@/types/users"
77import { generatePath } from "@/utils/generatePath"
88
9- export async function generateMetadata (
10- props : {
11- params : Promise < { authorId : string } >
12- }
13- ) : Promise < Metadata > {
14- const params = await props . params ;
9+ export async function generateMetadata ( props : {
10+ params : Promise < { authorId : string } >
11+ } ) : Promise < Metadata > {
12+ const params = await props . params
1513 const rawAuthor = await fetch (
1614 `${ process . env . NEXT_PUBLIC_FRONTEND_URL } ${ generatePath ( APP_APIS . protected . user . GET , {
1715 userId : params ?. authorId ,
@@ -33,7 +31,7 @@ export async function generateMetadata(
3331}
3432
3533export default async function Page ( props : { params : Promise < { authorId : string } > } ) {
36- const params = await props . params ;
34+ const params = await props . params
3735 return (
3836 < div className = "grid grid-cols-12 gap-10" >
3937 < UserProfile authorId = { params ?. authorId } />
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ import { getUser } from "database"
33import UserProfile from "@/molecules/follower/user-profile"
44import PostList from "@/molecules/posts/post-list"
55
6- export const generateMetadata = async props => {
7- const params = await props . params ;
6+ export const generateMetadata = async ( props ) => {
7+ const params = await props . params
88 const { data : author , error } = await getUser ( {
99 where : {
1010 id : params ?. authorId ,
@@ -18,8 +18,8 @@ export const generateMetadata = async props => {
1818}
1919
2020export default async function Page ( props ) {
21- const searchParams = await props . searchParams ;
22- const params = await props . params ;
21+ const searchParams = await props . searchParams
22+ const params = await props . params
2323 return (
2424 < div className = "grid grid-cols-12 gap-10" >
2525 < UserProfile authorId = { params ?. authorId } />
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import { auth } from "configs/auth"
1414import { getPost , PostStatus } from "database"
1515
1616export async function generateMetadata ( props ) : Promise < Metadata > {
17- const params = await props . params ;
17+ const params = await props . params
1818 const post = await getPost ( { postIdOrSlug : params ?. postId } )
1919
2020 return {
@@ -23,14 +23,12 @@ export async function generateMetadata(props): Promise<Metadata> {
2323 }
2424}
2525
26- export default async function Page (
27- props : {
28- params : Promise < { postId : string } >
29- searchParams : Promise < TSearchParams >
30- }
31- ) {
32- const searchParams = await props . searchParams ;
33- const params = await props . params ;
26+ export default async function Page ( props : {
27+ params : Promise < { postId : string } >
28+ searchParams : Promise < TSearchParams >
29+ } ) {
30+ const searchParams = await props . searchParams
31+ const params = await props . params
3432 const post = await getPost ( { postIdOrSlug : params ?. postId } )
3533 const session = await auth ( )
3634
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export const metadata = {
77}
88
99export default async function Page ( props : { params : Promise < { tagId : string } > } ) {
10- const params = await props . params ;
10+ const params = await props . params
1111 const tag = await getTagById ( params ?. tagId as string )
1212
1313 return (
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ import { getTag } from "database"
33import PostList from "@/molecules/posts/post-list"
44import TagDetail from "@/molecules/tag/tag-detail"
55
6- export const generateMetadata = async props => {
7- const params = await props . params ;
6+ export const generateMetadata = async ( props ) => {
7+ const params = await props . params
88 const { data : tag , error } = await getTag ( {
99 tagIdOrSlug : params ?. tagId ,
1010 } )
@@ -16,7 +16,7 @@ export const generateMetadata = async props => {
1616}
1717
1818export default async function Page ( props ) {
19- const params = await props . params ;
19+ const params = await props . params
2020 return (
2121 < div className = "grid grid-cols-12 gap-10" >
2222 < TagDetail tagIdOrSlug = { params ?. tagId } />
Original file line number Diff line number Diff line change 1- import { use } from "react" ;
1+ import { use } from "react"
2+
23import "./globals.css"
34import "ui/dist/index.css"
45import "react-toastify/dist/ReactToastify.css"
@@ -16,21 +17,15 @@ export const metadata = {
1617 } ,
1718}
1819
19- export default function RootLayout (
20- props : {
21- params : Promise < { lang : string } >
22- children : React . ReactNode
23- }
24- ) {
25- const params = use ( props . params ) ;
26-
27- const {
28- lang
29- } = params ;
30-
31- const {
32- children
33- } = props ;
20+ export default function RootLayout ( props : {
21+ params : Promise < { lang : string } >
22+ children : React . ReactNode
23+ } ) {
24+ const params = use ( props . params )
25+
26+ const { lang } = params
27+
28+ const { children } = props
3429
3530 const messages = useMessages ( )
3631
You can’t perform that action at this time.
0 commit comments