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

Adding Styling Hooks #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

davidgljay
Copy link

What does this PR do?

Enables custom styles to be passed in as props (ie "wrapperStyle" restyles the wrappers around emoji.) New styles are merged with default styles rather than replacing them entirely to facilitate changing just a few style elements.

How to test this PR?

  • Pass a customized style into the component as indicated in the updated readme.
  • Style changes should be displayed.

onClick = () => {}
} = this.props;

const wrapperFinalStyle = this.state.hovered ? {...wrapperStyle, ...wrapperHover} : wrapperStyle;
const countFinalStyle = this.state.hovered ? {...countStyle, ...countHover} : countStyle;
const wrapperFinalStyle = this.state.hovered ? { ...this.props.customStyles.wrapperStyle, ...this.props.customStyles.wrapperHover) : this.props.customStyles.wrapperStyle;
Copy link
Owner

Choose a reason for hiding this comment

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

these are getting a bit long now, can we multiline them, preferably like below

(
  this.state.hovered 
  ? 
  { ...this.props.customStyles.wrapperStyle, ...this.props.customStyles.wrapperHover)
  : 
  this.props.customStyles.wrapperStyle
);

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