-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): update dependency @sanity/prettier-config to v1.0.3 (mai…
…n) (#1725)
- Loading branch information
1 parent
237b377
commit bd4c4f2
Showing
36 changed files
with
890 additions
and
1,360 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
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,12 @@ | ||
import '../globals.css' | ||
|
||
export {metadata, viewport} from 'next-sanity/studio' | ||
|
||
export default function RootLayout({children}: {children: React.ReactNode}) { | ||
return ( | ||
<html lang="en"> | ||
<head /> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} |
4 changes: 1 addition & 3 deletions
4
apps/static/app/studio/Studio.tsx → apps/mvp/app/(sanity)/studio/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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
'use client' | ||
|
||
import {NextStudio} from 'next-sanity/studio' | ||
|
||
import config from '@/sanity.config' | ||
|
||
export default function Studio() { | ||
export default function StudioPage() { | ||
return <NextStudio config={config} history="hash" /> | ||
} |
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 {draftMode} from 'next/headers' | ||
|
||
import PreviewProvider from './PreviewProvider' | ||
import {token} from './sanity.fetch' | ||
|
||
export default async function ConditionalPreviewProvider({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}): Promise<React.JSX.Element> { | ||
return (await draftMode()).isEnabled ? ( | ||
<PreviewProvider token={token}>{children}</PreviewProvider> | ||
) : ( | ||
(children as JSX.Element) | ||
) | ||
} |
File renamed without changes.
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 {draftMode} from 'next/headers' | ||
import {LiveQuery} from 'next-sanity/preview/live-query' | ||
|
||
import PostsLayout, {PostsLayoutProps, query} from './PostsLayout' | ||
import PreviewPosts from './PreviewPosts' | ||
import {sanityFetch} from './sanity.fetch' | ||
|
||
export default async function Posts() { | ||
const posts = await sanityFetch<PostsLayoutProps['data']>({query, tags: ['post', 'author']}) | ||
|
||
if ((await draftMode()).isEnabled) { | ||
return <PreviewPosts data={posts} /> | ||
} | ||
|
||
return <PostsLayout data={posts} draftMode={false} /> | ||
} |
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,10 @@ | ||
'use client' | ||
|
||
import {useLiveQuery} from 'next-sanity/preview' | ||
|
||
import PostsLayout, {PostsLayoutProps, query} from './PostsLayout' | ||
|
||
export default function PreviewPosts(props: {data: PostsLayoutProps['data']}) { | ||
const [posts] = useLiveQuery<PostsLayoutProps['data']>(props.data, query) | ||
return <PostsLayout data={posts} draftMode /> | ||
} |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import {draftMode} from 'next/headers' | ||
import {redirect} from 'next/navigation' | ||
|
||
export function GET(): void { | ||
draftMode().disable() | ||
export async function GET(): Promise<void> { | ||
;(await draftMode()).disable() | ||
redirect('/') | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.