URL
^(https?:\\/\\/)?(www\\.)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$
^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$
import React, { useRef } from 'react'; | |
import { useOutsideClick } from './useOutsideClick'; | |
export const MyComponent = () => { | |
const ref1 = useRef(null); | |
const ref2 = useRef(null); | |
const handleOutsideClick = () => { | |
// Place your code to be executed when clicked outside the elements | |
}; |
import React from 'react'; | |
import { withDocument } from 'part:@sanity/form-builder'; | |
const ChildObjectView = (props) => { | |
const PARENT_ICON = { | |
correct: '✅', | |
incorrect: '❌', | |
neutral: '🔵', | |
}; |
import React from "react"; | |
import { BlogItem, isLongPostBody } from "./types"; | |
const BlogItemPreview = (blogItem: BlogItem) => { | |
const { body, author, title } = blogItem; | |
const image = isLongPostBody(body) && body.image; | |
const previewText = isLongPostBody(body) ? body.lead : body.summary; | |
return ( |
The code allows for arbitrary sorting and filtering of elements in an array of references in Sanity.io.
Supports Sanity.io version v2.
In the example given an array of references for two types, but you can limit it to one type or extend it as desired.
In the fetchElement() function, you can use a custom query so as to get the required elements.
sanity install @sanity/scheduled-publishing
Simply installing the plugin adds the ability to schedule the publication of all documents over time from the drop-down list level next to the "Publish" button. The snippets below show the customization options for this.
type1
and type2