Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/Browser/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {Asset, Tag} from '@types'
import groq from 'groq'
import React, {useEffect, useState} from 'react'
import {useDispatch} from 'react-redux'
import {useColorScheme, type AssetSourceComponentProps, type SanityDocument} from 'sanity'
import {useColorSchemeValue, type AssetSourceComponentProps, type SanityDocument} from 'sanity'
import {TAG_DOCUMENT_NAME} from '../../constants'
import {AssetBrowserDispatchProvider} from '../../contexts/AssetSourceDispatchContext'
import useVersionedClient from '../../hooks/useVersionedClient'
Expand Down Expand Up @@ -132,7 +132,7 @@ const BrowserContent = ({onClose}: {onClose?: AssetSourceComponentProps['onClose

const Browser = (props: Props) => {
const client = useVersionedClient()
const {scheme} = useColorScheme()
const scheme = useColorSchemeValue()

return (
<ReduxProvider
Expand Down
4 changes: 2 additions & 2 deletions src/components/CardAsset/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '@sanity/ui'
import React, {memo, MouseEvent, RefObject} from 'react'
import {useDispatch} from 'react-redux'
import {useColorScheme} from 'sanity'
import {useColorSchemeValue} from 'sanity'
import styled, {css} from 'styled-components'
import {PANEL_HEIGHT} from '../../constants'
import {useAssetSourceActions} from '../../contexts/AssetSourceDispatchContext'
Expand Down Expand Up @@ -88,7 +88,7 @@ const StyledWarningOutlineIcon = styled(WarningFilledIcon)(({theme}) => {
const CardAsset = (props: Props) => {
const {id, selected} = props

const {scheme} = useColorScheme()
const scheme = useColorSchemeValue()

// Refs
const shiftPressed: RefObject<boolean> = useKeyPress('shift')
Expand Down
4 changes: 2 additions & 2 deletions src/components/CardUpload/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Box, Button, Flex, Text} from '@sanity/ui'
import filesize from 'filesize'
import React from 'react'
import {useDispatch} from 'react-redux'
import {useColorScheme} from 'sanity'
import {useColorSchemeValue} from 'sanity'
import styled from 'styled-components'
import {PANEL_HEIGHT} from '../../constants'
import useTypedSelector from '../../hooks/useTypedSelector'
Expand All @@ -27,7 +27,7 @@ const CardWrapper = styled(Flex)`
const CardUpload = (props: Props) => {
const {id} = props

const {scheme} = useColorScheme()
const scheme = useColorSchemeValue()

// Redux
const dispatch = useDispatch()
Expand Down
4 changes: 2 additions & 2 deletions src/components/DialogAssetEdit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import groq from 'groq'
import React, {ReactNode, useCallback, useEffect, useRef, useState} from 'react'
import {SubmitHandler, useForm} from 'react-hook-form'
import {useDispatch} from 'react-redux'
import {WithReferringDocuments, useColorScheme, useDocumentStore} from 'sanity'
import {WithReferringDocuments, useDocumentStore, useColorSchemeValue} from 'sanity'
import {assetFormSchema} from '../../formSchema'
import useTypedSelector from '../../hooks/useTypedSelector'
import useVersionedClient from '../../hooks/useVersionedClient'
Expand Down Expand Up @@ -41,7 +41,7 @@ const DialogAssetEdit = (props: Props) => {
} = props

const client = useVersionedClient()
const {scheme} = useColorScheme()
const scheme = useColorSchemeValue()

const documentStore = useDocumentStore()

Expand Down
4 changes: 2 additions & 2 deletions src/components/FormFieldInputTags/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Box} from '@sanity/ui'
import React from 'react'
import {Controller} from 'react-hook-form'
import CreatableSelect from 'react-select/creatable'
import {useColorScheme} from 'sanity'
import {useColorSchemeValue} from 'sanity'
import useTypedSelector from '../../hooks/useTypedSelector'
import {reactSelectComponents, reactSelectStyles} from '../../styled/react-select/creatable'
import type {TagSelectOption} from '../../types'
Expand Down Expand Up @@ -38,7 +38,7 @@ const FormFieldInputTags = (props: Props) => {
value
} = props

const {scheme} = useColorScheme()
const scheme = useColorSchemeValue()

// Redux
const creating = useTypedSelector(state => state.tags.creating)
Expand Down
4 changes: 2 additions & 2 deletions src/components/PickedBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import {Box, Button, Flex, Label} from '@sanity/ui'
import pluralize from 'pluralize'
import React from 'react'
import {useDispatch} from 'react-redux'
import {useColorScheme} from 'sanity'
import {useColorSchemeValue} from 'sanity'
import {PANEL_HEIGHT} from '../../constants'
import useTypedSelector from '../../hooks/useTypedSelector'
import {assetsActions, selectAssetsPicked} from '../../modules/assets'
import {dialogActions} from '../../modules/dialog'
import {getSchemeColor} from '../../utils/getSchemeColor'

const PickedBar = () => {
const {scheme} = useColorScheme()
const scheme = useColorSchemeValue()

// Redux
const dispatch = useDispatch()
Expand Down
4 changes: 2 additions & 2 deletions src/components/SearchFacet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Box, Flex, Label, rem, Text, Theme, ThemeColorSchemeKey} from '@sanity/u
import {SearchFacetInputProps, WithId} from '@types'
import React, {ReactNode} from 'react'
import {useDispatch} from 'react-redux'
import {useColorScheme} from 'sanity'
import {useColorSchemeValue} from 'sanity'
import styled, {css} from 'styled-components'
import {searchActions} from '../../modules/search'
import {getSchemeColor} from '../../utils/getSchemeColor'
Expand All @@ -23,7 +23,7 @@ const Container = styled(Box)(({scheme, theme}: {scheme: ThemeColorSchemeKey; th
const SearchFacet = (props: Props) => {
const {children, facet} = props

const {scheme} = useColorScheme()
const scheme = useColorSchemeValue()

// Redux
const dispatch = useDispatch()
Expand Down
4 changes: 2 additions & 2 deletions src/components/SearchFacetTags/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import React from 'react'
import {useDispatch} from 'react-redux'
import Select from 'react-select'
import {useColorScheme} from 'sanity'
import {useColorSchemeValue} from 'sanity'
import {operators} from '../../config/searchFacets'
import {usePortalPopoverProps} from '../../hooks/usePortalPopoverProps'
import useTypedSelector from '../../hooks/useTypedSelector'
Expand All @@ -24,7 +24,7 @@ type Props = {
}

const SearchFacetTags = ({facet}: Props) => {
const {scheme} = useColorScheme()
const scheme = useColorSchemeValue()

// Redux
const dispatch = useDispatch()
Expand Down
4 changes: 2 additions & 2 deletions src/components/TableHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {useAssetSourceActions} from '../../contexts/AssetSourceDispatchContext'
import useTypedSelector from '../../hooks/useTypedSelector'
import {assetsActions, selectAssetsLength, selectAssetsPickedLength} from '../../modules/assets'
import TableHeaderItem from '../TableHeaderItem'
import {useColorScheme} from 'sanity'
import {useColorSchemeValue} from 'sanity'
import {getSchemeColor} from '../../utils/getSchemeColor'

// TODO: DRY
Expand All @@ -23,7 +23,7 @@ const ContextActionContainer = styled(Flex)(({scheme}: {scheme: ThemeColorScheme
})

const TableHeader = () => {
const {scheme} = useColorScheme()
const scheme = useColorSchemeValue()

// Redux
const dispatch = useDispatch()
Expand Down
4 changes: 2 additions & 2 deletions src/components/TableRowAsset/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import formatRelative from 'date-fns/formatRelative'
import filesize from 'filesize'
import React, {memo, MouseEvent, RefObject, useCallback, useEffect, useRef, useState} from 'react'
import {useDispatch} from 'react-redux'
import {WithReferringDocuments, useColorScheme} from 'sanity'
import {WithReferringDocuments, useColorSchemeValue} from 'sanity'
import styled, {css} from 'styled-components'
import {GRID_TEMPLATE_COLUMNS} from '../../constants'
import {useAssetSourceActions} from '../../contexts/AssetSourceDispatchContext'
Expand Down Expand Up @@ -90,7 +90,7 @@ const StyledWarningIcon = styled(WarningFilledIcon)(({theme}) => {
const TableRowAsset = (props: Props) => {
const {id, selected} = props

const {scheme} = useColorScheme()
const scheme = useColorSchemeValue()

const shiftPressed: RefObject<boolean> = useKeyPress('shift')

Expand Down
4 changes: 2 additions & 2 deletions src/components/TableRowUpload/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Box, Button, Flex, Grid, Stack, Text, useMediaIndex} from '@sanity/ui'
import filesize from 'filesize'
import React from 'react'
import {useDispatch} from 'react-redux'
import {useColorScheme} from 'sanity'
import {useColorSchemeValue} from 'sanity'
import {GRID_TEMPLATE_COLUMNS} from '../../constants'
import useTypedSelector from '../../hooks/useTypedSelector'
import {selectUploadById, uploadsActions} from '../../modules/uploads'
Expand All @@ -18,7 +18,7 @@ type Props = {
const TableRowUpload = (props: Props) => {
const {id} = props

const {scheme} = useColorScheme()
const scheme = useColorSchemeValue()

// Redux
const dispatch = useDispatch()
Expand Down
4 changes: 2 additions & 2 deletions src/components/TagViewHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {ComposeIcon} from '@sanity/icons'
import {Box, Button, Flex, Inline, Label} from '@sanity/ui'
import React from 'react'
import {useDispatch} from 'react-redux'
import {useColorScheme} from 'sanity'
import {useColorSchemeValue} from 'sanity'
import {PANEL_HEIGHT} from '../../constants'
import useTypedSelector from '../../hooks/useTypedSelector'
import {DIALOG_ACTIONS} from '../../modules/dialog/actions'
Expand All @@ -15,7 +15,7 @@ type Props = {
}

const TagViewHeader = ({allowCreate, light, title}: Props) => {
const {scheme} = useColorScheme()
const scheme = useColorSchemeValue()

const dispatch = useDispatch()
const tagsCreating = useTypedSelector(state => state.tags.creating)
Expand Down