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

Fix: integration icons next to export buttons #47812

Merged
merged 15 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions src/components/ButtonWithDropdownMenu/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type DropdownOption<TValueType> = {
iconWidth?: number;
iconHeight?: number;
iconDescription?: string;
additionalIconStyles?: StyleProp<ViewStyle>;
onSelected?: () => void;
disabled?: boolean;
iconFill?: string;
Expand Down
5 changes: 5 additions & 0 deletions src/components/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ type MenuItemBaseProps = {
/** Any additional styles to pass to the icon container. */
iconStyles?: StyleProp<ViewStyle>;

/** Additional styles to pass to the icon itself */
additionalIconStyles?: StyleProp<ViewStyle>;

/** A fallback avatar icon to display when there is an error on loading avatar from remote URL. */
fallbackIcon?: IconAsset;

Expand Down Expand Up @@ -430,6 +433,7 @@ function MenuItem(
tooltipShiftHorizontal = 0,
tooltipShiftVertical = 0,
renderTooltipContent,
additionalIconStyles,
shouldShowSelectedItemCheck = false,
onHideTooltip,
}: MenuItemProps,
Expand Down Expand Up @@ -647,6 +651,7 @@ function MenuItem(
isPaneMenu,
)
}
additionalStyles={additionalIconStyles}
/>
) : (
<ActivityIndicator
Expand Down
4 changes: 4 additions & 0 deletions src/components/ReportActionItem/ExportWithDropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import * as ReportActions from '@libs/actions/Report';
import * as PolicyUtils from '@libs/PolicyUtils';
import * as ReportUtils from '@libs/ReportUtils';
import type {ExportType} from '@pages/home/report/ReportDetailsExportPage';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {Policy, Report} from '@src/types/onyx';
Expand Down Expand Up @@ -55,6 +56,9 @@ function ExportWithDropdownMenu({
icon: iconToDisplay,
disabled: !canBeExported,
displayInDefaultIconColor: true,
iconWidth: variables.iconSizeMenuItem,
iconHeight: variables.iconSizeMenuItem,
additionalIconStyles: styles.integrationIcon,
};
const options = [
{
Expand Down
13 changes: 10 additions & 3 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {SvgProps} from 'react-native-svg';
import type {OriginalMessageIOU, OriginalMessageModifiedExpense} from 'src/types/onyx/OriginalMessage';
import type {TupleToUnion, ValueOf} from 'type-fest';
import type {FileObject} from '@components/AttachmentModal';
import {FallbackAvatar, QBOCircle, XeroCircle} from '@components/Icon/Expensicons';
import {FallbackAvatar, IntacctSquare, NetSuiteSquare, QBOSquare, XeroSquare} from '@components/Icon/Expensicons';
import * as defaultGroupAvatars from '@components/Icon/GroupDefaultAvatars';
import * as defaultWorkspaceAvatars from '@components/Icon/WorkspaceDefaultAvatars';
import type {MoneyRequestAmountInputProps} from '@components/MoneyRequestAmountInput';
Expand Down Expand Up @@ -8231,11 +8231,18 @@ function getSourceIDFromReportAction(reportAction: OnyxEntry<ReportAction>): str

function getIntegrationIcon(connectionName?: ConnectionName) {
if (connectionName === CONST.POLICY.CONNECTIONS.NAME.XERO) {
return XeroCircle;
return XeroSquare;
}
if (connectionName === CONST.POLICY.CONNECTIONS.NAME.QBO) {
return QBOCircle;
return QBOSquare;
}
if (connectionName === CONST.POLICY.CONNECTIONS.NAME.NETSUITE) {
return NetSuiteSquare;
}
if (connectionName === CONST.POLICY.CONNECTIONS.NAME.SAGE_INTACCT) {
return IntacctSquare;
}

return undefined;
}

Expand Down
5 changes: 5 additions & 0 deletions src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5247,6 +5247,11 @@ const styles = (theme: ThemeColors) =>
backgroundColor: theme.border,
},

integrationIcon: {
overflow: 'hidden',
borderRadius: variables.buttonBorderRadius,
},

colorGreenSuccess: {
color: colors.green400,
},
Expand Down
1 change: 1 addition & 0 deletions src/styles/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export default {
iconSizeExtraLarge: 40,
iconSizeSuperLarge: 60,
iconSizeUltraLarge: 80,
iconSizeMenuItem: 32,
iconBottomBar: 24,
sidebarAvatarSize: 28,
iconHeader: 48,
Expand Down
Loading