From 29c99706d9ee2cb5c99e8ff19cb158e61e3ddb53 Mon Sep 17 00:00:00 2001 From: Jordan Lawrence Date: Mon, 13 Jan 2025 21:14:31 +0000 Subject: [PATCH] feat: tasks tool defines own render method for nav bar link --- .../sanity/src/core/tasks/i18n/resources.ts | 3 ++ .../core/tasks/plugin/TasksStudioNavbar.tsx | 33 +++++++++++++++---- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/packages/sanity/src/core/tasks/i18n/resources.ts b/packages/sanity/src/core/tasks/i18n/resources.ts index 8570bcafdc2..aab0a324729 100644 --- a/packages/sanity/src/core/tasks/i18n/resources.ts +++ b/packages/sanity/src/core/tasks/i18n/resources.ts @@ -155,12 +155,15 @@ const tasksLocaleStrings = defineLocalesResources('tasks', { 'panel.navigation.tooltip': 'Open tasks', /** Title of the Tasks panel */ 'panel.title': 'Tasks', + /** Label for the Assigned Tab */ 'tab.assigned.label': 'Assigned', /** Label for the Active Document Tab */ 'tab.document.label': 'Active Document', /** Label for the Subscribed Tab */ 'tab.subscribed.label': 'Subscribed', + /** Tooltip for the tasks navbar icon */ + 'toolbar.tooltip': 'Tasks', }) /** diff --git a/packages/sanity/src/core/tasks/plugin/TasksStudioNavbar.tsx b/packages/sanity/src/core/tasks/plugin/TasksStudioNavbar.tsx index ffd619463a3..928844d4904 100644 --- a/packages/sanity/src/core/tasks/plugin/TasksStudioNavbar.tsx +++ b/packages/sanity/src/core/tasks/plugin/TasksStudioNavbar.tsx @@ -1,6 +1,7 @@ -import {PanelRightIcon, TaskIcon} from '@sanity/icons' +import {CheckmarkCircleIcon} from '@sanity/icons' import {useCallback, useMemo} from 'react' +import {Button} from '../../../ui-components' import {type NavbarProps} from '../../config' import {useTranslation} from '../../i18n' import {useTasksEnabled, useTasksNavigation} from '../context' @@ -8,6 +9,22 @@ import {tasksLocaleNamespace} from '../i18n' const EMPTY_ARRAY: [] = [] +const TasksToolbar = ({onClick, isOpen}: {onClick: () => void; isOpen: boolean}) => { + const {t} = useTranslation(tasksLocaleNamespace) + + return ( +