Skip to content

Commit

Permalink
Enhance bottom navigation inbox tooltip with additional content and i…
Browse files Browse the repository at this point in the history
…mprove tooltip rendering logic
  • Loading branch information
ishpaul777 committed Dec 12, 2024
1 parent b74ab71 commit cd4d450
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/components/ProductTrainingContext/TOOLTIPS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const TOOLTIPS: Record<ProductTrainingTooltipName, TooltipData> = {
content: [
{text: 'productTrainingTooltip.bottomNavInboxTooltip.part1', isBold: true},
{text: 'productTrainingTooltip.bottomNavInboxTooltip.part2', isBold: false},
{text: 'productTrainingTooltip.bottomNavInboxTooltip.part3', isBold: false},
],
onHideTooltip: () => dismissProductTraining(BOTTOM_NAV_INBOX_TOOLTIP),
name: BOTTOM_NAV_INBOX_TOOLTIP,
Expand Down
3 changes: 2 additions & 1 deletion src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5473,7 +5473,8 @@ const translations = {
},
bottomNavInboxTooltip: {
part1: 'Your to-do list',
part2: ' comes with 🟢 for actions to take and 🔴 for errors',
part2: ' comes with 🟢 for',
part3: '\n actions to take and 🔴 for errors',
},
workspaceChatTooltip: {
part1: 'Review submitted expenses and chat',
Expand Down
5 changes: 3 additions & 2 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5987,13 +5987,14 @@ const translations = {
part2: ' gastos',
part3: ' aquí',
},
searchFilterButtonTooltip: {
ssearchFilterButtonTooltip: {
part1: 'Customize your search',
part2: ' here!',
},
bottomNavInboxTooltip: {
part1: 'Your to-do list',
part2: ' comes with 🟢 for actions to take and 🔴 for errors',
part2: ' comes with 🟢 for',
part3: '\n actions to take and 🔴 for errors',
},
workspaceChatTooltip: {
part1: 'Review submitted expenses and chat',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import useActiveWorkspace from '@hooks/useActiveWorkspace';
import useBottomTabIsFocused from '@hooks/useBottomTabIsFocused';
import useCurrentReportID from '@hooks/useCurrentReportID';
import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import interceptAnonymousUser from '@libs/interceptAnonymousUser';
Expand Down Expand Up @@ -78,14 +77,13 @@ function BottomTabBar({selectedTab}: BottomTabBarProps) {
const [policies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
const [reportActions] = useOnyx(ONYXKEYS.COLLECTION.REPORT_ACTIONS);
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS);
const {shouldUseNarrowLayout} = useResponsiveLayout();
const [chatTabBrickRoad, setChatTabBrickRoad] = useState<BrickRoad>(() =>
getChatTabBrickRoad(activeWorkspaceID, currentReportID, reports, betas, policies, priorityMode, transactionViolations),
);
const isFocused = useBottomTabIsFocused();
const {renderProductTrainingTooltip, shouldShowProductTrainingTooltip, hideProductTrainingTooltip} = useProductTrainingContext(
CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.BOTTOM_NAV_INBOX_TOOLTIP,
isFocused,
selectedTab === SCREENS.HOME && isFocused,
);

useEffect(() => {
Expand Down Expand Up @@ -149,11 +147,9 @@ function BottomTabBar({selectedTab}: BottomTabBarProps) {
<EducationalTooltip
shouldRender={shouldShowProductTrainingTooltip}
anchorAlignment={{
horizontal: shouldUseNarrowLayout ? CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.CENTER : CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT,
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.CENTER,
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM,
}}
shiftVertical={variables.composerTooltipShiftVertical}
shiftHorizontal={shouldUseNarrowLayout ? 0 : -15}
shouldUseOverlay
renderTooltipContent={renderProductTrainingTooltip}
wrapperStyle={styles.quickActionTooltipWrapper}
Expand Down

0 comments on commit cd4d450

Please sign in to comment.