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

Styling fixes for ReportPreview/MoneyRequestPreview #36278

Merged
merged 25 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
25f4d94
Fix text styling/gaps on ReportPreview/MoneyRequestPreview
grgia Feb 9, 2024
96197e0
remove corner hover styling for reportPreviews with 3+ receipts
grgia Feb 9, 2024
8c5d382
add {# requests, # scanning, #pending} pattern
grgia Feb 9, 2024
5cc0c0b
prettier
grgia Feb 9, 2024
55f65b3
Merge branch 'main' into georgia-reportPreviewStyling2
grgia Feb 12, 2024
d7c63ea
remove button margin top
grgia Feb 12, 2024
920c84e
remove extra margin top on MoneyRequestPreview
grgia Feb 12, 2024
044497e
Merge branch 'main' into georgia-reportPreviewStyling2
grgia Feb 14, 2024
7d2a7b9
Merge branch 'main' into georgia-reportPreviewStyling2
grgia Feb 14, 2024
87a9eb7
Merge branch 'main' into georgia-reportPreviewStyling2 (ts merge)
grgia Feb 20, 2024
c3bc9c5
remove split hover
grgia Feb 20, 2024
a7c59f5
Merge branch 'main' into georgia-reportPreviewStyling2
grgia Feb 20, 2024
2094008
fix variable name, refers to pending transactions not receipts
grgia Feb 21, 2024
30686ae
Merge branch 'main' into georgia-reportPreviewStyling2
grgia Feb 21, 2024
bd3dd71
Merge branch 'main' into georgia-reportPreviewStyling2
grgia Feb 22, 2024
2935568
Merge branch 'main' into georgia-reportPreviewStyling2
grgia Feb 28, 2024
31f0c7d
prettier
grgia Feb 28, 2024
622bb42
remove rogue margin-bottom
grgia Feb 29, 2024
9144a9e
rename to h2 to match figma without breaking anything
grgia Feb 29, 2024
f8c4ca7
remove one more rogue margin top from merge
grgia Feb 29, 2024
7346f09
forgot to rename one
grgia Feb 29, 2024
9b5d041
money request uses h1
grgia Feb 29, 2024
a509234
money request and reportpreview h1 amount
grgia Feb 29, 2024
333d2ca
fix amount in menuitem
grgia Feb 29, 2024
9994655
Merge branch 'main' into georgia-reportPreviewStyling2
grgia Feb 29, 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
2 changes: 1 addition & 1 deletion src/components/HeaderWithBackButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function HeaderWithBackButton({
<Header
title={title}
subtitle={stepCounter ? translate('stepCounter', stepCounter) : subtitle}
textStyles={[titleColor ? StyleUtils.getTextColorStyle(titleColor) : {}, isCentralPaneSettings && styles.textHeadlineH1]}
textStyles={[titleColor ? StyleUtils.getTextColorStyle(titleColor) : {}, isCentralPaneSettings && styles.textHeadlineH2]}
/>
)}
<View style={[styles.reportOptions, styles.flexRow, styles.pr5, styles.alignItemsCenter]}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,73 +228,79 @@ function MoneyRequestPreviewContent({
{isEmptyObject(transaction) && !ReportActionsUtils.isMessageDeleted(action) && action.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE ? (
<MoneyRequestSkeletonView />
) : (
<View style={styles.moneyRequestPreviewBoxText}>
<View style={[styles.flexRow]}>
<Text style={[styles.textLabelSupporting, styles.flex1, styles.lh20, styles.mb1]}>
{getPreviewHeaderText() + (isSettled && !iouReport?.isCancelledIOU ? ` • ${getSettledMessage()}` : '')}
</Text>
{!isSettled && shouldShowRBR && (
<Icon
src={Expensicons.DotIndicator}
fill={theme.danger}
/>
)}
</View>
<View style={[styles.flexRow]}>
<View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter]}>
<Text
style={[
styles.textHeadline,
isBillSplit && StyleUtils.getAmountFontSizeAndLineHeight(isSmallScreenWidth, windowWidth, displayAmount.length, sortedParticipantAvatars.length),
isDeleted && styles.lineThrough,
]}
numberOfLines={1}
>
{displayAmount}
</Text>
{ReportUtils.isSettled(iouReport?.reportID) && !isBillSplit && (
<View style={styles.defaultCheckmarkWrapper}>
<View style={[styles.expenseAndReportPreviewBoxBody, hasReceipt ? styles.mtn1 : {}]}>
<View style={styles.expenseAndReportPreviewTextButtonContainer}>
<View style={styles.expenseAndReportPreviewTextContainer}>
<View style={[styles.flexRow]}>
<Text style={[styles.textLabelSupporting, styles.flex1, styles.lh16]}>
{getPreviewHeaderText() + (isSettled && !iouReport?.isCancelledIOU ? ` • ${getSettledMessage()}` : '')}
</Text>
{!isSettled && shouldShowRBR && (
<Icon
src={Expensicons.Checkmark}
fill={theme.iconSuccessFill}
src={Expensicons.DotIndicator}
fill={theme.danger}
/>
</View>
)}
</View>
{isBillSplit && (
<View style={styles.moneyRequestPreviewBoxAvatar}>
<MultipleAvatars
icons={sortedParticipantAvatars}
shouldStackHorizontally
size="small"
isHovered={isHovered}
shouldUseCardBackground
/>
)}
</View>
)}
</View>
<View style={[styles.flexRow, styles.mt1]}>
<View style={[styles.flex1]}>
{!isCurrentUserManager && shouldShowPendingConversionMessage && (
<Text style={[styles.textLabel, styles.colorMuted]}>{translate('iou.pendingConversionMessage')}</Text>
)}
{shouldShowDescription && (
<View style={[styles.breakWord, styles.preWrap]}>
<RenderHTML html={`<muted-text>${parser.replace(merchantOrDescription)}</muted-text>`} />
<View style={styles.reportPreviewAmountSubtitleContainer}>
<View style={[styles.flexRow]}>
<View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter]}>
<Text
style={[
styles.textHeadlineH1,
isBillSplit &&
StyleUtils.getAmountFontSizeAndLineHeight(isSmallScreenWidth, windowWidth, displayAmount.length, sortedParticipantAvatars.length),
isDeleted && styles.lineThrough,
]}
numberOfLines={1}
>
{displayAmount}
</Text>
{ReportUtils.isSettled(iouReport?.reportID) && !isBillSplit && (
<View style={styles.defaultCheckmarkWrapper}>
<Icon
src={Expensicons.Checkmark}
fill={theme.iconSuccessFill}
/>
</View>
)}
</View>
{isBillSplit && (
<View style={styles.moneyRequestPreviewBoxAvatar}>
<MultipleAvatars
icons={sortedParticipantAvatars}
shouldStackHorizontally
size="small"
shouldUseCardBackground
/>
</View>
)}
</View>
<View style={[styles.flexRow]}>
<View style={[styles.flex1]}>
{!isCurrentUserManager && shouldShowPendingConversionMessage && (
<Text style={[styles.textLabel, styles.colorMuted]}>{translate('iou.pendingConversionMessage')}</Text>
)}
{shouldShowDescription && (
<View style={[styles.breakWord, styles.preWrap]}>
<RenderHTML html={`<muted-text>${parser.replace(merchantOrDescription)}</muted-text>`} />
</View>
)}
{shouldShowMerchant && <Text style={[styles.textLabelSupporting, styles.textNormal]}>{merchantOrDescription}</Text>}
</View>
{isBillSplit && participantAccountIDs.length > 0 && !!requestAmount && requestAmount > 0 && (
<Text style={[styles.textLabel, styles.colorMuted, styles.ml1, styles.amountSplitPadding]}>
{translate('iou.amountEach', {
amount: CurrencyUtils.convertToDisplayString(
IOUUtils.calculateAmount(isPolicyExpenseChat ? 1 : participantAccountIDs.length - 1, requestAmount, requestCurrency ?? ''),
requestCurrency,
),
})}
</Text>
)}
</View>
)}
{shouldShowMerchant && <Text style={[styles.textLabelSupporting, styles.textNormal]}>{merchantOrDescription}</Text>}
</View>
</View>
{isBillSplit && participantAccountIDs.length > 0 && !!requestAmount && requestAmount > 0 && (
<Text style={[styles.textLabel, styles.colorMuted, styles.ml1, styles.amountSplitPadding]}>
{translate('iou.amountEach', {
amount: CurrencyUtils.convertToDisplayString(
IOUUtils.calculateAmount(isPolicyExpenseChat ? 1 : participantAccountIDs.length - 1, requestAmount, requestCurrency ?? ''),
requestCurrency,
),
})}
</Text>
)}
</View>
</View>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ function MoneyRequestView({
shouldShowTitleIcon={isSettled}
titleIcon={Expensicons.Checkmark}
description={amountDescription}
titleStyle={styles.newKansasLarge}
titleStyle={styles.textHeadlineH2}
interactive={canEditAmount}
shouldShowRightIcon={canEditAmount}
onPress={() => Navigation.navigate(ROUTES.EDIT_REQUEST.getRoute(report.reportID, CONST.EDIT_REQUEST_FIELD.AMOUNT))}
Expand Down
Loading
Loading