mirror of
https://github.com/flarum/core.git
synced 2025-01-17 14:18:33 +01:00
Fix email confirmation alert
Currently, the controls are on a new line due to the container div. We want to wrap ALL children of the alert, including the controls, in the container div. We need to split it into a separate class so that we can add modify the alert vnode AFTER the alert component's `view` logic has been applied.
This commit is contained in:
parent
27d562f3fc
commit
f8a0d9459a
@ -52,13 +52,18 @@ export default function alertEmailConfirmation(app) {
|
||||
}
|
||||
}
|
||||
|
||||
class ContainedAlert extends Alert {
|
||||
view(vnode) {
|
||||
const vdom = super.view(vnode);
|
||||
return { ...vdom, children: [<div className="container">{vdom.children}</div>] };
|
||||
}
|
||||
}
|
||||
|
||||
m.mount($('<div/>').insertBefore('#content')[0], {
|
||||
view: () => (
|
||||
<Alert dismissible={false} controls={[<ResendButton />]}>
|
||||
<div className="container">
|
||||
{app.translator.trans('core.forum.user_email_confirmation.alert_message', { email: <strong>{user.email()}</strong> })}
|
||||
</div>
|
||||
</Alert>
|
||||
<ContainedAlert dismissible={false} controls={[<ResendButton />]}>
|
||||
{app.translator.trans('core.forum.user_email_confirmation.alert_message', { email: <strong>{user.email()}</strong> })}
|
||||
</ContainedAlert>
|
||||
),
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user