-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor CSS styles and update navbar
- Loading branch information
1 parent
315109f
commit 82b887c
Showing
20 changed files
with
202 additions
and
184 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
19 changes: 0 additions & 19 deletions
19
browser/create-template/templates/nextjs-site/src/app/[...slug]/error.tsx
This file was deleted.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
browser/create-template/templates/nextjs-site/src/app/[...slug]/page.tsx
This file was deleted.
Oops, something went wrong.
45 changes: 45 additions & 0 deletions
45
browser/create-template/templates/nextjs-site/src/app/[[...slug]]/page.tsx
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,45 @@ | ||
import { getCurrentResource } from '@/atomic/getCurrentResource'; | ||
import FullPageView from '@/views/FullPage/FullPageView'; | ||
import { core } from '@tomic/lib'; | ||
import type { Metadata } from 'next'; | ||
import { notFound } from 'next/navigation'; | ||
|
||
type Params = { | ||
slug?: string[]; | ||
}; | ||
|
||
type Props = { | ||
params: Promise<Params>; | ||
searchParams?: Promise<Record<string, string | string[] | undefined>>; | ||
}; | ||
|
||
const fetchResource = async (slug?: string[]) => { | ||
const path = slug ? `/${slug.join('/')}` : '/'; | ||
return await getCurrentResource(path); | ||
}; | ||
|
||
export const generateMetadata = async ({ | ||
params, | ||
}: Props): Promise<Metadata> => { | ||
const slug = (await params).slug; | ||
const resource = await fetchResource(slug); | ||
|
||
return { | ||
title: resource?.title, | ||
description: resource?.get(core.properties.description), | ||
}; | ||
}; | ||
|
||
const Page = async ({ params, searchParams }: Props) => { | ||
const slug = (await params).slug; | ||
const search = await searchParams; | ||
const resource = await fetchResource(slug); | ||
|
||
if (!resource) { | ||
return notFound(); | ||
} | ||
|
||
return <FullPageView subject={resource.subject} searchParams={search} />; | ||
}; | ||
|
||
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 |
---|---|---|
|
@@ -22,7 +22,3 @@ body { | |
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
p { | ||
margin-top: 1em; | ||
} |
24 changes: 0 additions & 24 deletions
24
browser/create-template/templates/nextjs-site/src/app/page.tsx
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
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
6 changes: 3 additions & 3 deletions
6
browser/create-template/templates/nextjs-site/src/views/Block/TextBlock.module.css
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
.wrapper { | ||
max-width: 70ch; | ||
} | ||
|
||
.wrapper > p { | ||
margin-top: 1em; | ||
& p { | ||
margin-top: 1em; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
browser/create-template/templates/nextjs-site/src/views/DefaultView.tsx
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
14 changes: 7 additions & 7 deletions
14
browser/create-template/templates/nextjs-site/src/views/FullPage/BlogpostFullPage.module.css
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ | |
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} | ||
|
||
.wrapper > h1 { | ||
margin: 0; | ||
& h1 { | ||
margin: 0; | ||
} | ||
} |
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.