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 report screen header skeleton spacing #36317

Merged
merged 4 commits into from
Feb 19, 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
19 changes: 12 additions & 7 deletions src/components/ReportHeaderSkeletonView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import useLocalize from '@hooks/useLocalize';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import Icon from './Icon';
import * as Expensicons from './Icon/Expensicons';
Expand All @@ -22,9 +21,15 @@ function ReportHeaderSkeletonView({shouldAnimate = true, onBackButtonPress = ()
const styles = useThemeStyles();
const {translate} = useLocalize();
const {isSmallScreenWidth} = useWindowDimensions();
const smallScreenHeight = styles.appContentHeader.height;
const height = !isSmallScreenWidth ? styles.headerBarDesktopHeight.height : smallScreenHeight;
const radius = 20;
const circleY = height / 2;
const circleTopY = circleY - radius;
const circleBottomY = circleY + radius;

return (
<View style={[styles.appContentHeader, isSmallScreenWidth && styles.pl2]}>
<View style={[styles.appContentHeader, isSmallScreenWidth && styles.pl2, styles.h100]}>
<View style={[styles.appContentHeaderTitle, !isSmallScreenWidth && styles.pl5]}>
{isSmallScreenWidth && (
<PressableWithFeedback
Expand All @@ -42,24 +47,24 @@ function ReportHeaderSkeletonView({shouldAnimate = true, onBackButtonPress = ()
<SkeletonViewContentLoader
animate={shouldAnimate}
width={styles.w100.width}
height={variables.contentHeaderHeight}
height={height}
backgroundColor={theme.highlightBG}
foregroundColor={theme.border}
>
<Circle
cx="20"
cy="40"
r="20"
cy={height / 2}
r={radius}
/>
<Rect
x="55"
y="28"
y={circleTopY + 8}
width="30%"
height="8"
/>
<Rect
x="55"
y="48"
y={circleBottomY - 12}
width="40%"
height="8"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/HeaderView.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function HeaderView(props) {
dataSet={{dragArea: true}}
>
<View style={[styles.appContentHeader, !isSmallScreenWidth && styles.headerBarDesktopHeight]}>
<View style={[styles.appContentHeaderTitle, !isSmallScreenWidth && styles.pl5]}>
<View style={[styles.appContentHeaderTitle, !isSmallScreenWidth && !isLoading && styles.pl5]}>
{isLoading ? (
<ReportHeaderSkeletonView onBackButtonPress={props.onNavigationMenuButtonClicked} />
) : (
Expand Down
Loading