diff --git a/App.tsx b/App.tsx index b8e1393..aead0f3 100644 --- a/App.tsx +++ b/App.tsx @@ -2,6 +2,7 @@ import "expo-dev-client"; import { ActionSheetProvider } from "@expo/react-native-action-sheet"; import { LinkingOptions, NavigationContainer } from "@react-navigation/native"; +import { useStripeTerminal } from "@stripe/stripe-terminal-react-native"; import { useFonts } from "expo-font"; import * as Linking from "expo-linking"; import * as SecureStorage from "expo-secure-store"; @@ -62,7 +63,8 @@ export default function App() { const [token, setToken] = useState(null); const hcb = useClient(token); const scheme = useColorScheme(); - + useStripeTerminal() + const fetcher = useCallback( async (url: string, options: any) => { try { diff --git a/app.config.js b/app.config.js index 0acfdac..d9272e7 100644 --- a/app.config.js +++ b/app.config.js @@ -65,24 +65,24 @@ export default { [ "@stripe/stripe-terminal-react-native", { - bluetoothBackgroundMode: true, - locationWhenInUsePermission: - "Location access is required in order to accept payments.", - bluetoothPeripheralPermission: - "Bluetooth access is required in order to connect to supported bluetooth card readers.", - bluetoothAlwaysUsagePermission: - "This app uses Bluetooth to connect to supported card readers.", - }, + "bluetoothBackgroundMode": true, + "locationWhenInUsePermission": "Location access is required in order to accept payments.", + "bluetoothPeripheralPermission": "Bluetooth access is required in order to connect to supported bluetooth card readers.", + "bluetoothAlwaysUsagePermission": "This app uses Bluetooth to connect to supported card readers." + } ], [ "expo-build-properties", { android: { - minSdkVersion: 26, - }, + minSdkVersion: 26 + } }, ], - ["expo-alternate-app-icons", appIcons], + [ + "expo-alternate-app-icons", + appIcons + ] ], }, -}; +}; \ No newline at end of file diff --git a/src/components/Transaction.tsx b/src/components/Transaction.tsx index fedb3a5..2fe9d02 100644 --- a/src/components/Transaction.tsx +++ b/src/components/Transaction.tsx @@ -3,7 +3,7 @@ import { faPaypal } from '@fortawesome/free-brands-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome'; import { useTheme } from "@react-navigation/native"; import { LinearGradient } from "expo-linear-gradient"; -import Icon from "hackclub-icons-rn"; +import Icon from "@hackclub/hackclub-icons-rn"; import { memo } from "react"; import { View, Text, ViewProps, StyleSheet } from "react-native"; import { match } from "ts-pattern"; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 80b2dd9..035ef8b 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -242,7 +242,8 @@ export default function App({ navigation }: Props) { for (const org of organizations || []) { preload(`organizations/${org.id}`, fetcher!); } - }, []); + }), []; + const onRefresh = () => { reloadOrganizations(); diff --git a/src/pages/organization/Donation.tsx b/src/pages/organization/Donation.tsx index 75becbc..3ddc4b0 100644 --- a/src/pages/organization/Donation.tsx +++ b/src/pages/organization/Donation.tsx @@ -233,6 +233,7 @@ function PageContent({ orgId, orgName, navigation }: any) { donation: "true" }, statementDescriptor: `HCB* ${orgName || "DONATION"}`.substring(0, 22), + receiptEmail: email, }) if (error) { @@ -435,8 +436,8 @@ function PageContent({ orgId, orgName, navigation }: any) { @@ -444,10 +445,12 @@ function PageContent({ orgId, orgName, navigation }: any) { - Name - + + Name + - Email - + + Email + { + if (!email.includes("@") || !email.includes(".")) { + Alert.alert("Please provide a valid email address") + return + } const donation_id = await createDonation(); await paymentIntent({ donation_id }); }}