diff --git a/src/components/transaction/types/AchTransferTransaction.tsx b/src/components/transaction/types/AchTransferTransaction.tsx index 74e4e74..811afbc 100644 --- a/src/components/transaction/types/AchTransferTransaction.tsx +++ b/src/components/transaction/types/AchTransferTransaction.tsx @@ -1,8 +1,5 @@ -import { useNavigation } from "@react-navigation/native"; -import { NativeStackNavigationProp } from "@react-navigation/native-stack"; import { View } from "react-native"; -import { StackParamList } from "../../../lib/NavigatorParamList"; import { TransactionAchTransfer } from "../../../lib/types/Transaction"; import { palette } from "../../../theme"; import { renderMoney } from "../../../util"; @@ -16,10 +13,8 @@ import { TransactionViewProps } from "./TransactionViewProps"; export default function AchTransferTransaction({ transaction: { ach_transfer, ...transaction }, orgId, + navigation, }: TransactionViewProps) { - const navigation = - useNavigation>(); - return ( >(); - return ( diff --git a/src/components/transaction/types/BankFeeTransaction.tsx b/src/components/transaction/types/BankFeeTransaction.tsx index 503bd73..f2a0a1c 100644 --- a/src/components/transaction/types/BankFeeTransaction.tsx +++ b/src/components/transaction/types/BankFeeTransaction.tsx @@ -1,9 +1,6 @@ -import { useNavigation } from "@react-navigation/native"; -import { NativeStackNavigationProp } from "@react-navigation/native-stack"; import { Text, View } from "react-native"; import useSWR from "swr"; -import { StackParamList } from "../../../lib/NavigatorParamList"; import Organization from "../../../lib/types/Organization"; import { palette } from "../../../theme"; import { renderDate, renderMoney } from "../../../util"; @@ -15,12 +12,11 @@ import { TransactionViewProps } from "./TransactionViewProps"; export default function BankFeeTransaction({ transaction, orgId, + navigation, }: TransactionViewProps) { const { data: organization } = useSWR( `/organizations/${orgId}`, ); - const navigation = - useNavigation>(); return ( diff --git a/src/components/transaction/types/CardChargeTransaction.tsx b/src/components/transaction/types/CardChargeTransaction.tsx index 6d3ee9d..f24a788 100644 --- a/src/components/transaction/types/CardChargeTransaction.tsx +++ b/src/components/transaction/types/CardChargeTransaction.tsx @@ -1,8 +1,5 @@ -import { useNavigation } from "@react-navigation/native"; -import { NativeStackNavigationProp } from "@react-navigation/native-stack"; import { View } from "react-native"; -import { StackParamList } from "../../../lib/NavigatorParamList"; import { TransactionCardCharge } from "../../../lib/types/Transaction"; import { palette } from "../../../theme"; import { renderDate, renderMoney } from "../../../util"; @@ -20,10 +17,8 @@ export default function CardChargeTransaction({ ...transaction }, orgId, + navigation, }: TransactionViewProps) { - const navigation = - useNavigation>(); - const isRefund = transaction.amount_cents > 0; const badge = transaction.pending ? ( diff --git a/src/components/transaction/types/CheckTransaction.tsx b/src/components/transaction/types/CheckTransaction.tsx index 2309fc7..5a6d1d5 100644 --- a/src/components/transaction/types/CheckTransaction.tsx +++ b/src/components/transaction/types/CheckTransaction.tsx @@ -1,9 +1,6 @@ -import { useNavigation } from "@react-navigation/native"; -import { NativeStackNavigationProp } from "@react-navigation/native-stack"; import humanizeString from "humanize-string"; import { View } from "react-native"; -import { StackParamList } from "../../../lib/NavigatorParamList"; import { TransactionCheck } from "../../../lib/types/Transaction"; import { renderMoney, statusColor } from "../../../util"; import Badge from "../../Badge"; @@ -15,11 +12,9 @@ import { TransactionViewProps } from "./TransactionViewProps"; export default function CheckTransaction({ transaction: { check, ...transaction }, + navigation, ...props }: TransactionViewProps) { - const navigation = - useNavigation>(); - return ( ) { - const navigation = - useNavigation>(); - return ( ) { const { data: userOrgs } = useSWR(`/user/organizations`); @@ -28,9 +26,6 @@ export default function TransferTransaction({ const userInToOrg = user?.admin || userOrgs?.some((org) => org.id == transfer.to.id); - const navigation = - useNavigation>(); - return (