Skip to content

Commit 14cb3cd

Browse files
committed
owrking
1 parent 6fcc777 commit 14cb3cd

File tree

6 files changed

+31
-35
lines changed

6 files changed

+31
-35
lines changed

components/block-table.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11

22
import React from 'react';
33

4-
export default function BlockTable({ value }: { value: { rows: { cells: string[] }[] } }) {
4+
export default function BlockTable({ value }: { value: { rows: { _key: string; cells: string[] }[] } }) {
55
const { rows } = value;
66
if (!rows) {
77
return null;
88
}
99
return (
1010
<table>
1111
<tbody>
12-
{rows.map((row, rowIndex) => (
13-
<tr key={rowIndex}>
12+
{rows.map((row) => (
13+
<tr key={row._key}>
1414
{row.cells.map((cell, cellIndex) => (
1515
<td key={cellIndex}>{cell}</td>
1616
))}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"@sanity/image-url": "^1.2.0",
5555
"@sanity/preview-url-secret": "^2.1.15",
5656
"@sanity/studio-secrets": "^3.0.2",
57+
"@sanity/table": "^2.0.0",
5758
"@sanity/ui": "^3.1.0",
5859
"@sanity/vision": "^4.8.1",
5960
"@sanity/webhook": "^4.0.4",

pnpm-lock.yaml

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sanity.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import settings from "@/sanity/schemas/singletons/settings";
4545
import sponsor from "@/sanity/schemas/documents/sponsor";
4646
import sponsorshipRequest from "@/sanity/schemas/documents/sponsorshipRequest";
4747
import youtubeUpdateTask from "@/sanity/schemas/documents/youtubeUpdateTask";
48-
import table from "@/sanity/schemas/objects/table";
48+
import { table } from "@sanity/table";
4949
import { resolveHref } from "@/sanity/lib/utils";
5050

5151
const homeLocation = {
@@ -143,7 +143,6 @@ export default defineConfig({
143143
youtubeUpdateTask,
144144
previewSession,
145145
sponsorshipRequest,
146-
table,
147146
],
148147
},
149148
document: {
@@ -200,6 +199,7 @@ export default defineConfig({
200199
// Sets up AI Assist with preset prompts
201200
// https://www.sanity.io/docs/ai-assistPcli
202201
assistWithPresets(),
202+
table(),
203203
cloudinarySchemaPlugin(),
204204
// tags(),
205205
codeInput(),
@@ -215,6 +215,6 @@ export default defineConfig({
215215
// Vision lets you query your content with GROQ in the studio
216216
// https://www.sanity.io/docs/the-vision-plugin
217217
process.env.NODE_ENV === "development" &&
218-
visionTool({ defaultApiVersion: apiVersion }),
218+
visionTool({ defaultApiVersion: apiVersion }),
219219
].filter(Boolean) as PluginOptions[],
220220
});

sanity/components/pastehandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function convertHtmlToSanityPortableTextPatch(
4949
schemaTypes: SchemaTypes,
5050
path: Array<any>,
5151
): InsertPatch | undefined {
52-
if (!isCodeTypeAvailable(schemaTypes) || !isTableTypeAvailable(schemaTypes) || !html) return undefined;
52+
if (!html) return undefined;
5353

5454
const blocks = htmlToBlocks(html, schemaTypes.portableText, {
5555
rules: [

sanity/schemas/objects/table.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)