-
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
Merged
mountiny
merged 37 commits into
Expensify:main
from
VickyStash:feature/expensify-card-list
Jul 2, 2024
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
30eb56d
Add a new WorkspaceCardPageFree screen and a route for it
VickyStash 93cf9a3
Implemented WorkspaceCardListRow and WorkspaceCardListHeader components
VickyStash 071719d
Implemented card list labels
VickyStash 18cae81
Add onyx types and useOnyx hooks to get the data
VickyStash 1468453
Add OpenPolicyExpensifyCardsPage API call
VickyStash c5917a4
Merge branch 'main' into feature/expensify-card-list
VickyStash d179bbf
Fix TS error
VickyStash 23ac283
Merge branch 'main' into feature/expensify-card-list
VickyStash e44f899
Add request limit increase button
VickyStash 8d197e6
Lint fixes
VickyStash c983f81
UI updates to fix ios display
VickyStash 9ff8407
Clarify TODOs
VickyStash 3d5e98c
Minor improvement
VickyStash 075067d
Apply UI feedback
VickyStash 6bbd966
Remove extra TODOs
VickyStash 3cc2b9f
Updates to use policy currency
VickyStash 2ffa7e6
Update translation, rename WorkspaceExpensifyCardPage
VickyStash c61f306
Minor UI improvement
VickyStash 31a9262
Align balances section
VickyStash d4b372c
Merge branch 'main' into feature/expensify-card-list
VickyStash 78703b4
TS fix
VickyStash 144bd42
Minor improvement after merging main
VickyStash b9392c5
Bg color fix
VickyStash 195a93a
Remove sticky header
VickyStash 91344d1
fix: resolve conflicts
koko57 afdd909
fix: apply requested changes
koko57 f4ce67b
fix: apply requested changes
koko57 a1f26d5
fix: resolve conflicts
koko57 da8b4d0
fix: typecheck
koko57 94f13e6
fix: lint
koko57 496fd20
fix: resolve conflicts
koko57 269314d
fix: resolve conflicts
koko57 9b4d832
fix: update comment
koko57 4fbe7ef
fix: remove unused type
koko57 14f3606
fix: minor fix
koko57 b000be0
fix: rename const
koko57 e3e26c0
fix: apply requested changes
koko57 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
6 changes: 6 additions & 0 deletions
6
src/libs/API/parameters/OpenPolicyExpensifyCardsPageParams.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 OpenPolicyExpensifyCardsPageParams = { | ||
policyID: string; | ||
authToken: string | null | undefined; | ||
}; | ||
|
||
export default OpenPolicyExpensifyCardsPageParams; |
6 changes: 6 additions & 0 deletions
6
src/libs/API/parameters/RequestExpensifyCardLimitIncreaseParams.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 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; |
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
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
79 changes: 79 additions & 0 deletions
79
src/pages/workspace/expensifyCard/WorkspaceCardListHeader.tsx
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,79 @@ | ||
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 style={styles.appBG}> | ||
<View style={[isLessThanMediumScreen ? styles.flexColumn : styles.flexRow, isLessThanMediumScreen ? [styles.mt5, styles.mb3] : styles.mv5, styles.mh5, styles.ph4]}> | ||
<View style={[styles.flexRow, styles.flex1, isLessThanMediumScreen && styles.mb5]}> | ||
<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]} | ||
/> | ||
</View> | ||
|
||
<View style={[styles.flexRow, 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.flex3 : 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; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
i don't think we should have a
auth token
ever asundefined
, null case is okay but i highly doubt that we should keep it's type as undefined, what's your take on this @VickyStash ?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.
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
undefined
can be removed, but I'm not sure that I should do it in this PR.