From 3945ec96e9489d327ab77b2211b696731715fb6f Mon Sep 17 00:00:00 2001 From: Nina Andal Aarvik Date: Thu, 19 Oct 2023 13:31:01 +0200 Subject: [PATCH 01/12] feat(facelift): create StudioUI tooltip with delay and replace --- .../formField/FormFieldValidationStatus.tsx | 5 ++- .../CrossDatasetReferencePreview.tsx | 15 +++---- .../ReferenceInput/PreviewReferenceValue.tsx | 7 +-- .../ReferenceInput/ReferencePreview.tsx | 43 +++++++++---------- .../navbar/new-document/NewDocumentButton.tsx | 6 +-- .../navbar/resources/ResourcesButton.tsx | 9 ++-- .../filters/addFilter/items/FilterTooltip.tsx | 5 ++- .../addFilter/items/MenuItemFilter.tsx | 22 +--------- .../components/navbar/userMenu/UserMenu.tsx | 10 +---- .../navbar/workspace/WorkspaceMenuButton.tsx | 8 +--- .../src/desk/components/DraftStatus.tsx | 19 ++++---- .../src/desk/components/PublishedStatus.tsx | 19 ++++---- .../header/DocumentPanelHeader.tsx | 4 +- .../statusBar/DocumentStatusBarActions.tsx | 5 ++- .../ReviewChangesButton.tsx | 5 ++- packages/sanity/src/ui/tooltip/Tooltip.tsx | 25 ++--------- 16 files changed, 78 insertions(+), 129 deletions(-) diff --git a/packages/sanity/src/core/form/components/formField/FormFieldValidationStatus.tsx b/packages/sanity/src/core/form/components/formField/FormFieldValidationStatus.tsx index a718514b6a0..a4390dad26a 100644 --- a/packages/sanity/src/core/form/components/formField/FormFieldValidationStatus.tsx +++ b/packages/sanity/src/core/form/components/formField/FormFieldValidationStatus.tsx @@ -3,9 +3,10 @@ import {hues} from '@sanity/color' import {ErrorOutlineIcon, InfoOutlineIcon, WarningOutlineIcon} from '@sanity/icons' import {FormNodeValidation} from '@sanity/types' -import {Box, Flex, Placement, Stack, Text, Tooltip} from '@sanity/ui' +import {Box, Flex, Placement, Stack, Text} from '@sanity/ui' import React, {useMemo} from 'react' import styled from 'styled-components' +import {Tooltip} from '../../../../ui' /** @internal */ export interface FormFieldValidationStatusProps { @@ -98,7 +99,7 @@ export function FormFieldValidationStatus(props: FormFieldValidationStatusProps) return ( + {showSummary && } {!showSummary && ( diff --git a/packages/sanity/src/core/form/inputs/CrossDatasetReferenceInput/CrossDatasetReferencePreview.tsx b/packages/sanity/src/core/form/inputs/CrossDatasetReferenceInput/CrossDatasetReferencePreview.tsx index c39f1d343b5..6b597249a3b 100644 --- a/packages/sanity/src/core/form/inputs/CrossDatasetReferenceInput/CrossDatasetReferencePreview.tsx +++ b/packages/sanity/src/core/form/inputs/CrossDatasetReferenceInput/CrossDatasetReferencePreview.tsx @@ -1,24 +1,23 @@ import React, {createElement, ReactNode, useMemo} from 'react' import {CrossDatasetType, PreviewValue} from '@sanity/types' -import {Box, Flex, Inline, Label, Text, Tooltip} from '@sanity/ui' +import {Box, Flex, Inline, Label, Text} from '@sanity/ui' import {AccessDeniedIcon, HelpCircleIcon, LaunchIcon} from '@sanity/icons' import imageUrlBuilder from '@sanity/image-url' import {isImageSource} from '@sanity/asset-utils' import {DocumentAvailability} from '../../../preview' import {DefaultPreview, PreviewMediaDimensions, TextWithTone} from '../../../components' +import {Tooltip} from '../../../../ui' import {FIXME} from '../../../FIXME' import {StyledPreviewFlex, TooltipContent} from './CrossDatasetReferencePreview.styled' function UnavailableMessage(props: {children: ReactNode}) { return ( - + - - - {props.children} - - + + {props.children} + ) @@ -141,7 +140,7 @@ export function CrossDatasetReferencePreview(props: { + {hasStudioUrl ? ( This document opens in a new tab ) : ( diff --git a/packages/sanity/src/core/form/inputs/ReferenceInput/PreviewReferenceValue.tsx b/packages/sanity/src/core/form/inputs/ReferenceInput/PreviewReferenceValue.tsx index 09d32a0f70c..306559dfdb9 100644 --- a/packages/sanity/src/core/form/inputs/ReferenceInput/PreviewReferenceValue.tsx +++ b/packages/sanity/src/core/form/inputs/ReferenceInput/PreviewReferenceValue.tsx @@ -1,10 +1,11 @@ import React, {ComponentType, ReactNode, Fragment} from 'react' import {Reference, ReferenceSchemaType} from '@sanity/types' -import {Box, Flex, Inline, Label, Stack, Text, Tooltip} from '@sanity/ui' +import {Box, Flex, Inline, Label, Stack, Text} from '@sanity/ui' import {AccessDeniedIcon, HelpCircleIcon} from '@sanity/icons' import {RenderPreviewCallback} from '../../types' import {SanityDefaultPreview} from '../../../preview' import {TextWithTone} from '../../../components' +import {Tooltip} from '../../../../ui' import {ReferencePreview} from './ReferencePreview' import {Loadable} from './useReferenceInfo' import {ReferenceInfo} from './types' @@ -142,7 +143,7 @@ export function PreviewReferenceValue(props: { function UnavailableMessage(props: {icon: ComponentType; children: ReactNode; title: ReactNode}) { const Icon = props.icon return ( - + @@ -177,7 +178,7 @@ function InvalidType(props: {documentId: string; actualType: string; declaredTyp + Referenced document ({props.documentId}) is of type{' '} {props.actualType}. diff --git a/packages/sanity/src/core/form/inputs/ReferenceInput/ReferencePreview.tsx b/packages/sanity/src/core/form/inputs/ReferenceInput/ReferencePreview.tsx index 87d4d413de9..cbd68497dad 100644 --- a/packages/sanity/src/core/form/inputs/ReferenceInput/ReferencePreview.tsx +++ b/packages/sanity/src/core/form/inputs/ReferenceInput/ReferencePreview.tsx @@ -1,11 +1,12 @@ import React, {useMemo} from 'react' import {ObjectSchemaType} from '@sanity/types' -import {Box, Flex, Inline, Label, Text, Tooltip, useRootTheme} from '@sanity/ui' +import {Box, Flex, Inline, Label, Text, useRootTheme} from '@sanity/ui' import {EditIcon, PublishIcon} from '@sanity/icons' import {RenderPreviewCallback} from '../../types' import {PreviewLayoutKey, TextWithTone} from '../../../components' import {useDocumentPresence} from '../../../store' import {DocumentPreviewPresence} from '../../../presence' +import {Tooltip} from '../../../../ui' import {TimeAgo} from './utils/TimeAgo' import {ReferenceInfo} from './types' @@ -74,17 +75,15 @@ export function ReferencePreview(props: { - - {preview.published?._updatedAt ? ( - <> - Published - - ) : ( - <>Not published - )} - - + + {preview.published?._updatedAt ? ( + <> + Published + + ) : ( + <>Not published + )} + } > - - {preview.draft?._updatedAt ? ( - <> - Edited - - ) : ( - <>No unpublished edits - )} - - + + {preview.draft?._updatedAt ? ( + <> + Edited + + ) : ( + <>No unpublished edits + )} + } > ({ - content: {tooltipContent}, + content: {tooltipContent}, disabled: loading || open, placement: 'bottom', portal: true, diff --git a/packages/sanity/src/core/studio/components/navbar/resources/ResourcesButton.tsx b/packages/sanity/src/core/studio/components/navbar/resources/ResourcesButton.tsx index c017fbc12fb..ddc2ea9c1b8 100644 --- a/packages/sanity/src/core/studio/components/navbar/resources/ResourcesButton.tsx +++ b/packages/sanity/src/core/studio/components/navbar/resources/ResourcesButton.tsx @@ -1,8 +1,9 @@ import {HelpCircleIcon} from '@sanity/icons' -import {Box, Button, Flex, Menu, MenuButton, Text, Tooltip} from '@sanity/ui' +import {Button, Flex, Menu, MenuButton, Text} from '@sanity/ui' import React, {useCallback, useState} from 'react' import styled from 'styled-components' import {useColorScheme} from '../../../colorScheme' +import {Tooltip} from '../../../../../ui' import {useGetHelpResources} from './helper-functions/hooks' import {ResourcesMenuItems} from './ResourcesMenuItems' @@ -23,11 +24,7 @@ export function ResourcesButton() { return ( - Help and resources - - } + content={Help and resources} scheme={scheme} placement="bottom" portal diff --git a/packages/sanity/src/core/studio/components/navbar/search/components/filters/addFilter/items/FilterTooltip.tsx b/packages/sanity/src/core/studio/components/navbar/search/components/filters/addFilter/items/FilterTooltip.tsx index 76e5ec1d2fa..df3fc758b8e 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/components/filters/addFilter/items/FilterTooltip.tsx +++ b/packages/sanity/src/core/studio/components/navbar/search/components/filters/addFilter/items/FilterTooltip.tsx @@ -1,8 +1,9 @@ -import {Card, Code, Flex, Inline, Label, Stack, Text, Tooltip} from '@sanity/ui' +import {Card, Code, Flex, Inline, Label, Stack, Text} from '@sanity/ui' import {startCase, uniq} from 'lodash' import React, {ReactElement, useMemo} from 'react' import {useSchema} from '../../../../../../../../hooks' import {isNonNullable} from '../../../../../../../../util' +import {Tooltip} from '../../../../../../../../../ui' import {useSearchState} from '../../../../contexts/search/useSearchState' import type {SearchFieldDefinition} from '../../../../definitions/fields' import type {SearchFilterDefinition} from '../../../../definitions/filters' @@ -75,7 +76,7 @@ export function FilterTooltip({ - + {/* Field name */} {fieldDefinition && ( diff --git a/packages/sanity/src/core/studio/components/navbar/search/components/filters/addFilter/items/MenuItemFilter.tsx b/packages/sanity/src/core/studio/components/navbar/search/components/filters/addFilter/items/MenuItemFilter.tsx index dea885d2502..6e4a1d5c3cc 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/components/filters/addFilter/items/MenuItemFilter.tsx +++ b/packages/sanity/src/core/studio/components/navbar/search/components/filters/addFilter/items/MenuItemFilter.tsx @@ -1,5 +1,5 @@ import {Box, Button, ResponsiveMarginProps, ResponsivePaddingProps} from '@sanity/ui' -import React, {useCallback, useEffect, useRef, useState} from 'react' +import React, {useCallback} from 'react' import {useSearchState} from '../../../../contexts/search/useSearchState' import type {FilterMenuItemFilter} from '../../../../types' import {getFilterKey} from '../../../../utils/filterUtils' @@ -16,8 +16,6 @@ export const MenuItemFilter = React.memo(function MenuItemFilter({ onClose, ...rest }: FilterMenuItemProps) { - const [tooltipVisible, setTooltipVisible] = useState(false) - const { dispatch, state: {filters}, @@ -30,20 +28,6 @@ export const MenuItemFilter = React.memo(function MenuItemFilter({ const isAlreadyActive = !!filters.find((f) => getFilterKey(f) === getFilterKey(item.filter)) - const timeoutRef = useRef>() - - const handleMouseEnter = useCallback(() => { - timeoutRef.current = setTimeout(() => setTooltipVisible(true), 500) - }, []) - const handleMouseLeave = useCallback(() => { - setTooltipVisible(false) - clearTimeout(timeoutRef.current) - }, []) - - useEffect(() => { - return () => clearTimeout(timeoutRef.current) - }, []) - // Only enable tooltips if an associated field definition exists, or the filter has a valid description const tooltipEnabled = !!(item.fieldDefinition || item.filterDefinition.description) @@ -55,8 +39,6 @@ export const MenuItemFilter = React.memo(function MenuItemFilter({ justify="flex-start" mode="bleed" onClick={isAlreadyActive ? undefined : handleClick} - onMouseEnter={handleMouseEnter} - onMouseLeave={handleMouseLeave} padding={0} style={{position: 'relative', whiteSpace: 'normal', width: '100%'}} tabIndex={-1} @@ -65,7 +47,7 @@ export const MenuItemFilter = React.memo(function MenuItemFilter({ diff --git a/packages/sanity/src/core/studio/components/navbar/userMenu/UserMenu.tsx b/packages/sanity/src/core/studio/components/navbar/userMenu/UserMenu.tsx index ad170be1d69..de89976dbca 100644 --- a/packages/sanity/src/core/studio/components/navbar/userMenu/UserMenu.tsx +++ b/packages/sanity/src/core/studio/components/navbar/userMenu/UserMenu.tsx @@ -12,13 +12,13 @@ import { MenuItem, Stack, Text, - Tooltip, } from '@sanity/ui' import React, {useMemo} from 'react' import styled from 'styled-components' import {UserAvatar} from '../../../../components' import {getProviderTitle} from '../../../../store' import {type StudioThemeColorSchemeKey} from '../../../../theme' +import {Tooltip} from '../../../../../ui' import { useColorSchemeOptions, useColorSchemeSetValue, @@ -109,13 +109,7 @@ export function UserMenu() { - Signed in with {providerTitle} - - ) - } + content={providerTitle && Signed in with {providerTitle}} > diff --git a/packages/sanity/src/core/studio/components/navbar/workspace/WorkspaceMenuButton.tsx b/packages/sanity/src/core/studio/components/navbar/workspace/WorkspaceMenuButton.tsx index 67fc4f3d7dd..9275c4832fe 100644 --- a/packages/sanity/src/core/studio/components/navbar/workspace/WorkspaceMenuButton.tsx +++ b/packages/sanity/src/core/studio/components/navbar/workspace/WorkspaceMenuButton.tsx @@ -7,7 +7,6 @@ import { MenuButtonProps, Box, Label, - Tooltip, Text, Stack, } from '@sanity/ui' @@ -16,6 +15,7 @@ import styled from 'styled-components' import {useActiveWorkspace} from '../../../activeWorkspaceMatcher' import {useColorScheme} from '../../../colorScheme' import {useWorkspaces} from '../../../workspaces' +import {Tooltip} from '../../../../../ui' import {useWorkspaceAuthStates} from './hooks' import {WorkspacePreview} from './WorkspacePreview' import {useRouter} from 'sanity/router' @@ -54,11 +54,7 @@ export function WorkspaceMenuButton(props: WorkspaceMenuButtonProps) { return ( - Select workspace - - } + content={Select workspace} disabled={tooltipDisabled} placement="bottom" portal diff --git a/packages/sanity/src/desk/components/DraftStatus.tsx b/packages/sanity/src/desk/components/DraftStatus.tsx index 19c2e04b2fa..16f5e59587d 100644 --- a/packages/sanity/src/desk/components/DraftStatus.tsx +++ b/packages/sanity/src/desk/components/DraftStatus.tsx @@ -1,7 +1,8 @@ import React from 'react' import {EditIcon} from '@sanity/icons' import {PreviewValue, SanityDocument} from '@sanity/types' -import {Box, Text, Tooltip} from '@sanity/ui' +import {Text} from '@sanity/ui' +import {Tooltip} from '../../ui' import {TimeAgo} from './TimeAgo' import {TextWithTone} from 'sanity' @@ -13,15 +14,13 @@ export function DraftStatus(props: {document?: PreviewValue | Partial - - {document ? ( - <>Edited {updatedAt && } - ) : ( - <>No unpublished edits - )} - - + + {document ? ( + <>Edited {updatedAt && } + ) : ( + <>No unpublished edits + )} + } > diff --git a/packages/sanity/src/desk/components/PublishedStatus.tsx b/packages/sanity/src/desk/components/PublishedStatus.tsx index 0f257979df1..dc0d7c15f69 100644 --- a/packages/sanity/src/desk/components/PublishedStatus.tsx +++ b/packages/sanity/src/desk/components/PublishedStatus.tsx @@ -1,7 +1,8 @@ import React from 'react' import {PublishIcon} from '@sanity/icons' import {PreviewValue, SanityDocument} from '@sanity/types' -import {Box, Text, Tooltip} from '@sanity/ui' +import {Text} from '@sanity/ui' +import {Tooltip} from '../../ui' import {TimeAgo} from './TimeAgo' import {TextWithTone} from 'sanity' @@ -14,15 +15,13 @@ export function PublishedStatus(props: {document?: PreviewValue | Partial - - {document ? ( - <>Published {updatedAt && } - ) : ( - <>Not published - )} - - + + {document ? ( + <>Published {updatedAt && } + ) : ( + <>Not published + )} + } > diff --git a/packages/sanity/src/desk/panes/document/documentPanel/header/DocumentPanelHeader.tsx b/packages/sanity/src/desk/panes/document/documentPanel/header/DocumentPanelHeader.tsx index b8a8efa4169..dd2567f3618 100644 --- a/packages/sanity/src/desk/panes/document/documentPanel/header/DocumentPanelHeader.tsx +++ b/packages/sanity/src/desk/panes/document/documentPanel/header/DocumentPanelHeader.tsx @@ -1,5 +1,5 @@ import {ArrowLeftIcon, CloseIcon, SplitVerticalIcon} from '@sanity/icons' -import {Button, Flex, Text, Tooltip} from '@sanity/ui' +import {Button, Flex, Text} from '@sanity/ui' import React, {createElement, memo, forwardRef, useMemo} from 'react' import { PaneContextMenuButton, @@ -12,6 +12,7 @@ import {TimelineMenu} from '../../timeline' import {useDocumentPane} from '../../useDocumentPane' import {isMenuNodeButton, isNotMenuNodeButton, resolveMenuNodes} from '../../../../menuNodes' import {useDeskTool} from '../../../../useDeskTool' +import {Tooltip} from '../../../../../ui' import {DocumentHeaderTabs} from './DocumentHeaderTabs' import {DocumentHeaderTitle} from './DocumentHeaderTitle' import {useFieldActions, useTimelineSelector} from 'sanity' @@ -116,7 +117,6 @@ export const DocumentPanelHeader = memo( Split pane right } - padding={2} placement="bottom" portal > diff --git a/packages/sanity/src/desk/panes/document/statusBar/DocumentStatusBarActions.tsx b/packages/sanity/src/desk/panes/document/statusBar/DocumentStatusBarActions.tsx index a377ba61636..e671ba7214d 100644 --- a/packages/sanity/src/desk/panes/document/statusBar/DocumentStatusBarActions.tsx +++ b/packages/sanity/src/desk/panes/document/statusBar/DocumentStatusBarActions.tsx @@ -1,7 +1,8 @@ -import {Box, Flex, Tooltip, Stack, Button, Hotkeys, LayerProvider, Text} from '@sanity/ui' +import {Box, Flex, Stack, Button, Hotkeys, LayerProvider, Text} from '@sanity/ui' import React, {memo, useMemo, useState} from 'react' import {RenderActionCollectionState} from '../../../components' import {HistoryRestoreAction} from '../../../documentActions' +import {Tooltip} from '../../../../ui' import {useDocumentPane} from '../useDocumentPane' import {ActionMenuButton} from './ActionMenuButton' import {ActionStateDialog} from './ActionStateDialog' @@ -22,7 +23,7 @@ function DocumentStatusBarActionsInner(props: DocumentStatusBarActionsInnerProps if (!firstActionState || (!firstActionState.title && !firstActionState.shortcut)) return null return ( - + {firstActionState.title} {firstActionState.shortcut && ( diff --git a/packages/sanity/src/desk/panes/document/statusBar/sparkline/ReviewChangesButton/ReviewChangesButton.tsx b/packages/sanity/src/desk/panes/document/statusBar/sparkline/ReviewChangesButton/ReviewChangesButton.tsx index 1f1cc80394e..6723d53896c 100644 --- a/packages/sanity/src/desk/panes/document/statusBar/sparkline/ReviewChangesButton/ReviewChangesButton.tsx +++ b/packages/sanity/src/desk/panes/document/statusBar/sparkline/ReviewChangesButton/ReviewChangesButton.tsx @@ -1,5 +1,6 @@ import React, {useMemo} from 'react' -import {Box, Button, ButtonProps, Flex, Stack, Text, Tooltip} from '@sanity/ui' +import {Box, Button, ButtonProps, Flex, Stack, Text} from '@sanity/ui' +import {Tooltip} from '../../../../../../ui' import {AnimatedStatusIcon} from './AnimatedStatusIcon' import {useTimeAgo} from 'sanity' @@ -51,7 +52,7 @@ const ReviewButton = React.forwardRef(function ReviewButton( portal disabled={status !== 'changes'} content={ - + Review changes diff --git a/packages/sanity/src/ui/tooltip/Tooltip.tsx b/packages/sanity/src/ui/tooltip/Tooltip.tsx index 77748f99edf..3d81f2b35d1 100644 --- a/packages/sanity/src/ui/tooltip/Tooltip.tsx +++ b/packages/sanity/src/ui/tooltip/Tooltip.tsx @@ -1,17 +1,7 @@ -import { - Text, - Tooltip as UITooltip, - TooltipProps as UITooltipProps, - HotkeysProps as UIHotkeysProps, -} from '@sanity/ui' +import {Tooltip as UITooltip, TooltipProps as UITooltipProps} from '@sanity/ui' import React from 'react' /** @internal */ -export interface TooltipProps - extends Pick, - Pick { - text: string -} /** * Studio UI . @@ -21,15 +11,6 @@ export interface TooltipProps * * @internal */ -export const Tooltip = ({text, ...rest}: TooltipProps) => { - return ( - - {text} - - } - {...rest} - /> - ) +export const Tooltip = ({...rest}: UITooltipProps) => { + return } From 046680383d520a6819b268b27db95d1b76e535d1 Mon Sep 17 00:00:00 2001 From: Nina Andal Aarvik Date: Thu, 19 Oct 2023 13:53:02 +0200 Subject: [PATCH 02/12] fix(core/desk): use StudioUi Tooltip --- .../components/InsufficientPermissionsMessage.tsx | 2 +- .../src/core/components/userAvatar/UserAvatar.tsx | 13 +++---------- .../__workshop__/customSchema/blockActions.tsx | 13 +++---------- .../inputs/PortableText/object/Annotation.tsx | 4 ++-- .../inputs/PortableText/object/BlockObject.tsx | 5 +++-- .../inputs/PortableText/object/InlineObject.tsx | 4 ++-- .../form/inputs/PortableText/text/TextBlock.tsx | 5 +++-- .../form/inputs/PortableText/toolbar/Toolbar.tsx | 5 +++-- .../form/inputs/ReferenceInput/CreateButton.tsx | 15 ++++----------- .../ArrayOfObjectsFunctions.tsx | 15 +++------------ .../ArrayOfPrimitivesFunctions.tsx | 5 +++-- .../src/core/form/studio/assetSource/AssetRow.tsx | 9 +++------ .../src/core/presence/DocumentPreviewPresence.tsx | 5 +++-- .../sanity/src/core/presence/PresenceTooltip.tsx | 5 +++-- .../studio/components/navbar/StudioNavbar.tsx | 2 -- .../ConfirmDeleteDialogBody.styles.tsx | 13 ++++++------- .../InsufficientPermissionsMessageTooltip.tsx | 7 +++---- .../panes/document/statusBar/ActionMenuButton.tsx | 8 ++------ .../statusBar/sparkline/PublishStatus.tsx | 5 +++-- 19 files changed, 53 insertions(+), 87 deletions(-) diff --git a/packages/sanity/src/core/components/InsufficientPermissionsMessage.tsx b/packages/sanity/src/core/components/InsufficientPermissionsMessage.tsx index c763e32af26..650e8ff205b 100644 --- a/packages/sanity/src/core/components/InsufficientPermissionsMessage.tsx +++ b/packages/sanity/src/core/components/InsufficientPermissionsMessage.tsx @@ -22,7 +22,7 @@ export function InsufficientPermissionsMessage(props: InsufficientPermissionsMes const plural = roles.length !== 1 return ( - + diff --git a/packages/sanity/src/core/components/userAvatar/UserAvatar.tsx b/packages/sanity/src/core/components/userAvatar/UserAvatar.tsx index ce22b510931..40316db344f 100644 --- a/packages/sanity/src/core/components/userAvatar/UserAvatar.tsx +++ b/packages/sanity/src/core/components/userAvatar/UserAvatar.tsx @@ -1,9 +1,10 @@ -import {Avatar, AvatarPosition, AvatarSize, AvatarStatus, Box, Text, Tooltip} from '@sanity/ui' +import {Avatar, AvatarPosition, AvatarSize, AvatarStatus, Text} from '@sanity/ui' import React, {forwardRef, useState} from 'react' import type {User} from '@sanity/types' import {useUser} from '../../store' import {isRecord} from '../../util' import {useUserColor} from '../../user-color' +import {Tooltip} from '../../../ui' /** * @hidden @@ -60,15 +61,7 @@ function TooltipUserAvatar(props: Omit & {user: User}) } = props return ( - - {displayName} - - } - placement="top" - portal - > + {displayName}} placement="top" portal>
diff --git a/packages/sanity/src/core/form/inputs/PortableText/__workshop__/customSchema/blockActions.tsx b/packages/sanity/src/core/form/inputs/PortableText/__workshop__/customSchema/blockActions.tsx index d6b68fdf6f7..f6113f3a800 100644 --- a/packages/sanity/src/core/form/inputs/PortableText/__workshop__/customSchema/blockActions.tsx +++ b/packages/sanity/src/core/form/inputs/PortableText/__workshop__/customSchema/blockActions.tsx @@ -1,9 +1,10 @@ -import {Box, Button, Text, Tooltip} from '@sanity/ui' +import {Button, Text} from '@sanity/ui' import React, {memo, useCallback} from 'react' import {CopyIcon} from '@sanity/icons' import {keyGenerator} from '@sanity/portable-text-editor' import {PortableTextBlock, PortableTextTextBlock} from '@sanity/types' import {RenderBlockActionsCallback} from '../../types' +import {Tooltip} from '../../../../../../ui' const BlockActions = memo(function BlockActions(props: { block: PortableTextBlock @@ -28,15 +29,7 @@ const BlockActions = memo(function BlockActions(props: { }, [block, insert]) return ( - - Duplicate -
- } - placement="right" - portal="default" - > + Duplicate} placement="right" portal="default">