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

feat(OnboardingChecklist): new component #1270

Merged
merged 19 commits into from
Aug 8, 2024

Conversation

marcinsawicki
Copy link
Contributor

@marcinsawicki marcinsawicki commented Aug 2, 2024

Resolves: #{issue-number}

Description

Storybook

https://feature-onboarding-checklist--613a8e945a5665003a05113b.chromatic.com/?path=/story/components-onboardingchecklist--default

Checklist

Obligatory:

  • Self review (use this as your final check for proposed changes before requesting the review)
  • Add correct label
  • Assign pull request with the correct issue

@marcinsawicki marcinsawicki self-assigned this Aug 6, 2024
@marcinsawicki marcinsawicki added the feature New feature or request label Aug 6, 2024
@marcinsawicki marcinsawicki added this to the Cycle #9 milestone Aug 6, 2024
@marcinsawicki marcinsawicki marked this pull request as ready for review August 6, 2024 10:41
export interface IOnboardingChecklistProps {
className?: string;
title: string;
titleLabel?: string;

Choose a reason for hiding this comment

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

Better to rename it
GreetingText: This name clearly indicates that the text is a greeting or welcome message.

}
}

@media not (width >= 920px) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be simplified to: (max-width: 919px)

display: flex;
flex-direction: row;
gap: var(--spacing-5);
padding: 20px;
Copy link
Contributor

Choose a reason for hiding this comment

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

space

Suggested change
padding: 20px;
padding: var(--spacing-5);


&__column {
position: relative;
padding: 40px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
padding: 40px;
padding: var(--spacing-10);

const currentHeight = container.offsetHeight;
setCurrentContainerHeight(currentHeight);

setTimeout(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

we need to clear timeouts afterward

completeItem,
className,
}) => {
const [complete, setComplete] = React.useState(isCompleted);
Copy link
Contributor

Choose a reason for hiding this comment

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

The name of this state can be confused with an external prop. Can you please rename is for better readability?

};

React.useEffect(() => {
const delay = completeItem?.delay || 1500;
Copy link
Contributor

Choose a reason for hiding this comment

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

why the completeItem marked here as optional, in the component's interface it is marked as required?

import styles from './OnboardingChecklist.module.scss';

const baseClass = 'onboarding-checklist';
const COMPLETE_CONTAINER_EIGHT = 96;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const COMPLETE_CONTAINER_EIGHT = 96;
const COMPLETE_CONTAINER_HEIGHT = 96;

Comment on lines 68 to 70
!complete || isOpen
? currentContainerHeight
: COMPLETE_CONTAINER_EIGHT,
Copy link
Contributor

Choose a reason for hiding this comment

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

Will the completeStep always have the same height(COMPLETE_CONTAINER_EIGHT)? Because data from completeItem is dynamic

Comment on lines 116 to 127
items.map((item, index) => {
return (
item.id === activeId && (
<div
key={index}
className={styles[`${baseClass}__placeholder`]}
>
{item.placeholder}
</div>
)
);
})}
Copy link
Contributor

Choose a reason for hiding this comment

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

iterating through the whole array to display just one selected element is not the best idea. You can get this element by its Id and show it here

)
);
})}
{isCompleted && completeItem && (
Copy link
Contributor

Choose a reason for hiding this comment

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

you do not need to check for completeItem as it is not marked as optional

Copy link

@vladko-uxds vladko-uxds left a comment

Choose a reason for hiding this comment

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

👍


export interface IOnboardingChecklistProps {
className?: string;
title: string;

Choose a reason for hiding this comment

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

Title: This name suggests that the text is the heading or title of the guide.

@marcinsawicki marcinsawicki merged commit 8f69dcf into main Aug 8, 2024
5 checks passed
@marcinsawicki marcinsawicki deleted the feature/onboarding-checklist branch August 8, 2024 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants