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

feature: Ability to customize icons; avoid large icon dependency #6

Merged
merged 14 commits into from
Jan 22, 2020
Merged

feature: Ability to customize icons; avoid large icon dependency #6

merged 14 commits into from
Jan 22, 2020

Conversation

baleeds
Copy link

@baleeds baleeds commented Jan 20, 2020

This PR will:

  • Bump React peer dep to ensure support for Context API
  • Add default icons map
  • Add default Icon component
  • Add config context to provide both items
  • Swap all uses of hardcoded Icon component
  • Add documentation for swapping icons
  • Bump package version

Points of contention:

  • Naming of new context, and the fact that it only contains the icon specific things, even though some other stuff feels like it belongs in the "config"
  • Tests were failing when I tried them before and after my work
  • Generating the file type to icon map in IconUtils runs every now and then, but its not the least efficient thing ever

#5

@baleeds baleeds requested a review from TimboKZ January 20, 2020 21:19
@baleeds
Copy link
Author

baleeds commented Jan 20, 2020

@audiolion @mmgolden
What do you guys think?

@baleeds baleeds changed the title feature: Customizable icons & direct import of Font Awesome icons feature: Ability to customize icons; avoid large icon dependency Jan 20, 2020
@TimboKZ
Copy link
Owner

TimboKZ commented Jan 20, 2020

The pull request looks good overall, I like the new icon abstraction. Will need to pull it and test locally.

The code formatting is now a bit inconsistent throughout the project, but I was planning to add Prettier to the project anyway so that shouldn't matter much.

Will try to merge in the next couple of days.

@TimboKZ
Copy link
Owner

TimboKZ commented Jan 20, 2020

RE: Tests - ignore them, they don't do anything at the moment. I'll figure something out later.

@baleeds
Copy link
Author

baleeds commented Jan 20, 2020

Sounds good. Yeah I noticed the formatting, definitely muddles the review process, sorry about that. I think prettier would be a very nice addition.

package.json Outdated Show resolved Hide resolved
@audiolion
Copy link

Sounds good. Yeah I noticed the formatting, definitely muddles the review process, sorry about that. I think prettier would be a very nice addition.

The code formatting is now a bit inconsistent throughout the project, but I was planning to add Prettier to the project anyway so that shouldn't matter much.

Perhaps a separate PR is created and merged first that applies prettier and adds a prettier config so that when this PR is rebased it will remove all formatting changes?

@TimboKZ
Copy link
Owner

TimboKZ commented Jan 21, 2020

Just merged #7, can you please rebase your changes on top of that?

@baleeds
Copy link
Author

baleeds commented Jan 21, 2020

It worked! Much easier to see what I changed now. It was a gnarly merge resolution though, so there is possibly some broken things. I tested everything I could think of manually in the styleguide.

Comment on lines +4 to +9
export interface ConfigValue {
icons: typeof icons;
Icon: typeof Icon;
}

export const ConfigContext = React.createContext<ConfigValue>({ Icon, icons });
Copy link
Owner

Choose a reason for hiding this comment

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

We should probably break this context down into smaller parts once we add hooks.

@TimboKZ TimboKZ merged commit b175f8e into TimboKZ:master Jan 22, 2020
@baleeds baleeds deleted the feature/customizable-icons branch January 23, 2020 15:29
samuelncui pushed a commit to samuelncui/Chonky that referenced this pull request Oct 4, 2023
…_yarn/reduxjs/toolkit-1.9.2

Bump @reduxjs/toolkit from 1.9.1 to 1.9.2
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.

3 participants