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

[Wave9] Progress Bar UI #64

Merged
merged 11 commits into from
Feb 19, 2024
Merged

Conversation

MaciejSWM
Copy link

@MaciejSWM MaciejSWM commented Feb 7, 2024

https://linear.app/expensify-swm/issue/EXP-274/[wave-9]-new-onboarding-flow-progress-bar-[just-the-ui]

UI and Storybook for the Progress bar. To test, easiest way is to npm run storybook
http://localhost:6006/?path=/story/components-headerwithbackbutton--progress-bar

Storybook seems to be broken after merge. Looks like it's broken on main as well. In this case best way to test is to do progressBarPercentage = 25, in src/components/HeaderWithBackButton/index.tsx and to open workspace switcher or any screen with header

@MaciejSWM MaciejSWM changed the base branch from wave-9/onboarding-flow to wave9/onboarding-flow February 7, 2024 15:11
@MaciejSWM MaciejSWM marked this pull request as ready for review February 8, 2024 14:29
Copy link

@kowczarz kowczarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor code issue, and run typecheck because there are some issues in files you didn't change, but they are affected by your changes.

Comment on lines 119 to 122
shouldShowProgressBar: boolean;

/** 0 - 100 number indicating current progress of the progress bar */
progressBarPercentage: number;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are non-null props, but you're setting the default value here, not sure what was the purpose, but that's something that needs to be changed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MaciejSWM MaciejSWM changed the title [Wave9] Onboarding Flow [Wave9] Progress Bar UI Feb 16, 2024
@@ -70,6 +71,33 @@ function HeaderWithBackButton({
// If the icon is present, the header bar should be taller and use different font.
const isCentralPaneSettings = !!icon;

let middleContent = null;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let middleContent = null;
let middleContent;

Comment on lines 75 to 99
if (progressBarPercentage) {
middleContent = (
<View>
<View style={styles.progressBarWrapper}>
<View style={[{width: `${progressBarPercentage}%`}, styles.progressBar]} />
</View>
</View>
);
} else if (shouldShowAvatarWithDisplay) {
middleContent = (
<AvatarWithDisplayName
report={report}
policy={policy}
shouldEnableDetailPageNavigation={shouldEnableDetailPageNavigation}
/>
);
} else {
middleContent = (
<Header
title={title}
subtitle={stepCounter ? translate('stepCounter', stepCounter) : subtitle}
textStyles={titleColor ? [StyleUtils.getTextColorStyle(titleColor)] : []}
/>
);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider wrapping it in useMemo

src/components/HeaderWithBackButton/types.ts Show resolved Hide resolved
@MaciejSWM MaciejSWM merged commit 46eb9a6 into wave9/onboarding-flow Feb 19, 2024
8 of 12 checks passed
@MaciejSWM MaciejSWM deleted the wave9/header-progress-bar branch February 19, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants