mirror of
https://github.com/flarum/core.git
synced 2025-07-12 20:36:28 +02: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:
@ -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], {
|
m.mount($('<div/>').insertBefore('#content')[0], {
|
||||||
view: () => (
|
view: () => (
|
||||||
<Alert dismissible={false} controls={[<ResendButton />]}>
|
<ContainedAlert dismissible={false} controls={[<ResendButton />]}>
|
||||||
<div className="container">
|
{app.translator.trans('core.forum.user_email_confirmation.alert_message', { email: <strong>{user.email()}</strong> })}
|
||||||
{app.translator.trans('core.forum.user_email_confirmation.alert_message', { email: <strong>{user.email()}</strong> })}
|
</ContainedAlert>
|
||||||
</div>
|
|
||||||
</Alert>
|
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user