Skip to content
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

Feat: Add company card feed flow #48119

Merged
merged 48 commits into from
Sep 11, 2024
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift click to select a range
739618e
add translations
waterim Aug 27, 2024
60827be
update const
waterim Aug 27, 2024
0a8da42
add new form and key for adding card to the onyx
waterim Aug 27, 2024
e5b12f6
add new routes
waterim Aug 27, 2024
fa81496
add screens and navigations
waterim Aug 27, 2024
abfa5b9
new companyCardUtils
waterim Aug 27, 2024
df253a9
CompanyCards actions file
waterim Aug 27, 2024
d874d0b
initial page
waterim Aug 27, 2024
06c4a30
instructions page
waterim Aug 27, 2024
40cd9e4
name step page
waterim Aug 27, 2024
679cb22
type step page
waterim Aug 27, 2024
2cf779d
details step
waterim Aug 27, 2024
d8e9a1f
types for form and new onyx key for adding a card
waterim Aug 27, 2024
477dd2f
update translations
waterim Aug 28, 2024
a1a9a03
update utils
waterim Aug 28, 2024
07a4c2a
update navigation
waterim Aug 28, 2024
d1240ef
update steps
waterim Aug 28, 2024
9675c7a
remove unused CONST
waterim Aug 29, 2024
495a908
change data to not use unneeded array push
waterim Aug 29, 2024
8c191e3
remove unused routes
waterim Aug 29, 2024
a05246f
fix linter
waterim Aug 29, 2024
97a6a1e
remove policyID
waterim Aug 29, 2024
b3d2e91
Merge remote-tracking branch 'upstream/main' into feat-47376-Add-Card…
waterim Aug 30, 2024
17614b0
add clear add flow
waterim Aug 30, 2024
79e16c0
add new add screen type
waterim Aug 30, 2024
c3707db
add navigation from empty page
waterim Aug 30, 2024
e3c7965
update card type, add disable
waterim Aug 30, 2024
5843dac
update links
waterim Aug 30, 2024
b3fc183
fix linter and ts
waterim Aug 30, 2024
ff20af0
fix compiler
waterim Aug 30, 2024
3805278
Merge remote-tracking branch 'upstream/main' into feat-47376-Add-Card…
waterim Sep 2, 2024
416497f
fix duplicate after merge
waterim Sep 2, 2024
091abad
add navigation back
waterim Sep 2, 2024
4c50b02
add error field to card provider selection, add new error translation
waterim Sep 2, 2024
a8283fd
translations
waterim Sep 2, 2024
15ff548
remove duplicate
waterim Sep 2, 2024
c4e5b5a
added new blue amex card
waterim Sep 3, 2024
9342486
Merge remote-tracking branch 'upstream/main' into feat-47376-Add-Card…
waterim Sep 3, 2024
fe765b0
Merge remote-tracking branch 'upstream/main' into feat-47376-Add-Card…
waterim Sep 9, 2024
a441561
remove unused functions
waterim Sep 9, 2024
3c3350e
remove unused translation function
waterim Sep 9, 2024
92fb88d
remove useCallbacks and useMemos as we have react compiler for that
waterim Sep 9, 2024
96a5d68
fix lint
waterim Sep 9, 2024
919cb16
remove unused code
waterim Sep 9, 2024
4323c19
remove unused code
waterim Sep 9, 2024
7caf812
update translations
waterim Sep 9, 2024
1641d03
removed unnecessary validation code
waterim Sep 9, 2024
695f2a8
update translations and validation
waterim Sep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update card type, add disable
  • Loading branch information
waterim committed Aug 30, 2024
commit e3c7965500a252fda7e91abe5c8bb0023680c2f8
12 changes: 10 additions & 2 deletions src/pages/workspace/companyCards/addNew/CardTypeStep.tsx
Original file line number Diff line number Diff line change
@@ -1,4 1,5 @@
import React, {useMemo, useState} from 'react';
import React, {useEffect, useMemo, useState} from 'react';
import {useOnyx} from 'react-native-onyx';
import type {ValueOf} from 'type-fest';
import Button from '@components/Button';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
Expand All @@ -13,10 14,12 @@ import useThemeStyles from '@hooks/useThemeStyles';
import variables from '@styles/variables';
import * as CompanyCards from '@userActions/CompanyCards';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';

function CardTypeStep() {
const {translate} = useLocalize();
const styles = useThemeStyles();
const [addNewCard] = useOnyx(ONYXKEYS.ADD_NEW_COMPANY_CARD);
const [typeSelected, setTypeSelected] = useState<ValueOf<typeof CONST.COMPANY_CARDS.CARD_TYPE>>();

const submit = () => {
Expand All @@ -29,6 32,10 @@ function CardTypeStep() {
});
};

useEffect(() => {
setTypeSelected(addNewCard?.data.cardType);
}, [addNewCard?.data.cardType]);

const handleBackButtonPress = () => {
CompanyCards.setAddNewCompanyCardStepAndData({step: CONST.COMPANY_CARDS.STEP.CARD_TYPE});
};
waterim marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -99,11 106,12 @@ function CardTypeStep() {
onSelectRow={({value}) => setTypeSelected(value)}
sections={[{data}]}
shouldSingleExecuteRowSelect
initiallyFocusedOptionKey={typeSelected}
initiallyFocusedOptionKey={addNewCard?.data.cardType}
shouldUpdateFocusedIndex
/>
<Button
success
isDisabled={!typeSelected}
large
pressOnEnter
text={translate('common.next')}
Expand Down
Loading