Allow setting a custom verified icon
This commit is contained in:
parent
583de44b35
commit
067e3a26f5
|
@ -52,6 +52,7 @@ export const makeDefaultConfig = features => {
|
||||||
homeFooter: ImmutableList(),
|
homeFooter: ImmutableList(),
|
||||||
}),
|
}),
|
||||||
allowedEmoji: features.emojiReactsRGI ? allowedEmojiRGI : allowedEmoji,
|
allowedEmoji: features.emojiReactsRGI ? allowedEmojiRGI : allowedEmoji,
|
||||||
|
verifiedIcon: '',
|
||||||
verifiedCanEditName: false,
|
verifiedCanEditName: false,
|
||||||
displayFqn: Boolean(features.federating),
|
displayFqn: Boolean(features.federating),
|
||||||
cryptoAddresses: ImmutableList(),
|
cryptoAddresses: ImmutableList(),
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useIntl, defineMessages } from 'react-intl';
|
import { useIntl, defineMessages } from 'react-intl';
|
||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
|
||||||
import Icon from 'soapbox/components/icon';
|
import SvgIcon from 'soapbox/components/svg_icon';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
verified: { id: 'account.verified', defaultMessage: 'Verified Account' },
|
verified: { id: 'account.verified', defaultMessage: 'Verified Account' },
|
||||||
|
@ -10,9 +11,16 @@ const messages = defineMessages({
|
||||||
const VerificationBadge = () => {
|
const VerificationBadge = () => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
|
||||||
|
// Prefer a custom icon if found
|
||||||
|
const customIcon = useSelector(state => state.getIn(['soapbox', 'verifiedIcon']));
|
||||||
|
const icon = customIcon || require('icons/verified.svg');
|
||||||
|
|
||||||
|
// Render component based on file extension
|
||||||
|
const Icon = icon.endsWith('.svg') ? SvgIcon : 'img';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span className='verified-icon'>
|
<span className='verified-icon'>
|
||||||
<Icon src={require('icons/verified.svg')} alt={intl.formatMessage(messages.verified)} />
|
<Icon src={icon} alt={intl.formatMessage(messages.verified)} />
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -84,7 +84,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.svg-icon:first-child {
|
> .svg-icon:first-child {
|
||||||
height: 20px;
|
height: 20px;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
min-width: 20px;
|
min-width: 20px;
|
||||||
|
|
|
@ -730,12 +730,12 @@ article:last-child > .domain {
|
||||||
}
|
}
|
||||||
|
|
||||||
.verified-icon {
|
.verified-icon {
|
||||||
display: inline-block;
|
display: inline-flex;
|
||||||
margin: 0 4px 0 1px;
|
margin: 0 4px 0 1px;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 15px;
|
width: 20px;
|
||||||
height: 15px;
|
height: 20px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
|
||||||
.svg-icon svg > .bg {
|
.svg-icon svg > .bg {
|
||||||
|
|
Loading…
Reference in New Issue