badge style

This commit is contained in:
Martti Malmi 2023-06-12 14:44:23 +03:00
parent 071f071484
commit 0ae6ed872d
2 changed files with 7 additions and 10 deletions

View File

@ -10,9 +10,8 @@ export default function Badge(props): JSX.Element | null {
const hexAddress = Key.toNostrHexAddress(props.pub);
if (hexAddress === myPub) {
return (
<span class="badge first tooltip">
<span class="mx-2 text-iris-blue tooltip" data-tip={t('you')}>
{Icons.checkmark}
<span class="tooltiptext right">{t('you')}</span>
</span>
);
}
@ -22,21 +21,17 @@ export default function Badge(props): JSX.Element | null {
const following = SocialNetwork.followedByUser.get(myPub)?.has(hexAddress);
if (following) {
return (
<span class="badge first tooltip">
<span class="mx-2 text-iris-blue tooltip" data-tip={t('following')}>
{Icons.checkmark}
<span class="tooltiptext right">{t('following')}</span>
</span>
);
} else {
const count = SocialNetwork.followedByFriendsCount(hexAddress);
if (count > 0) {
const className = count > 10 ? 'second' : 'third';
const className = count > 10 ? 'text-iris-orange' : '';
return (
<span class={`badge ${className} tooltip`}>
<span class={`${className} tooltip mx-2`} data-tip={`${count} ${t('friends_following')}`}>
{Icons.checkmark}
<span class="tooltiptext right">
{count} {t('friends_following')}
</span>
</span>
);
} else {

View File

@ -213,7 +213,9 @@ class Profile extends View {
<${Name} pub=${this.state.hexPub} />
</span>
${this.state.nip05
? html`<br /><small class="positive">${this.state.nip05.replace(/^_@/, '')}</small>`
? html`<br /><small class="text-iris-green"
>${this.state.nip05.replace(/^_@/, '')}</small
>`
: ''}
</div>
<div class="profile-about">