feat(editor): Tooltip support multiple fineTypes (#28)

This commit is contained in:
Eric Tuvesson
2024-05-31 08:58:17 +02:00
committed by GitHub
parent 8e16d5f9d4
commit 1a048587d9
2 changed files with 16 additions and 5 deletions

View File

@@ -11,7 +11,7 @@ import css from './Tooltip.module.scss';
export interface TooltipProps extends UnsafeStyleProps { export interface TooltipProps extends UnsafeStyleProps {
content: SingleSlot; content: SingleSlot;
fineType?: string; fineType?: string | string[];
children: Slot; children: Slot;
showAfterMs?: number; showAfterMs?: number;
@@ -79,9 +79,17 @@ export function Tooltip({
{fineType && ( {fineType && (
<div className={css['FineType']}> <div className={css['FineType']}>
<Label size={LabelSize.Small} variant={TextType.Secondary}> {Array.isArray(fineType) ? (
{fineType} fineType.map((x) => (
</Label> <Label size={LabelSize.Small} variant={TextType.Secondary}>
{x}
</Label>
))
) : (
<Label size={LabelSize.Small} variant={TextType.Secondary}>
{fineType}
</Label>
)}
</div> </div>
)} )}
</BaseDialog> </BaseDialog>

View File

@@ -123,7 +123,10 @@ export function CloudServiceCard({
{isEditorEnvironment && ( {isEditorEnvironment && (
<Tooltip <Tooltip
content="Open the Parse Dashboard" content="Open the Parse Dashboard"
fineType={`${Keybindings.CLOUD_SERVICE_OPEN_DASHBOARD.label} in window or ${Keybindings.CLOUD_SERVICE_OPEN_DASHBOARD_BROWSER.label} to open in browsers`} fineType={[
`In Window: ${Keybindings.CLOUD_SERVICE_OPEN_DASHBOARD.label}`,
`In Browser: ${Keybindings.CLOUD_SERVICE_OPEN_DASHBOARD_BROWSER.label}`
]}
renderDirection={DialogRenderDirection.Below} renderDirection={DialogRenderDirection.Below}
> >
<PrimaryButton <PrimaryButton