-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathPredictWithdrawUnavailableSheet.tsx
More file actions
85 lines (78 loc) · 2.43 KB
/
PredictWithdrawUnavailableSheet.tsx
File metadata and controls
85 lines (78 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import {
BottomSheet,
BottomSheetFooter,
BottomSheetHeader,
Box,
BoxAlignItems,
Text,
TextColor,
TextVariant,
} from '@metamask/design-system-react-native';
import React, { forwardRef, useImperativeHandle } from 'react';
import { strings } from '../../../../../../locales/i18n';
import {
usePredictBottomSheet,
type PredictBottomSheetRef,
} from '../../hooks/usePredictBottomSheet';
import { PREDICT_BALANCE_TEST_IDS } from '../PredictBalance/PredictBalance.testIds';
export type PredictWithdrawUnavailableSheetRef = PredictBottomSheetRef;
/**
* Temporary migration notice for Deposit Wallet users.
* Remove this sheet and its trigger once Deposit Wallet withdrawals are supported.
*/
const PredictWithdrawUnavailableSheet = forwardRef<PredictBottomSheetRef>(
(_props, ref) => {
const {
sheetRef,
isVisible,
closeSheet,
handleSheetClosed,
getRefHandlers,
} = usePredictBottomSheet();
useImperativeHandle(ref, getRefHandlers, [getRefHandlers]);
if (!isVisible) {
return null;
}
return (
<BottomSheet
ref={sheetRef}
isInteractable
onClose={handleSheetClosed}
testID={PREDICT_BALANCE_TEST_IDS.WITHDRAW_UNAVAILABLE_SHEET}
>
<BottomSheetHeader
onClose={closeSheet}
closeButtonProps={{
testID: PREDICT_BALANCE_TEST_IDS.WITHDRAW_UNAVAILABLE_CLOSE_BUTTON,
}}
titleTestID={PREDICT_BALANCE_TEST_IDS.WITHDRAW_UNAVAILABLE_TITLE}
>
{strings('predict.withdraw.unavailable_title')}
</BottomSheetHeader>
<Box
alignItems={BoxAlignItems.Start}
paddingHorizontal={4}
paddingBottom={4}
>
<Text
variant={TextVariant.BodyMd}
color={TextColor.TextAlternative}
testID={PREDICT_BALANCE_TEST_IDS.WITHDRAW_UNAVAILABLE_DESCRIPTION}
>
{strings('predict.withdraw.unavailable_description')}
</Text>
</Box>
<BottomSheetFooter
twClassName="px-4"
primaryButtonProps={{
children: strings('predict.withdraw.unavailable_got_it'),
onPress: closeSheet,
testID: PREDICT_BALANCE_TEST_IDS.WITHDRAW_UNAVAILABLE_GOT_IT_BUTTON,
}}
/>
</BottomSheet>
);
},
);
PredictWithdrawUnavailableSheet.displayName = 'PredictWithdrawUnavailableSheet';
export default PredictWithdrawUnavailableSheet;