superhuit-agency / superstack

Our opinionated headless WordPress boilerplate - with GraphQL, RSC, PostCSS
MIT License
24 stars 4 forks source link

Factorize Link, ButtonEdit, URLPicker #49

Open kuuak opened 3 months ago

kuuak commented 3 months ago

I feel that there the src/helpers/Link should be converted into a component and that there is too many ways to have an edition of a link or a button in the editor.

We have wordpress/theme/lib/editor/components/ButtonEdit, wordpress/theme/lib/editor/components/UrlPicker & the src/components/atoms/Button/edit.tsx files.

I don't understand exactly too goal of each one.

Here would be my proposition:

  1. Create a component Link in src/components/atoms/Link
    • it will have the index to render the front-end (which is currently the src/helpers/Link/index.tsx file
    • an edit.tsx file for the edition in the editor. It should maybe regroup functions of both ButtonEdit and UrlPicker or also in relation to #3
  2. Move the ButtonEdit into the components/atoms/Button/edit.tsx file

What are your thoughts?

charl0tee commented 2 months ago

@kuuak Yep I agree ! If we can have a common way to add links inside the editor it's perfect !