Skip to content

Commit

Permalink
chore(dev): remove react import
Browse files Browse the repository at this point in the history
  • Loading branch information
binoy14 authored and bjoerge committed Feb 12, 2024
1 parent 40c9b4f commit 9aabbb0
Show file tree
Hide file tree
Showing 901 changed files with 1,691 additions and 1,781 deletions.
2 changes: 1 addition & 1 deletion dev/design-studio/components/CustomPane/CustomPane.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback} from 'react'
import {useCallback} from 'react'
import {Button, Card, Code, Stack} from '@sanity/ui'
import {usePaneRouter} from 'sanity/structure'

Expand Down
1 change: 0 additions & 1 deletion dev/design-studio/components/IframeView.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import styled from 'styled-components'

const IFrame = styled.iframe`
Expand Down
1 change: 0 additions & 1 deletion dev/design-studio/components/jsonPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Card, Code} from '@sanity/ui'
import React from 'react'

export function JSONPreviewDocumentView(props: any) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
ThemeColorSolidTone,
useRootTheme,
} from '@sanity/ui'
import React, {createContext, useContext, useMemo} from 'react'
import {createContext, useContext, useMemo} from 'react'

interface Features {
button: boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import styled from 'styled-components'

const Thing = styled.div`
Expand Down
7 changes: 4 additions & 3 deletions dev/embedded-studio/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react'
import {StrictMode} from 'react'
import ReactDOM from 'react-dom/client'
// eslint-disable-next-line import/no-unassigned-import
import './index.css'
import {App} from './App'

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<StrictMode>
<App />
</React.StrictMode>,
</StrictMode>,
)
1 change: 0 additions & 1 deletion dev/strict-studio/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import {DefaultDocument} from 'sanity'

export default function Document(props) {
Expand Down
2 changes: 1 addition & 1 deletion dev/strict-studio/entry.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {StrictMode} from 'react'
import {StrictMode} from 'react'
import {createRoot} from 'react-dom/client'
import {Studio} from 'sanity'
import config from './sanity.config'
Expand Down
1 change: 0 additions & 1 deletion dev/studio-e2e-testing/components-api/StudioLogo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Box} from '@sanity/ui'
import React from 'react'
import {LogoProps} from 'sanity'

export function StudioLogo(props: LogoProps & {testId: string}) {
Expand Down
7 changes: 3 additions & 4 deletions dev/test-next-studio/app/registry.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// https://beta.nextjs.org/docs/styling/css-in-js#styled-components

'use client'

import React, {useState} from 'react'
import {ReactNode, useState} from 'react'
import {useServerInsertedHTML} from 'next/navigation'
import {ServerStyleSheet, StyleSheetManager} from 'styled-components'

export default function StyledComponentsRegistry({children}: {children: React.ReactNode}) {
export default function StyledComponentsRegistry({children}: {children: ReactNode}) {
// Only create stylesheet once with lazy initial state
// x-ref: https://reactjs.org/docs/hooks-reference.html#lazy-initial-state
const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet())
Expand All @@ -22,7 +21,7 @@ export default function StyledComponentsRegistry({children}: {children: React.Re

return (
<StyleSheetManager sheet={styledComponentsStyleSheet.instance}>
{children as React.ReactNode}
{children as ReactNode}
</StyleSheetManager>
)
}
1 change: 0 additions & 1 deletion dev/test-studio/assetSources/imageAssetSource.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {ImagesIcon} from '@sanity/icons'
import {AssetSource, AssetSourceComponentProps} from '@sanity/types'
import {Box, Dialog, Text} from '@sanity/ui'
import React from 'react'

function ImageAssetSource(props: AssetSourceComponentProps) {
const {dialogHeaderTitle, onClose, ...restProps} = props
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/components/TranslateExample.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Translate, useTranslation} from 'sanity'
import React from 'react'
import {Card, Stack, Text} from '@sanity/ui'
import {InfoFilledIcon} from '@sanity/icons'

Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/components/deskTool/LanguageFilter.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {SchemaType} from '@sanity/types'
import {Card, Text} from '@sanity/ui'
import React from 'react'

export function LanguageFilter(props: {schemaType: SchemaType}) {
return (
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/components/documentViews/jsonPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Box, Card, Code} from '@sanity/ui'
import React from 'react'

export function JSONPreviewDocumentView(props: any) {
return (
Expand Down
2 changes: 0 additions & 2 deletions dev/test-studio/components/formBuilder/ArrayFunctions.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

export const ArrayFunctions: any = () => {
return <div>ArrayFunctions</div>
}
2 changes: 0 additions & 2 deletions dev/test-studio/components/formBuilder/CustomMarkers.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

export const CustomMarkers: any = () => {
return <div>CustomMarkers</div>
}
2 changes: 0 additions & 2 deletions dev/test-studio/components/formBuilder/Markers.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

export const Markers: any = () => {
return <div>CustomMarkers</div>
}
1 change: 0 additions & 1 deletion dev/test-studio/components/formComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import {Card} from '@sanity/ui'
import {
definePlugin,
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/components/navbar/ToolMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Button, Flex} from '@sanity/ui'
import React from 'react'
import {ToolLink, ToolMenuProps} from 'sanity'

export function ToolMenu(props: ToolMenuProps) {
Expand Down
5 changes: 3 additions & 2 deletions dev/test-studio/components/panes/JsonDocumentDump.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {useClient} from 'sanity'
import {SanityDocument} from '@sanity/types'
import {Box, Code, Flex, Spinner, Text} from '@sanity/ui'
import React, {
import {
ForwardedRef,
forwardRef,
useCallback,
useEffect,
Expand All @@ -13,7 +14,7 @@ import {Subscription} from 'rxjs'

export const JsonDocumentDump = forwardRef(function JsonDocumentDump(
props: {itemId: string},
ref: React.ForwardedRef<{actionHandlers: Record<string, () => void>}>,
ref: ForwardedRef<{actionHandlers: Record<string, () => void>}>,
) {
const {itemId} = props
const client = useClient({apiVersion: '2022-09-09'})
Expand Down
3 changes: 2 additions & 1 deletion dev/test-studio/components/panes/debug/DebugPane.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {UserComponent, usePaneRouter} from 'sanity/structure'
import {ChevronDownIcon, ChevronRightIcon, ControlsIcon, LinkIcon} from '@sanity/icons'
import {Box, Card, Code, Flex, Stack, Text} from '@sanity/ui'
import React, {useMemo} from 'react'
import {useMemo} from 'react'
import * as React from 'react'

function usePaneChildLinkComponent(props: {
id: string
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/components/studioComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {createContext, useContext} from 'react'
import {createContext, useContext} from 'react'
import {Box, Card, Flex, Stack, Text} from '@sanity/ui'
import {LogoProps, NavbarProps, LayoutProps, definePlugin, ToolMenuProps} from 'sanity'

Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/components/workspaceLogos.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import {useColorScheme} from 'sanity'

export const VercelLogo = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {DocumentActionComponent, DocumentActionDescription} from 'sanity'
import {CheckmarkCircleIcon, CloseCircleIcon} from '@sanity/icons'
import {Button, Text, useToast} from '@sanity/ui'
import React, {useCallback, useMemo, useState} from 'react'
import {useCallback, useMemo, useState} from 'react'

export const TestConfirmDialogAction: DocumentActionComponent = (props) => {
const {onComplete} = props
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Button, Card, Dialog, Stack, Text} from '@sanity/ui'
import {DocumentActionComponent} from 'sanity'
import React, {useCallback, useState} from 'react'
import {useCallback, useState} from 'react'

export const TestCustomComponentAction: DocumentActionComponent = () => {
const [open, setOpen] = useState<boolean>(false)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {DocumentActionComponent, DocumentActionDescription} from 'sanity'
import {CopyIcon} from '@sanity/icons'
import {Button, Grid, Text, useToast} from '@sanity/ui'
import React, {useCallback, useMemo, useState} from 'react'
import {useCallback, useMemo, useState} from 'react'

export const TestModalDialogAction: DocumentActionComponent = (props) => {
const {onComplete} = props
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {DocumentActionComponent, DocumentActionDescription} from 'sanity'
import {LaunchIcon} from '@sanity/icons'
import {Button, Stack, Text, useToast} from '@sanity/ui'
import React, {useCallback, useMemo, useState} from 'react'
import {useCallback, useMemo, useState} from 'react'

export const TestPopoverDialogAction: DocumentActionComponent = (props) => {
const {onComplete} = props
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/fieldActions/PrivateIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {LockIcon} from '@sanity/icons'
import {Text, Tooltip} from '@sanity/ui'
import React from 'react'

export function PrivateIcon() {
return (
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/inspectors/custom/inspector.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Box, Card, Flex, Text} from '@sanity/ui'
import React from 'react'
import {DocumentInspectorProps} from 'sanity'
import {DocumentInspectorHeader} from 'sanity/structure'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {TranslateIcon} from '@sanity/icons'
import {Box, Button, Card, Checkbox, Flex, Popover, Stack, Text, useClickOutside} from '@sanity/ui'
import React, {FormEvent, useCallback, useState} from 'react'
import {FormEvent, useCallback, useState} from 'react'
import {ObjectSchemaType} from 'sanity'
import {LanguageFilterPluginOptions} from './types'
import {usePaneLanguages} from './usePaneLanguages'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {pathFor} from '@sanity/util/paths'
import React, {useMemo} from 'react'
import {useMemo} from 'react'
import {
FieldError,
FieldMember,
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/plugins/language-filter/plugin.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import {definePlugin, ObjectInputProps, _DocumentLanguageFilterComponent} from 'sanity'
import {LanguageFilterMenuButton} from './LanguageFilterMenuButton'
import {LanguageFilterObjectInput} from './LanguageFilterObjectInput'
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/plugins/presence/Presence3D.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable react/no-unknown-property */
// Fork of https://codesandbox.io/s/object-clump-ssbdsw

import React, {memo, useState} from 'react'
import {memo, useState} from 'react'

import {Physics, useCylinder, useSphere} from '@react-three/cannon'
import {Effects as EffectComposer, Environment, Sky, useTexture} from '@react-three/drei'
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/plugins/router-debug/RouterDebug.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import {Button, Card, Code, Flex, Stack, Text} from '@sanity/ui'
import {IntentLink, RouteScope, StateLink, useRouter, useStateLink} from 'sanity/router'

Expand Down
12 changes: 10 additions & 2 deletions dev/test-studio/schema/debug/components/AuthorReferenceInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ import {ObjectInputProps, set, setIfMissing, unset, useClient} from 'sanity'
import imageUrlBuilder from '@sanity/image-url'
import {Reference, ReferenceSchemaType} from '@sanity/types'
import {Button, Spinner} from '@sanity/ui'
import React, {forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState} from 'react'
import {
ForwardedRef,
forwardRef,
useEffect,
useImperativeHandle,
useMemo,
useRef,
useState,
} from 'react'
import styles from './AuthorReferenceInput.module.css'

const noop = () => null
Expand All @@ -15,7 +23,7 @@ interface AuthorReference {

export const AuthorReferenceInput = forwardRef(function AuthorReferenceInput(
props: ObjectInputProps<Reference, ReferenceSchemaType>,
ref: React.ForwardedRef<any>,
ref: ForwardedRef<any>,
) {
// @todo fix
const {inputProps, type, value} = props
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {set, StringInputProps} from 'sanity'
import React from 'react'
import {Component} from 'react'
import styles from './CustomFontStringInput.module.css'

export default class CustomStringInput extends React.Component<StringInputProps> {
export default class CustomStringInput extends Component<StringInputProps> {
handleChange = (event) => {
this.props.onChange(set(event.target.value))
}
Expand Down
Loading

0 comments on commit 9aabbb0

Please sign in to comment.