Display user favicon in deletion modal
This commit is contained in:
parent
75df329a26
commit
c44de0030c
|
@ -48,15 +48,24 @@ export function deleteUserModal(intl, accountId, afterConfirm = () => {}) {
|
||||||
const state = getState();
|
const state = getState();
|
||||||
const acct = state.getIn(['accounts', accountId, 'acct']);
|
const acct = state.getIn(['accounts', accountId, 'acct']);
|
||||||
const name = state.getIn(['accounts', accountId, 'username']);
|
const name = state.getIn(['accounts', accountId, 'username']);
|
||||||
|
const favicon = state.getIn(['accounts', accountId, 'pleroma', 'favicon']);
|
||||||
|
|
||||||
const message = (<>
|
const message = (<>
|
||||||
<AccountContainer id={accountId} />
|
<AccountContainer id={accountId} />
|
||||||
{intl.formatMessage(messages.deleteUserPrompt, { acct })}
|
{intl.formatMessage(messages.deleteUserPrompt, { acct })}
|
||||||
</>);
|
</>);
|
||||||
|
|
||||||
|
const confirm = (<>
|
||||||
|
{favicon &&
|
||||||
|
<div className='submit__favicon'>
|
||||||
|
<img src={favicon} alt='' />
|
||||||
|
</div>}
|
||||||
|
{intl.formatMessage(messages.deleteUserConfirm, { name })}
|
||||||
|
</>);
|
||||||
|
|
||||||
dispatch(openModal('CONFIRM', {
|
dispatch(openModal('CONFIRM', {
|
||||||
message,
|
message,
|
||||||
confirm: intl.formatMessage(messages.deleteUserConfirm, { name }),
|
confirm,
|
||||||
onConfirm: () => {
|
onConfirm: () => {
|
||||||
dispatch(deleteUsers([acct])).then(() => {
|
dispatch(deleteUsers([acct])).then(() => {
|
||||||
const message = intl.formatMessage(messages.userDeleted, { acct });
|
const message = intl.formatMessage(messages.userDeleted, { acct });
|
||||||
|
|
|
@ -393,6 +393,23 @@
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.submit__favicon {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
margin-right: 8px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue