From 4193383deca10f1feb4fef89aa1b23bc76c0b983 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Tue, 22 Mar 2022 14:33:57 -0500 Subject: [PATCH] explorer/Explorer: hoist button translations This makes for fewer props to pass. --- src/explorer/Explorer.tsx | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/src/explorer/Explorer.tsx b/src/explorer/Explorer.tsx index d7b2b29a..1a50c040 100644 --- a/src/explorer/Explorer.tsx +++ b/src/explorer/Explorer.tsx @@ -41,33 +41,27 @@ import './explorer.scss'; type ActionButtonProps = { /** The icon to use for the button. */ icon: IconName; - /** The tooltip translation ID for the tooltip text. */ - toolTipId: I18nId; - /** Replacements if required by `toolTipId` */ - toolTipReplacements?: { [key: string]: string }; + /** The tooltip/title text. */ + tooltip: string; /** If provided, controls button disabled state. */ disabled?: boolean; /** If false, prevent focus. Default is true. */ focusable?: boolean; - /** Translation context. */ - i18n: I18n; /** Callback for button click event. */ onClick: () => void; }; const ActionButton: React.VoidFunctionComponent = ({ icon, - toolTipId, - toolTipReplacements, + tooltip, disabled, focusable, - i18n, onClick, }) => { return (