Skip to content

Add icon-specific className to React default props - #453

Merged
colebemis merged 7 commits into
primer:release-12.1.0from
FloEdelmann:class-names
Feb 23, 2021
Merged

colebemis merged 7 commits into
primer:release-12.1.0from
FloEdelmann:class-names

Conversation

@FloEdelmann

Copy link
Copy Markdown
Contributor

In GitHub, all the icons have a class octicon-${key}, e.g. octicon-arrow-both for the ArrowBothIcon. This PR adds this class to the React components' default props:

  function ArrowBothIcon(props) {
    // …
    return <svg {...getSvgProps({...props, svgDataByHeight})} />
  }

  ArrowBothIcon.defaultProps = {
-   className: 'octicon',
+   className: 'octicon octicon-arrow-both',
    size: 16,
    verticalAlign: 'text-bottom'
  }

@vercel

vercel Bot commented Jun 14, 2020 •

Copy link
Copy Markdown

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/primer/octicons/4pCMWDx4tp5mFvQM2KZ99fymbfmF
✅ Preview: https://octicons-git-fork-floedelmann-class-names-primer.vercel.app

@fregante

Copy link
Copy Markdown
Contributor

I think this makes sense since by default it also has the octicon class as well

@FloEdelmann

Copy link
Copy Markdown
Contributor Author

@colebemis @ashygee Could you please have a quick look at this PR?

@ashygee
ashygee requested a review from colebemis September 28, 2020 14:44
@ashygee

ashygee commented Sep 28, 2020

Copy link
Copy Markdown
Contributor

@FloEdelmann Thanks for this and sorry for the delay! I've assigned this to @colebemis and we'll review this week. Apologies for not seeing this sooner.

@FloEdelmann

Copy link
Copy Markdown
Contributor Author

@colebemis Sorry to bother you again, but given this is literally only one changed line, I don't understand why you still didn't review. Having that extra class name would be really helpful, e.g. in refined-github/refined-github#3227.

@fregante

Copy link
Copy Markdown
Contributor

No rush Flo 🤗

@yakov116

Copy link
Copy Markdown

@colebemis friendly bump

@yakov116

Copy link
Copy Markdown

@colebemis @ashygee its almost 7 months since this PR has been opened and 3 releases. Any chance this can be reviewed?

@colebemis colebemis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great! Sorry for the delay.

We'll ship this in our next release.

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.

5 participants