-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: alert if onchain fees are too high
- Loading branch information
Nicolas Burtey
committed
Nov 23, 2023
1 parent
dfadf1e
commit 6f9a39d
Showing
6 changed files
with
182 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import { GaloyIcon } from "@app/components/atomic/galoy-icon" | ||
import CustomModal from "@app/components/custom-modal/custom-modal" | ||
import { useI18nContext } from "@app/i18n/i18n-react" | ||
import { Text, makeStyles, useTheme } from "@rneui/themed" | ||
import React from "react" | ||
import { View } from "react-native" | ||
|
||
export type ConfirmFeesModalProps = { | ||
isVisible: boolean | ||
action: () => void | ||
cancel: () => void | ||
} | ||
|
||
export const ConfirmFeesModal: React.FC<ConfirmFeesModalProps> = ({ | ||
action, | ||
cancel, | ||
isVisible, | ||
}) => { | ||
const styles = useStyles() | ||
const { | ||
theme: { colors }, | ||
} = useTheme() | ||
const { LL } = useI18nContext() | ||
|
||
console.log({ isVisible, action }) | ||
|
||
return ( | ||
<CustomModal | ||
isVisible={isVisible} | ||
toggleModal={cancel} | ||
title={LL.SendBitcoinScreen.confirmFeesModal.title()} | ||
image={<GaloyIcon name="info" size={80} color={colors.primary3} />} | ||
body={ | ||
<View style={styles.body}> | ||
<Text type={"p2"} style={styles.warningText}> | ||
{LL.SendBitcoinScreen.confirmFeesModal.content()} | ||
</Text> | ||
</View> | ||
} | ||
primaryButtonOnPress={action} | ||
primaryButtonTitle={LL.SendBitcoinScreen.confirmFeesModal.confirmButton()} | ||
secondaryButtonTitle={LL.common.cancel()} | ||
secondaryButtonOnPress={cancel} | ||
/> | ||
) | ||
} | ||
|
||
const useStyles = makeStyles(({ colors }) => ({ | ||
modalCard: { | ||
backgroundColor: colors.white, | ||
borderRadius: 16, | ||
padding: 18, | ||
}, | ||
warningText: { | ||
textAlign: "center", | ||
}, | ||
body: { | ||
rowGap: 12, | ||
}, | ||
buttonContainer: { | ||
rowGap: 12, | ||
}, | ||
titleContainer: { | ||
marginBottom: 12, | ||
}, | ||
checkBox: { | ||
paddingLeft: 0, | ||
backgroundColor: "transparent", | ||
}, | ||
checkBoxTouchable: { | ||
marginTop: 12, | ||
}, | ||
checkBoxContainer: { | ||
flexDirection: "row", | ||
justifyContent: "space-between", | ||
alignItems: "center", | ||
backgroundColor: colors.grey5, | ||
borderRadius: 8, | ||
}, | ||
checkBoxText: { | ||
flex: 1, | ||
}, | ||
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters