Render modal for user


I tried to customize for myself the discourse-patreon plugin. This plugin renders prompt about donation after “topic-above-footer-buttons” for some conditions:

But I want to render the same in modal instead. I know about showModal and try to use it here, but unfortunately failed. Really don’t understand how I can achieve this in my case. Can anyone suggest what I need to do?

Best regards