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(gatsby-plugin-manifest): don't output theme-color if it's not defiened #10069

Merged
merged 3 commits into from
Nov 21, 2018
Merged

feat(gatsby-plugin-manifest): don't output theme-color if it's not defiened #10069

merged 3 commits into from
Nov 21, 2018

Conversation

DZuz14
Copy link
Contributor

@DZuz14 DZuz14 commented Nov 21, 2018

Not really sure how I go about submitting a PR here. This addition references issue #9977

Any guidance would be greatly appreciated.

Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

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

This looks reasonable - maybe small code change so it's easier to read what it does.

Another thing - can you remove changes in packages/gatsby-source-faker/README.md?

]
: []
)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we prep headComponents array ahead of time to avoid concat with ternary operator inside it?

const headComponents = [
  <link
    key={`gatsby-plugin-manifest-link`}
    rel="manifest"
    href={withPrefix(`/manifest.webmanifest`)}
  />,
]

if (pluginOptions.theme_color) {
  headComponents.push(
    <meta
      key={`gatsby-plugin-manifest-meta`}
      name="theme-color"
      content={pluginOptions.theme_color}
    />
  )
}

setHeadComponents(headComponents)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I thought I got rid of those changes to that ReadMe. I am not even sure how they got changed to be honest. Dog stepping on keyboard perhaps lol.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it alright that I created the headComponents array at the top of the function, and changed the other conditionals to just add to this array as we step through the function? I think this makes it pretty legible and easy to understand whats going on. I ran the tests after this change and everything still seems to work just fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, yeah, that's fine too 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, actually this README changes (that your dog committed 🤣 ) seems like something very weird is happening and I get them locally too, I'll just merge with those - hopefully this will fix problems lol

@pieh pieh changed the title [gatsby-plugin-manifest] Added ability to opt out of theme color meta tag feat(gatsby-plugin-manifest): don't output theme-color if it's not defiened Nov 21, 2018
@pieh pieh merged commit 7802470 into gatsbyjs:master Nov 21, 2018
@gatsbot
Copy link

gatsbot bot commented Nov 21, 2018

Holy buckets, @DZuz14 — we just merged your PR to Gatsby! 💪💜

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. (Currently we’ve got a couple t-shirts available, plus some socks that are really razzing our berries right now.)
  2. We just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. Accept the invite by visiting https://github.com/orgs/gatsbyjs/invitation. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again!

@pieh
Copy link
Contributor

pieh commented Nov 21, 2018

published [email protected]

@DZuz14 DZuz14 deleted the gatsby-plugin-manifest/remove-theme-color-meta branch November 22, 2018 11:41
gpetrioli pushed a commit to gpetrioli/gatsby that referenced this pull request Jan 22, 2019
…it's not defiened (gatsbyjs#10069)

Not really sure how I go about submitting a PR here. This addition references issue gatsbyjs#9977

Any guidance would be greatly appreciated.
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.

2 participants