-
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
[No QA] [Workspace Feeds] Create new Card List page #44469
Changes from 13 commits
30eb56d
93cf9a3
071719d
18cae81
1468453
c5917a4
d179bbf
23ac283
e44f899
8d197e6
c983f81
9ff8407
3d5e98c
075067d
6bbd966
3cc2b9f
2ffa7e6
c61f306
31a9262
d4b372c
78703b4
144bd42
b9392c5
195a93a
91344d1
afdd909
f4ce67b
a1f26d5
da8b4d0
94f13e6
496fd20
269314d
9b4d832
4fbe7ef
14f3606
b000be0
e3e26c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -404,6 +404,12 @@ const ONYXKEYS = { | |||||
// Shared NVPs | ||||||
/** Collection of objects where each object represents the owner of the workspace that is past due billing AND the user is a member of. */ | ||||||
SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END: 'sharedNVP_private_billingGracePeriodEnd_', | ||||||
|
||||||
/** Expensify cards settings */ | ||||||
SHARED_NVP_PRIVATE_EXPENSIFY_CARD_SETTINGS: 'sharedNVP_private_expensifyCardSettings_', | ||||||
|
||||||
/** Expensify cards list */ | ||||||
EXPENSIFY_CARDS_LIST: 'card_', | ||||||
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. Not sure what is the best const name here so it doe snot intervene with the cardsList key I dont think we should use Expensify_cards list as this will be reused for other feeds that are not necessarily Expensify cards cc @MariaHCD I feel like Workspace might be ok, but also it might be be that clear with the domain feeds that are not strictly tied to a workspace
Suggested change
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. Fair point. I'm thinking Alternatively, we can go with 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. But having just one makes the most sense, I think so I'm still fine with 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. Okay, looks like we're going with |
||||||
}, | ||||||
|
||||||
/** List of Form ids */ | ||||||
|
@@ -621,6 +627,8 @@ type OnyxCollectionValuesMapping = { | |||||
[ONYXKEYS.COLLECTION.POLICY_CONNECTION_SYNC_PROGRESS]: OnyxTypes.PolicyConnectionSyncProgress; | ||||||
[ONYXKEYS.COLLECTION.SNAPSHOT]: OnyxTypes.SearchResults; | ||||||
[ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END]: OnyxTypes.BillingGraceEndPeriod; | ||||||
[ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_EXPENSIFY_CARD_SETTINGS]: OnyxTypes.ExpensifyCardSettings; | ||||||
[ONYXKEYS.COLLECTION.EXPENSIFY_CARDS_LIST]: OnyxTypes.ExpensifyCardsList; | ||||||
}; | ||||||
|
||||||
type OnyxValuesMapping = { | ||||||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,6 @@ | ||||||||
type OpenPolicyExpensifyCardsPageParams = { | ||||||||
policyID: string; | ||||||||
authToken: string | null | undefined; | ||||||||
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. i don't think we should have a 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. That's the return type of the getAuthToken function App/src/libs/Network/NetworkStore.ts Lines 96 to 98 in 1d607ac
But I agree that |
||||||||
}; | ||||||||
|
||||||||
export default OpenPolicyExpensifyCardsPageParams; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type RequestExpensifyCardLimitIncreaseParams = { | ||
authToken: string | null | undefined; | ||
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. Same as ^ |
||
settlementBankAccountID: string; | ||
}; | ||
|
||
export default RequestExpensifyCardLimitIncreaseParams; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import Text from '@components/Text'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import useResponsiveLayout from '@hooks/useResponsiveLayout'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import CONST from '@src/CONST'; | ||
import WorkspaceCardsListLabel from './WorkspaceCardsListLabel'; | ||
|
||
// TODO: remove when Onyx data is available | ||
const mockedSettings = { | ||
currentBalance: 5000, | ||
remainingLimit: 3000, | ||
cashBack: 2000, | ||
}; | ||
|
||
function WorkspaceCardListHeader() { | ||
const {shouldUseNarrowLayout, isMediumScreenWidth, isSmallScreenWidth} = useResponsiveLayout(); | ||
const styles = useThemeStyles(); | ||
const {translate} = useLocalize(); | ||
|
||
const isLessThanMediumScreen = isMediumScreenWidth || isSmallScreenWidth; | ||
|
||
// TODO: uncomment the code line below to use cardSettings data from Onyx when it's supported | ||
// const [cardSettings] = useOnyx(`${ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_EXPENSIFY_CARD_SETTINGS}${policyID}`); | ||
const cardSettings = mockedSettings; | ||
|
||
return ( | ||
<View> | ||
<View style={[isLessThanMediumScreen ? styles.flexColumn : styles.flexRow, styles.mv5, styles.mh5]}> | ||
<View style={[styles.flexRow, styles.flex1]}> | ||
<WorkspaceCardsListLabel | ||
type={CONST.WORKSPACE_CARDS_LIST_LABEL_TYPE.CURRENT_BALANCE} | ||
value={cardSettings?.[CONST.WORKSPACE_CARDS_LIST_LABEL_TYPE.CURRENT_BALANCE]} | ||
/> | ||
<WorkspaceCardsListLabel | ||
type={CONST.WORKSPACE_CARDS_LIST_LABEL_TYPE.REMAINING_LIMIT} | ||
value={cardSettings?.[CONST.WORKSPACE_CARDS_LIST_LABEL_TYPE.REMAINING_LIMIT]} | ||
/> | ||
</View> | ||
<WorkspaceCardsListLabel | ||
type={CONST.WORKSPACE_CARDS_LIST_LABEL_TYPE.CASH_BACK} | ||
value={cardSettings?.[CONST.WORKSPACE_CARDS_LIST_LABEL_TYPE.CASH_BACK]} | ||
style={isLessThanMediumScreen ? styles.mt3 : undefined} | ||
/> | ||
</View> | ||
|
||
<View style={[styles.flexRow, styles.appBG, styles.mh5, styles.gap5, styles.p4]}> | ||
<View style={[styles.flexRow, styles.flex5, styles.gap2, styles.alignItemsCenter]}> | ||
<Text | ||
numberOfLines={1} | ||
style={[styles.textLabelSupporting, styles.lh16]} | ||
> | ||
{translate('workspace.expensifyCard.name')} | ||
</Text> | ||
</View> | ||
<View style={[styles.flexRow, styles.gap2, shouldUseNarrowLayout ? styles.flex2 : styles.flex1, styles.alignItemsCenter, styles.justifyContentEnd]}> | ||
<Text | ||
numberOfLines={1} | ||
style={[styles.textLabelSupporting, styles.lh16]} | ||
> | ||
{translate('workspace.expensifyCard.lastFour')} | ||
</Text> | ||
</View> | ||
<View style={[styles.flexRow, shouldUseNarrowLayout ? styles.flex2 : styles.flex1, styles.gap2, styles.alignItemsCenter, styles.justifyContentEnd]}> | ||
<Text | ||
numberOfLines={1} | ||
style={[styles.textLabelSupporting, styles.lh16]} | ||
> | ||
{translate('workspace.expensifyCard.limit')} | ||
</Text> | ||
</View> | ||
</View> | ||
</View> | ||
); | ||
} | ||
|
||
WorkspaceCardListHeader.displayName = 'WorkspaceCardListHeader'; | ||
|
||
export default WorkspaceCardListHeader; |
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.