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

Added default option #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Satoshi-Sh
Copy link

@Satoshi-Sh Satoshi-Sh commented Oct 31, 2023

Related issue

closes #115

Updates

  • Added isDefault to Emoji
  • if isDefault is set false, the style will be empty instead of
    { width: "1em", height: "1em", margin: "0 .05em 0 .1em", verticalAlign: "-0.1em", }

Demo isDefault true and false

Tested on React app

isDefaul-demo

@enzoferey
Copy link
Collaborator

Hey @Satoshi-Sh, thanks for the PR!

As I suggested at #48 (comment), I think it's best to give an API to be able to overwrite styles. That way, people may not only remove styles they don't want, but also pass other styles they do want. What do you think?

@Satoshi-Sh
Copy link
Author

Is this working fine?

options={{ props: { style: { ... } } }}

I tried this, but didn't work. Maybe because of TypeScript?
If you can overwrite, it's much better.

<Emoji
                  className="text-xs md:text-sm text-light-slate-10"
                  text={`:${getEmojiNameById(emoji_id)}: ${reaction_count}`}
                  options={{ props: { style: { ... } } }}
                />

I got the following error.
Type '{ props: { style: {...}; }; }' is not assignable to type 'Options'.
Object literal may only specify known properties, and 'props' does not exist in type 'Options'.ts(2322)
index.d.ts(21, 5): The expected type comes from property 'options' which is declared here on type 'IntrinsicAttributes & PropsRequireTextOrChildren'

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.

Option to empty emoji style
2 participants