Skip to content

Commit

Permalink
feat: use the new VisualEditing component
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Feb 7, 2024
1 parent 6837b01 commit 4b661fc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 67 deletions.
43 changes: 0 additions & 43 deletions components/VisualEditing.tsx

This file was deleted.

30 changes: 13 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"@portabletext/react": "3.0.11",
"@sanity/client": "6.12.3",
"@sanity/image-url": "1.0.2",
"@sanity/overlays": "2.3.11",
"@sanity/preview-url-secret": "1.6.1",
"@sanity/vision": "3.27.1",
"@sanity/visual-editing": "1.1.0",
"@vercel/og": "0.6.2",
"classnames": "2.5.1",
"date-fns": "2.30.0",
Expand Down
8 changes: 2 additions & 6 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'tailwindcss/tailwind.css'

import { VisualEditing } from '@sanity/visual-editing/next-pages-router'
import { AppProps } from 'next/app'
import { lazy, Suspense } from 'react'

Expand All @@ -9,7 +10,6 @@ export interface SharedPageProps {
}

const PreviewProvider = lazy(() => import('components/PreviewProvider'))
const VisualEditing = lazy(() => import('components/VisualEditing'))

export default function App({
Component,
Expand All @@ -25,11 +25,7 @@ export default function App({
) : (
<Component {...pageProps} />
)}
{draftMode && (
<Suspense>
<VisualEditing />
</Suspense>
)}
{draftMode && <VisualEditing />}
</>
)
}

0 comments on commit 4b661fc

Please sign in to comment.