-
Notifications
You must be signed in to change notification settings - Fork 29
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
Convert download modal to block #52
Comments
I've moved this out of the current iteration since we don't need it for launch, but I do think it's a good idea for the future. There will probably be other places we'll need a content modal (for example, we have some on the Patterns site). Tagging it Needs Design so we can work with designers to figure out the editor interface. Probably needs a button which can toggle the modal, and then an area for the writer to enter modal content. The button should have all the same features as the core button block. What else does it need? |
Sorry I missed this. Can you expand a little bit on the context? Which page will the modal be invoked from, what's the contents of the modal, and what interface will be necessary for the editor block? Thank you 🙏 |
Hi @jasmussen I've added more detail in the description. Let me know if anything doesn't make sense 🙏 |
Ah, thank you that's good context. Not related to this issue, but just seeing the external link indicators next to the links in the modal, are those icons necessary in a webpage where presumably everything is an "external link"? Regarding the modal:
As for the editing interface, I understand that the reason for making it a block, is to make it easier for editors to customize the contents inside the modal. I also have a feeling that a lavish "Modal" block can become quite an undertaking to get right. So in trying to match effort with impact, it would be good to have an understanding of how widely this modal is, or will be, used across the site. If it's only on the download page, and only with text inside, probably best to keep the block editor interface extremely minimal — essentially text-field in the inspector for a Button block, and little more — can even be raw HTML, IMO, just to keep dev effort to the absolutely minimum. Then need, as a driver for invention, can then learn us whether we need to upgrade it beyond that. In a more lavish representation, I would imagine a toolbar button to open the modal, and then have the modal itself be editable. What do you think? |
Yeah so hard to say at the moment with Themes and Showcase about to start, then the rest to follow. I feel like the design team will have more idea of whether it'll be a widely used pattern at this point. Agree that we should start slim and build up as we need to. I'm a little too inexperienced to know how much dev effort will be involved. @ryelle do you have any thoughts on the extremely minimal vs the more lavish approach outlined above? |
Ah, I see the pattern now with the separators, the arrows add some nice detail there. Don't mind me.
Right, I was mainly thinking in terms of content. I'll run this by the rest of the group! Thanks. |
I think you can use your judgement to build something in that spectrum - personally I think the fancy concept would be fun to build, but unless we need it on other pages (seems like no, so far), I wouldn't spend more than a day on it. |
I'm going to close this, the current download modal has been working just fine. |
The modal on the Download page is currently custom coded:
Initialisation: https://github.com/WordPress/wporg-main-2022/blob/trunk/source/wp-content/themes/wporg-main-2022/src/download/index.js
Component: https://github.com/WordPress/wporg-main-2022/blob/trunk/source/wp-content/themes/wporg-main-2022/src/components/download-modal/download-modal.js
Problems
import { Modal } from '@wordpress/components';
loads the entire@wordpress/components
package on the client. If we could render the modal server side using a block we could avoid this.Requirements
All content configured through the page editor. Input fields required to achieve this:
To make the component more reusable we could consider adding button config/content for actions, eg. 'OK', 'Dismiss', or some other call to action.
The modal block would need to be linked to a button or link block in the page content somehow.
The block should probably live in https://github.com/WordPress/wporg-mu-plugins
The text was updated successfully, but these errors were encountered: