charkour / react-reactions

😲 Create custom reaction pickers and counters or use your favorites!
MIT License
74 stars 16 forks source link

Pass className to Selector #114

Open justemoilouise opened 3 years ago

justemoilouise commented 3 years ago

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

charkour commented 3 years ago

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.

justemoilouise commented 3 years ago

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

charkour commented 3 years ago

Thanks! I appreciate it.

charkour commented 2 years ago

@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

justemoilouise commented 2 years ago

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

charkour commented 2 years ago

Alright, thanks for the update!

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!!

lagroms commented 2 years ago

Hello,

Is there any news regarding the custom styling feature ?

Thanks !

charkour commented 2 years ago

Hey @lagroms,

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

Thanks

lagroms commented 2 years ago

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 commented 2 years ago

My bad, my question was regarding the ability to add a className on the 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.

charkour commented 2 years ago

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?