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

fix(Readme.mdx): fixed readme doc with correct import directory for custom icons #2382

Merged
merged 6 commits into from
Jul 11, 2023

Conversation

Lakesxo
Copy link
Contributor

@Lakesxo Lakesxo commented Jan 23, 2023

Purpose of PR

  • I realized that custom icons can not be imported from "@contentful/f36-components" rather they are imported from "@contentful/f36-icons" but the docs says otherwise. So I have decided to kindly point this out and improve the page with the right import directory ❤️

PR Checklist

  • I have read the relevant readme.md file(s)
  • All commits follow our Git commit message convention
  • Tests are added/updated/not required
  • Tests are passing
  • Storybook stories are added/updated/not required
  • Usage notes are added/updated/not required
  • Has been tested based on Contentful's browser support
  • Doesn't contain any sensitive information

@changeset-bot
Copy link

changeset-bot bot commented Jan 23, 2023

⚠️ No Changeset found

Latest commit: 6eeecf5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 23, 2023

@Lakesxo is attempting to deploy a commit to the Contentful Apps Team on Vercel.

A member of the Team first needs to authorize it.

@denkristoffer
Copy link
Collaborator

👋 Hi @Lakesxo, thanks for the contribution! I see your point here, I had to go back and read it again myself to understand what is going on. The code import is actually the right one, but the comment above it is not explaining what we mean by "custom icons", which leads to confusion.

What the second import tries to tell us is how to render totally custom icons like something from a third-party library https://f36.contentful.com/components/icon#custom-icons-and-third-party-libraries – do you have a suggestion how we can phrase this better? Do you find // or, for third-party icons clearer?

@Lakesxo
Copy link
Contributor Author

Lakesxo commented Jan 24, 2023

👋 Hi @Lakesxo, thanks for the contribution! I see your point here, I had to go back and read it again myself to understand what is going on. The code import is actually the right one, but the comment above it is not explaining what we mean by "custom icons", which leads to confusion.

What the second import tries to tell us is how to render totally custom icons like something from a third-party library https://f36.contentful.com/components/icon#custom-icons-and-third-party-libraries – do you have a suggestion how we can phrase this better? Do you find // or, for third-party icons clearer?

Oh okay. Yeah i think the third-party icons phrase sounds better @denkristoffer
But when i tried to import a forma custom icon e.g PlusIcon from "@contentful/f36-components" it didn't work until i imported from "@contentful/f36-icons";

@denkristoffer
Copy link
Collaborator

@Lakesxo No you're right, that's the way to do it. Maybe we should change the first line to make it more clear too 🤔

@Lakesxo
Copy link
Contributor Author

Lakesxo commented Jan 24, 2023

@denkristoffer Yeah i think you should. Maybe something like:

// Import as an object :
import * as icons from '@contentful/f36-icons';
// Import single component as :
import { PlusIcon, DoneIcon } from "@contentful/f36-icons";
// Third party custom icons as :
import { Icon } from '@contentful/f36-components';

Access import as an object:

function IconExample() {
     return (
          <>
              {icons.PlusIcon}
              {icons.DoneIcon}
          </>
     )
}

OR

Access import as a single component:

function IconExample() {
     return (
          <>
              <PlusIcon />
              <DoneIcon />
          </>
     )
}

@denkristoffer
Copy link
Collaborator

@Lakesxo That looks good to me 😄 Would you like to update the PR with that?

@Lakesxo
Copy link
Contributor Author

Lakesxo commented Feb 13, 2023

@Lakesxo That looks good to me 😄 Would you like to update the PR with that?

Sure, will do @denkristoffer

@vercel
Copy link

vercel bot commented Feb 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
forma-36 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2023 9:37am

@github-actions
Copy link

Marking pull request as stale since there was no activity for 30 days

@github-actions github-actions bot added the stale Used to mark when there was no activity for a set period of time label Mar 23, 2023
@denkristoffer
Copy link
Collaborator

@all-contributors add @Lakesxo for docs

@denkristoffer denkristoffer merged commit ab3b595 into contentful:main Jul 11, 2023
2 of 3 checks passed
@allcontributors
Copy link
Contributor

@denkristoffer

I've put up a pull request to add @Lakesxo! 🎉

@denkristoffer denkristoffer removed the stale Used to mark when there was no activity for a set period of time label Jul 11, 2023
@denkristoffer
Copy link
Collaborator

Thanks for the contribution @Lakesxo! I'm sorry it took so long to get merged 🙇 Thanks again!

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