react-reactions icon indicating copy to clipboard operation
react-reactions copied to clipboard

Pass className to Selector

Open justemoilouise opened this issue 2 years ago • 11 comments

Ideally, it would be nice to be able to pass a className into the selectors so users could add their own styles into it - background-color, etc.

Screen Shot 2021-09-09 at 6 32 23 PM

justemoilouise avatar Sep 09 '21 10:09 justemoilouise

I agree. Want to make a PR? I'm a little busy this week so it would be a bit until I can add this.

charkour avatar Sep 09 '21 10:09 charkour

@charkour I'd be happy to do it. I'll create one as soon as I have time. 😁

justemoilouise avatar Sep 09 '21 11:09 justemoilouise

Thanks! I appreciate it.

charkour avatar Sep 09 '21 11:09 charkour

@justemoilouise, which selectors would you like this to apply to? All of them?

Also, are you actively working on this? If yes, I can assign you to this issue. Thanks

charkour avatar Oct 03 '21 23:10 charkour

@charkour it would be nice to apply it to all of them. I haven't started working on this. 😅

justemoilouise avatar Oct 04 '21 00:10 justemoilouise

Alright, thanks for the update!

  • [ ] Facebook Selector (and Pokemon Selector)
  • [ ] GitHub Selector
  • [ ] Slack Selector
  • [x] Custom Selector

We can use this to track updates. I'm not sure when I'll get time to do this either. But I'll update this if I start to work on it. Or you can let me know if you do. Thanks!!

charkour avatar Oct 04 '21 00:10 charkour

Hello,

Is there any news regarding the custom styling feature ?

Thanks !

lagroms avatar Sep 13 '22 13:09 lagroms

Hey @lagroms,

Right now this custom styling feature is supported for the Custom Selector. Do you need support for other selectors?

Thanks

charkour avatar Sep 13 '22 18:09 charkour

Well I'm using the custom ReactionBarSelector, but no custom class in being applied in my case. Maybe I'm missing something ?

I'm using css-modules in my case :

const Reactions = ({ onSelect }) => {
    return (
        <ReactionBarSelector
            className={styles.reactions_container}
            reactions={reactionOptions}
            onSelect={onSelect}
        />
    );
};

lagroms avatar Sep 14 '22 08:09 lagroms

My bad, my question was regarding the ability to add a className on the <ReactionBarSelector /> component, instead of passing the style directly to it, and also have more control on the rest.

For exemple, i'd like to style the labels, not sure this is currently possible ?

Thanks.

lagroms avatar Sep 14 '22 09:09 lagroms

Hi @lagroms!

Currently it is not possible to style the labels, but that is a great idea. Would you be willing to make a PR for this feature?

charkour avatar Sep 14 '22 16:09 charkour