diff --git a/packages/ui/src/components/Button.tsx b/packages/ui/src/components/Button.tsx index d303e6786..abead28d0 100644 --- a/packages/ui/src/components/Button.tsx +++ b/packages/ui/src/components/Button.tsx @@ -19,6 +19,7 @@ import usePrevious from "./hooks/usePrevious"; import Hoverable from "./Hoverable"; import Icon from "./Icon"; import { IconName, IconPosition } from "./IconShared"; +import Tooltip from "./Tooltip"; export type ButtonPendingActivationState = "hover" | "pressed" | null; @@ -50,6 +51,7 @@ export type ButtonProps = ButtonContents & numberOfLines?: number; ellipsizeMode?: TextProps["ellipsizeMode"]; focusOnMount?: boolean; + tooltipText?: string; }; const pressedButtonOpacity = 0.2; @@ -196,7 +198,7 @@ const styles = StyleSheet.create({ }); export default React.memo(function Button(props: ButtonProps) { - const { onPendingInteractionStateDidChange, style } = props; + const { onPendingInteractionStateDidChange, style, tooltipText } = props; const ref = React.useRef(null); const href = "href" in props ? props.href : null; const onPress = "onPress" in props ? props.onPress : null; @@ -280,11 +282,22 @@ export default React.memo(function Button(props: ButtonProps) { style={[isSoloIcon && styles.soloIcon, style]} > {({ pressed }) => ( - + + {tooltipText && ( + + {tooltipText} + + )} + + )} )} diff --git a/packages/ui/src/components/ReviewButtonBar.tsx b/packages/ui/src/components/ReviewButtonBar.tsx index f35d0ea7d..64a73ba41 100644 --- a/packages/ui/src/components/ReviewButtonBar.tsx +++ b/packages/ui/src/components/ReviewButtonBar.tsx @@ -168,6 +168,7 @@ const ReviewButtonBar = React.memo(function ReviewButtonArea({ dispatchPendingMarkingInteraction(); }} hitSlop={firstButtonSlop} + tooltipText={"Shortcut: 1"} /> {spacer}