-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47218 from rezkiy37/feature/45177-invoice-back-ac…
…counts-section Invoicing bank accounts section
- Loading branch information
Showing
13 changed files
with
441 additions
and
109 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {useCallback, useState} from 'react'; | ||
import type {PaymentMethodState} from './types'; | ||
|
||
const initialState: PaymentMethodState = { | ||
isSelectedPaymentMethodDefault: false, | ||
selectedPaymentMethod: {}, | ||
formattedSelectedPaymentMethod: { | ||
title: '', | ||
}, | ||
methodID: '', | ||
selectedPaymentMethodType: '', | ||
}; | ||
|
||
function usePaymentMethodState() { | ||
const [paymentMethod, setPaymentMethod] = useState<PaymentMethodState>(initialState); | ||
|
||
const resetSelectedPaymentMethodData = useCallback(() => { | ||
setPaymentMethod(initialState); | ||
}, [setPaymentMethod]); | ||
|
||
return { | ||
paymentMethod, | ||
setPaymentMethod, | ||
resetSelectedPaymentMethodData, | ||
}; | ||
} | ||
|
||
export default usePaymentMethodState; |
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,28 @@ | ||
import type {ViewStyle} from 'react-native'; | ||
import type {AccountData} from '@src/types/onyx'; | ||
import type IconAsset from '@src/types/utils/IconAsset'; | ||
|
||
type FormattedSelectedPaymentMethodIcon = { | ||
icon: IconAsset; | ||
iconHeight?: number; | ||
iconWidth?: number; | ||
iconStyles?: ViewStyle[]; | ||
iconSize?: number; | ||
}; | ||
|
||
type FormattedSelectedPaymentMethod = { | ||
title: string; | ||
icon?: FormattedSelectedPaymentMethodIcon; | ||
description?: string; | ||
type?: string; | ||
}; | ||
|
||
type PaymentMethodState = { | ||
isSelectedPaymentMethodDefault: boolean; | ||
selectedPaymentMethod: AccountData; | ||
formattedSelectedPaymentMethod: FormattedSelectedPaymentMethod; | ||
methodID: string | number; | ||
selectedPaymentMethodType: string; | ||
}; | ||
|
||
export type {FormattedSelectedPaymentMethodIcon, FormattedSelectedPaymentMethod, PaymentMethodState}; |
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
6 changes: 6 additions & 0 deletions
6
src/libs/API/parameters/SetInvoicingTransferBankAccountParams.ts
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,6 @@ | ||
type SetInvoicingTransferBankAccountParams = { | ||
bankAccountID: number; | ||
policyID: string; | ||
}; | ||
|
||
export default SetInvoicingTransferBankAccountParams; |
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
Oops, something went wrong.