Skip to content

Commit

Permalink
Merge pull request #42462 from hungvu193/fix-42458
Browse files Browse the repository at this point in the history
[Wave Collect] [Xero] Make the integration name in Categories dynamic
  • Loading branch information
lakchote authored May 22, 2024
2 parents 1342b73 + bff08c2 commit 082b792
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) {
const policyId = route.params.policyID ?? '';
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyId}`);
const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyId}`);
const isConnectedToAccounting = Object.keys(policy?.connections ?? {}).length > 0;
const isConnectedToQbo = policy?.connections?.quickbooksOnline;

const fetchCategories = useCallback(() => {
Policy.openPolicyCategoriesPage(policyId);
Expand Down Expand Up @@ -275,14 +277,14 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) {
/>
{isSmallScreenWidth && <View style={[styles.pl5, styles.pr5]}>{getHeaderButtons()}</View>}
<View style={[styles.ph5, styles.pb5, styles.pt3]}>
{Object.keys(policy?.connections ?? {}).length > 0 ? (
{isConnectedToAccounting ? (
<Text>
<Text style={[styles.textNormal, styles.colorMuted]}>{`${translate('workspace.categories.importedFromAccountingSoftware')} `}</Text>
<TextLink
style={[styles.textNormal, styles.link]}
href={`${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(policyId)}`}
>
{`${translate('workspace.accounting.qbo')} ${translate('workspace.accounting.settings')}`}
{`${translate(isConnectedToQbo ? 'workspace.accounting.qbo' : 'workspace.accounting.xero')} ${translate('workspace.accounting.settings')}`}
</TextLink>
</Text>
) : (
Expand Down

0 comments on commit 082b792

Please sign in to comment.