From 1cc34cd83b8f0b4407889136c3443ef6b6abf7a4 Mon Sep 17 00:00:00 2001 From: Ashwin P Chandran Date: Mon, 5 Feb 2024 16:55:25 -0800 Subject: [PATCH] Update toggle to button (#5808) Signed-off-by: Ashwin P Chandran --- .../components/top_nav/get_top_nav_links.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/plugins/discover/public/application/components/top_nav/get_top_nav_links.tsx b/src/plugins/discover/public/application/components/top_nav/get_top_nav_links.tsx index df550e40f203..a4e1a7ca51ad 100644 --- a/src/plugins/discover/public/application/components/top_nav/get_top_nav_links.tsx +++ b/src/plugins/discover/public/application/components/top_nav/get_top_nav_links.tsx @@ -222,13 +222,18 @@ export const getTopNavLinks = ( }, }; + const newDiscoverButtonLabel = i18n.translate('discover.localMenu.discoverButton.label.new', { + defaultMessage: 'Try new Discover', + }); + const oldDiscoverButtonLabel = i18n.translate('discover.localMenu.discoverButton.label.old', { + defaultMessage: 'Use legacy Discover', + }); + const isNewDiscover = getDataGridTableSetting(storage); const newTable: TopNavMenuData = { id: 'table-datagrid', - label: i18n.translate('discover.localMenu.newTableTitle', { - defaultMessage: 'Try new Discover experience', - }), + label: isNewDiscover ? oldDiscoverButtonLabel : newDiscoverButtonLabel, description: i18n.translate('discover.localMenu.newTableDescription', { - defaultMessage: 'New Data Grid Table Experience', + defaultMessage: 'New Discover toggle Experience', }), testId: 'datagridTableButton', run: async () => { @@ -245,8 +250,7 @@ export const getTopNavLinks = ( window.location.reload(); } }, - type: 'toggle' as const, - emphasize: getDataGridTableSetting(storage), + iconType: isNewDiscover ? 'editorUndo' : 'cheer', }; return [