-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CP Staging] [NO QA]: Add bank urls to Company Card flow #51384
Changes from 1 commit
e4a1fa4
b484467
d087a9b
308cece
77cec75
eb17f40
3b7cebf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,3 +1,4 @@ | ||||||||||
import {useRoute} from '@react-navigation/native'; | ||||||||||
import React, {useEffect, useRef, useState} from 'react'; | ||||||||||
import {useOnyx} from 'react-native-onyx'; | ||||||||||
import {WebView} from 'react-native-webview'; | ||||||||||
|
@@ -14,14 +15,16 @@ import CONST from '@src/CONST'; | |||||||||
import ONYXKEYS from '@src/ONYXKEYS'; | ||||||||||
|
||||||||||
function BankConnection() { | ||||||||||
const params = useRoute().params as Record<string, string>; | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not really the way we get route params, can you please update this , i can attach the pattern we follow below:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah but it's not a navigation page - it's just a component There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ummm, can't we then just pass the prop down to the component then? do we do the same thing in other component pages ? just that i saw this pattern for the first time There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated - passed inside AddNewCardPage |
||||||||||
const {translate} = useLocalize(); | ||||||||||
const webViewRef = useRef<WebView>(null); | ||||||||||
const [isWebViewOpen, setWebViewOpen] = useState(false); | ||||||||||
const [session] = useOnyx(ONYXKEYS.SESSION); | ||||||||||
const authToken = session?.authToken ?? null; | ||||||||||
const [addNewCard] = useOnyx(ONYXKEYS.ADD_NEW_COMPANY_CARD); | ||||||||||
const bankName: ValueOf<typeof CONST.COMPANY_CARDS.BANKS> | undefined = addNewCard?.data?.selectedBank; | ||||||||||
const url = getCompanyCardBankConnection(bankName); | ||||||||||
const policyID = params?.policyID; | ||||||||||
const url = getCompanyCardBankConnection(policyID, bankName); | ||||||||||
|
||||||||||
const renderLoading = () => <FullScreenLoadingIndicator />; | ||||||||||
|
||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, did you test atleast on one platform ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah
Screen.Recording.2024-10-24.at.11.44.11.mov