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

Woo Installer: Landing page redesign re-deploy #58179

Merged
merged 24 commits into from
Nov 17, 2021

Conversation

allilevine
Copy link
Member

Changes proposed in this Pull Request

  • Add new landing page component to /woocommerce-installation flow.
  • Add new CtaSection component.
  • Change fixed navigation component to take a contentRef prop and show/hide the right content depending on whether it's also visible on the page.

Testing instructions

  • Checkout this branch and click on the "WooCommerce" nav menu item on an Atomic site that doesn't have Woo installed.
  • Verify that the new landing page displays.
  • Check that clicking "Set up my store!" still works to install Woo.
  • Check that when you scroll past the CTA button, it appears in the header.
  • Check that other pages using the fixed navigation component (like /plugins) display correctly.
  • Check that you get a notice if you try to start this flow without confirming your email address.

Before

After

Related to #57419

@github-actions
Copy link

@allilevine allilevine requested a review from a team November 17, 2021 16:17
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Nov 17, 2021
Copy link
Contributor

@retrofox retrofox left a comment

Choose a reason for hiding this comment

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

Tested again and LGTM.

Screen.Recording.2021-11-17.at.2.20.42.PM.mov

@allilevine allilevine merged commit 5ce4b66 into trunk Nov 17, 2021
@allilevine allilevine deleted the update/woocommerce-install-landing-page branch November 17, 2021 18:16
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Nov 17, 2021
@a8ci18n
Copy link

a8ci18n commented Nov 17, 2021

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/6979606

Thank you @allilevine for including a screenshot in the description! This is really helpful for our translators.

@a8ci18n
Copy link

a8ci18n commented Nov 29, 2021

Translation for this Pull Request has now been finished.

nelsonec87 pushed a commit that referenced this pull request Dec 9, 2021
* Add WoopLandingPage component

* Add cta header component

* Remove extra comment

* Style landing page

* Hide/Show Navigation Button when scrolling past the CTA Button

* Re-organize components and use Types

* Add SetupNotices to the new landing page

* Add some responsive CSS and remove mixin

* Remove style import and use rem

* Add WoopLandingPage component

* Add cta header component

* Remove extra comment

* Style landing page

* Adds WaveMasonry component to the woop landing page

* Rendering only images

* changes cta-header to 1 column layout on mobile

* Update client/components/masonry-wave/index.jsx

* Clean up merge conflicts

* Clean up landing-page prop

* Clean up spacing, scroll

* Add WooCommerce title

* cta-header uses css-grid 1 column layout and centers content on mobile

* adds @automattic/viewport-react and fixes key related warnings

- Adds @automattic/viewport-react to the MasonryWave component to conditionally render different layouts on mobile and web.
- Fixes missing key warnings on the MasonryWave component.

* renaming cta images to a more descriptive name | removing unused cta images

Co-authored-by: Rolando Perez <me@rolilink.com>
Co-authored-by: Louis Laugesen <louis.laugesen@gmail.com>
ctaRef?: React.RefObject< HTMLButtonElement >;
}

const CtaSection: React.FunctionComponent< Props > = ( props ) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for being super late here 😅... Is this component still used? Should we remove it if it's not?

If it's still used, can we addd readme, example, and also integrate in devdocs https://wpcalypso.wordpress.com/devdocs/?

);
};

const MasonryWave = ( props ) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for being super late here 😅... Is this component still used? Should we remove it if it's not?

If it's still used, can we addd readme, example, and integrate it in devdocs https://wpcalypso.wordpress.com/devdocs/? Also, I feel that the component name MasonryWave doesn't really help in understanding what this component is used for. Is it for rendering an image grid?

Comment on lines +67 to +96
useEffect( () => {
if ( ! contentRef ) {
return;
}

const handleScroll = () => {
const headerHeight = headerRef?.current?.getBoundingClientRect().height;
const offset =
contentRef.current && headerHeight ? contentRef.current.offsetTop - headerHeight : 0;
const scrollPosition = window.scrollY;
const actionElement = actionsRef?.current;

if ( ! actionElement ) {
return;
}

if ( offset > 0 && scrollPosition < offset ) {
actionElement.style.visibility = 'hidden';
} else {
actionElement.style.visibility = 'visible';
}
};

handleScroll();

window.addEventListener( 'scroll', handleScroll );
return () => {
window.removeEventListener( 'scroll', handleScroll );
};
}, [ contentRef ] );
Copy link
Contributor

Choose a reason for hiding this comment

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

After looking at https://github.com/Automattic/wp-calypso/pull/62080/files, I found at about this code. Can we add some comments about what this useEffect does for posterity? Also, I noticed a new prop which should be added in the readme

- `navigationItems` (`{ label: string; href: string }[]`) - The Navigations items to be shown
- `id` (`string`) - ID for the header (optional)
- `className` (`string`) - A class name for the wrapped component (optional)
- `children` (`nodes`) – Any children elements which are being rendered to the far right (optional)
- `compactBreadcrumb` (`boolean`) - Displays only the previous item URL reading "Back" in the breadcrumb (optional)

Moreover, it seems to me that it could have been the parent component responsibility to render or not the actionElement (perhaps by using a similar useEffect rather than having to pass the contentRef. Is there a reason for choosing to place this functionality here?

Copy link
Member Author

Choose a reason for hiding this comment

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

@cpapazoglou Would you mind opening issues for these so we can triage them, rather than commenting on a merged PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, I just thought we can discuss it first. Added here #62166

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

7 participants