-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from sanity-io/next-13
Fix published view and add 404
- Loading branch information
Showing
12 changed files
with
118 additions
and
33 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,30 @@ | ||
'use client' | ||
|
||
import Link from 'next/link' | ||
import {usePathname} from 'next/navigation' | ||
|
||
import {CourseLayout} from '@/components/CourseLayout' | ||
import Header from '@/components/Header' | ||
|
||
import {i18n} from '../../../../languages' | ||
|
||
export default function NotFound() { | ||
const pathname = usePathname() | ||
const data = { | ||
title: { | ||
[i18n.base]: 'Not Found', | ||
}, | ||
} | ||
|
||
return ( | ||
<div> | ||
<Header translations={[]} /> | ||
<CourseLayout data={data}> | ||
<p> | ||
Could not find Course at <code>{pathname}</code> | ||
</p> | ||
<Link href="/">Return Home</Link> | ||
</CourseLayout> | ||
</div> | ||
) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
import {PortableText} from '@portabletext/react' | ||
import {PropsWithChildren} from 'react' | ||
import {TypedObject} from 'sanity' | ||
|
||
import {portableTextComponents} from '@/sanity/portableTextComponents' | ||
|
||
type ProseProps = { | ||
value: TypedObject[] | ||
} | ||
type ProseProps = PropsWithChildren<{ | ||
value?: TypedObject[] | ||
}> | ||
|
||
export default function Prose(props: ProseProps) { | ||
const {value} = props | ||
|
||
if (!value || !value.length) { | ||
return null | ||
} | ||
const {value, children} = props | ||
|
||
return ( | ||
<div className="prose prose-slate md:prose-lg lg:prose-xl w-full prose-h2:text-cyan-800 prose-h3:text-cyan-700 prose-a:text-cyan-500 prose-a:transition-colors prose-a:duration-200 hover:prose-a:text-pink-500 prose-code:text-pink-700 prose-h2:font-display prose-h3:font-display"> | ||
<PortableText value={value} components={portableTextComponents} /> | ||
{value && value.length > 0 ? ( | ||
<PortableText value={value} components={portableTextComponents} /> | ||
) : ( | ||
children | ||
)} | ||
</div> | ||
) | ||
} |
404122c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
demo-course-platform-studio – ./studio
demo-course-platform-studio.sanity.build
demo-course-platform-studio-git-main.sanity.build
404122c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
demo-course-platform – ./web
demo-course-platform-git-main.sanity.build
demo-course-platform.sanity.build