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

Only show and hide some menu at toolbar

Open muh-hizbe opened this issue 3 years ago • 3 comments

customize toolbar for customize showing menu

muh-hizbe avatar Apr 10 '22 02:04 muh-hizbe

Thank @muh-hizbe yes this is certainly something that would be helpful.

I have no time at the moment to work on react-trix, but I'm happy to review / help anyone that would want to take this one.

dstpierre avatar Jul 18 '22 11:07 dstpierre

@dstpierre i would have some time over the weekend to work on this. Do we have any idea how we'd want this to look like?

claeusdev avatar Jul 19 '22 21:07 claeusdev

@claeusdev that's great. I don't have much preference to be honest. From what I understand, the toolbar configuration is done via the Trix.config if I'm not mistaken.

I guess TrixEditor would need to accept a new property that describe what the user wants for their toolbar and apply this when the component creates the underlying trix component.

I suppose you could start by adding a new function in the componentDidMount line:77 that would run if the caller provided a value for the custom toolbar property.

This function would apply anything to the toolbar.

This is just an idea, feel free to explore and ask questions if you have any.

dstpierre avatar Jul 22 '22 09:07 dstpierre