Skip to content

Commit

Permalink
Update toggle to button (opensearch-project#5808)
Browse files Browse the repository at this point in the history
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
  • Loading branch information
ashwin-pc committed Feb 6, 2024
1 parent 9781ac9 commit 1cc34cd
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -245,8 +250,7 @@ export const getTopNavLinks = (
window.location.reload();
}
},
type: 'toggle' as const,
emphasize: getDataGridTableSetting(storage),
iconType: isNewDiscover ? 'editorUndo' : 'cheer',
};

return [
Expand Down

0 comments on commit 1cc34cd

Please sign in to comment.