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

refactor(www): Factor out modal to its own component #21330

Merged
merged 5 commits into from
Feb 10, 2020
Merged

refactor(www): Factor out modal to its own component #21330

merged 5 commits into from
Feb 10, 2020

Conversation

tesseralis
Copy link
Contributor

@tesseralis tesseralis commented Feb 10, 2020

Description

Factor out the modal part of <Layout> into its own <Modal> component.

TODO: further refactors of the ShowcaseDetails component. The primary thing here is simplifying the component.

Motivation

The <Layout> component is used in nearly all pages on gatsbyjs.org and we can get rid of a lot of its cruft, since the isModal prop is only used for the showcase (and at some point starters?).

Screenshots

Modal view:

Screen Shot 2020-02-09 at 9 15 15 PM

Non-modal view:

Screen Shot 2020-02-09 at 9 15 24 PM

@tesseralis tesseralis requested a review from a team as a code owner February 10, 2020 04:57
@@ -46,21 +46,16 @@ class StarterTemplate extends React.Component {
!this.state.showAllDeps && allDeps.length - shownDeps.length > 0

// plug for now
const isModal = false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this isn't being used, I'm deleting it. If we ever wanted a modal for this, it would probably be something like creating a <ModalLayout> component that has the switch between the normal layout and the modal.

Copy link
Contributor

@sidharthachatterjee sidharthachatterjee left a comment

Choose a reason for hiding this comment

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

I like this. This should speed up page load a bunch for most pages! Thanks Nat!

@sidharthachatterjee sidharthachatterjee changed the title refactor (www) Factor out modal to its own component refactor(www): Factor out modal to its own component Feb 10, 2020
@sidharthachatterjee sidharthachatterjee added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Feb 10, 2020
@gatsbybot gatsbybot merged commit 3488800 into gatsbyjs:master Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants