Skip to content

Commit 4fbcb75

Browse files
committed
fix: prevent duplicate React instance
1 parent 57f4cce commit 4fbcb75

4 files changed

Lines changed: 407 additions & 2 deletions

File tree

.claude/launch.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
"runtimeExecutable": "pnpm",
77
"runtimeArgs": ["--filter", "astro", "dev"],
88
"port": 8080
9+
},
10+
{
11+
"name": "astro-preview",
12+
"runtimeExecutable": "pnpm",
13+
"runtimeArgs": ["--filter", "astro", "dev:preview"],
14+
"port": 8080
915
}
1016
]
1117
}

astro/.claude/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.0.1",
3+
"configurations": [
4+
{
5+
"name": "astro-preview",
6+
"runtimeExecutable": "pnpm",
7+
"runtimeArgs": ["run", "dev:preview"],
8+
"port": 8080
9+
}
10+
]
11+
}

astro/src/components/Table.astro

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
import type {RichTableType} from 'sanity-plugin-rich-table'
2+
import type {RichTableBlock} from 'sanity.types'
33
import PortableText from './PortableText.astro'
44
55
// Registered as a `richTableBlock` type component on PortableText.astro,
66
// so the table data arrives on `Astro.props.node`.
77
const {rows, columnHeaders, hasColumnTitles, hasRowTitles} = Astro.props
8-
.node as RichTableType
8+
.node as RichTableBlock
99
---
1010

1111
<table>
@@ -34,3 +34,16 @@ const {rows, columnHeaders, hasColumnTitles, hasRowTitles} = Astro.props
3434
}
3535
</tbody>
3636
</table>
37+
38+
<style>
39+
table {
40+
border-collapse: collapse;
41+
}
42+
th,
43+
td {
44+
border: 1px solid var(--light-gray-text);
45+
padding: 0.5rem 0.75rem;
46+
text-align: left;
47+
vertical-align: top;
48+
}
49+
</style>

0 commit comments

Comments
 (0)