Added alternating ids on chat page

This commit is contained in:
sairaj mote 2022-12-11 18:05:47 +05:30
parent 237976b0d5
commit 9eaf3fe3bf
4 changed files with 43 additions and 2 deletions

View File

@ -1591,6 +1591,17 @@ ol li::before {
text-align: center;
}
#my_id_banner {
display: grid;
padding: 0.8rem 1rem;
margin: -0.5rem -1rem 0.5rem -1rem;
background-color: rgba(var(--foreground-color), 0.3);
border-bottom: solid 1px rgba(var(--text-color), 0.2);
}
#my_id_banner > * {
grid-area: 1/1/2/2;
}
sm-chip .badge {
position: relative;
margin: -0.2rem 0 -0.2rem 0.5rem;

2
css/main.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -1635,6 +1635,16 @@ ol {
}
}
}
#my_id_banner {
display: grid;
padding: 0.8rem 1rem;
margin: -0.5rem -1rem 0.5rem -1rem;
background-color: rgba(var(--foreground-color), 0.3);
border-bottom: solid 1px rgba(var(--text-color), 0.2);
& > * {
grid-area: 1/1/2/2;
}
}
sm-chip {
.badge {
position: relative;

View File

@ -252,7 +252,19 @@
<main id="main_page" class="page grid hidden">
<section id="chat_page" class="inner-page">
<div id="contacts" class="grid">
<div class="header">
<div class="header flex flex-direction-column">
<div id="my_id_banner" class="grid">
<div class="grid gap-0-3">
<h5>My FLO address</h5>
<sm-copy class="user-flo-id" clip-text>
</sm-copy>
</div>
<div class="grid gap-0-3 hidden">
<h5>My BTC address</h5>
<sm-copy class="user-btc-id" clip-text>
</sm-copy>
</div>
</div>
<sm-chips id="feature_mode">
<sm-chip value="dm" selected>Chat</sm-chip>
<sm-chip value="multisig">BTC multisig</sm-chip>
@ -1839,6 +1851,14 @@
}
messenger.list_request_received().then(requests => addNotificationBadge('#notification_panel_button', Object.keys(requests).length, { replace: true }))
removeNotificationBadge('#chat_page_button')
if (floGlobals.idInterval)
clearInterval(floGlobals.idInterval)
let childIndex = 0
floGlobals.idInterval = setInterval(() => {
getRef('my_id_banner').children[childIndex].classList.add('hidden')
childIndex = childIndex === getRef('my_id_banner').children.length - 1 ? 0 : childIndex + 1
getRef('my_id_banner').children[childIndex].classList.remove('hidden')
}, 10000)
break;
case 'mail_page':
if (subPageId1) {