Skip to content

Commit 66dbdb8

Browse files
committed
feat: remove unused prop from tooltip
1 parent 5417f2f commit 66dbdb8

6 files changed

Lines changed: 1 addition & 41 deletions

File tree

app/component-library/components-temp/KeyValueRow/KeyValueLabel/KeyValueLabel.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ const KeyValueRowLabel = ({ label, tooltip }: KeyValueRowLabelProps) => {
3434

3535
const onNavigateToTooltipModal = () => {
3636
if (!hasTooltip) return;
37-
openTooltipModal(tooltip.title, tooltip.content, undefined, undefined, {
38-
bottomPadding: tooltip.bottomPadding,
39-
});
37+
openTooltipModal(tooltip.title, tooltip.content, undefined, undefined);
4038
tooltip?.onPress?.();
4139
};
4240

app/component-library/components-temp/KeyValueRow/KeyValueRow.types.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ interface KeyValueRowTooltip {
3737
* Optional onPress handler
3838
*/
3939
onPress?: (...args: unknown[]) => unknown;
40-
/**
41-
* Optional bottom padding for the tooltip modal.
42-
*/
43-
bottomPadding?: number;
4440
}
4541

4642
/**

app/components/UI/Stake/components/StakingConfirmation/RewardsCard/RewardsCard.test.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ describe('RewardsCard', () => {
6262
tooltip: strings('tooltip_modal.reward_rate.tooltip'),
6363
footerText: undefined,
6464
buttonText: undefined,
65-
bottomPadding: undefined,
6665
},
6766
screen: 'tooltipModal',
6867
});
@@ -94,7 +93,6 @@ describe('RewardsCard', () => {
9493
tooltip: strings('tooltip_modal.reward_frequency.tooltip'),
9594
footerText: undefined,
9695
buttonText: undefined,
97-
bottomPadding: undefined,
9896
},
9997
screen: 'tooltipModal',
10098
});

app/components/Views/TooltipModal/ToolTipModal.types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ export interface TooltipModalRouteParams {
55
tooltip: string | ReactNode;
66
footerText?: string;
77
buttonText?: string;
8-
bottomPadding?: number;
98
}

app/components/hooks/useTooltipModal.test.tsx

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ interface TooltipModalNavigateParams {
3131
tooltip: string | React.ReactNode;
3232
footerText?: string;
3333
buttonText?: string;
34-
bottomPadding?: number;
3534
};
3635
}
3736

@@ -57,7 +56,6 @@ describe('useTooltipModal', () => {
5756
tooltip,
5857
footerText,
5958
buttonText,
60-
bottomPadding: undefined,
6159
},
6260
});
6361
});
@@ -76,29 +74,6 @@ describe('useTooltipModal', () => {
7674
expect(navigateParams.params.tooltip).toBe(tooltip);
7775
});
7876

79-
it('includes bottomPadding when provided', () => {
80-
const { result } = renderHook(() => useTooltipModal());
81-
const title = 'Title';
82-
const tooltip = 'Tooltip text';
83-
const bottomPadding = 24;
84-
85-
result.current.openTooltipModal(title, tooltip, undefined, undefined, {
86-
bottomPadding,
87-
});
88-
89-
expect(mockNavigate).toHaveBeenCalledTimes(1);
90-
expect(mockNavigate).toHaveBeenCalledWith(Routes.MODAL.ROOT_MODAL_FLOW, {
91-
screen: Routes.SHEET.TOOLTIP_MODAL,
92-
params: {
93-
title,
94-
tooltip,
95-
footerText: undefined,
96-
buttonText: undefined,
97-
bottomPadding,
98-
},
99-
});
100-
});
101-
10277
it('returns stable openTooltipModal reference across rerenders', () => {
10378
const { result, rerender } = renderHook(() => useTooltipModal());
10479
const firstReturnValue = result.current;

app/components/hooks/useTooltipModal.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ import { useNavigation } from '@react-navigation/native';
22
import Routes from '../../constants/navigation/Routes';
33
import { ReactNode, useCallback, useMemo } from 'react';
44

5-
interface TooltipOptions {
6-
bottomPadding?: number;
7-
}
8-
95
const useTooltipModal = () => {
106
const { navigate } = useNavigation();
117

@@ -15,7 +11,6 @@ const useTooltipModal = () => {
1511
tooltip: string | ReactNode,
1612
footerText?: string,
1713
buttonText?: string,
18-
options?: TooltipOptions,
1914
) =>
2015
navigate(Routes.MODAL.ROOT_MODAL_FLOW, {
2116
screen: Routes.SHEET.TOOLTIP_MODAL,
@@ -24,7 +19,6 @@ const useTooltipModal = () => {
2419
tooltip,
2520
footerText,
2621
buttonText,
27-
bottomPadding: options?.bottomPadding,
2822
},
2923
}),
3024
[navigate],

0 commit comments

Comments
 (0)