sanity-plugin-utils 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -85,6 +85,24 @@ export default function DocumentList() {
|
|
|
85
85
|
}
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
+
### useOpenInNewPane()
|
|
89
|
+
|
|
90
|
+
Returns a function that will open a document in a new view pane, alongside the current view pane
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
import {useOpenInNewPane} from 'sanity-plugin-utils'
|
|
94
|
+
|
|
95
|
+
export default function SidePetOpener(pet: SanityDocument) {
|
|
96
|
+
const openInNewPane = useOpenInNewPane(pet._id, `pet`)
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<Button onClick={() => openInNewPane(pet._id)}>
|
|
100
|
+
{pet.title}
|
|
101
|
+
</Button>
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
88
106
|
### Feedback
|
|
89
107
|
|
|
90
108
|
Component for consistently displaying feedback in a card with a title, text and an icon.
|