Add subscribed mode to subscribing topic button

This commit is contained in:
kvakazyambra 2022-12-15 23:13:57 +03:00
parent c9666e63f9
commit 7e256b3ed4
4 changed files with 16 additions and 2 deletions

View File

@ -0,0 +1,3 @@
<svg width="13" height="10" viewBox="0 0 13 10" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 4.5L4.66667 8L12 1" stroke="white" stroke-width="1.5"/>
</svg>

After

Width:  |  Height:  |  Size: 171 B

View File

@ -120,3 +120,7 @@
.isSubscribing {
color: transparent;
}
.isSubscribed {
background: #000;
}

View File

@ -10,6 +10,7 @@ import { clsx } from 'clsx'
import { useSession } from '../../context/session'
import { StatMetrics } from '../_shared/StatMetrics'
import { ShowOnlyOnClient } from '../_shared/ShowOnlyOnClient'
import { Icon } from '../_shared/Icon'
const log = getLogger('TopicCard')
@ -96,13 +97,14 @@ export const TopicCard = (props: TopicProps) => {
class="button--light button--subscribe-topic"
classList={{
[styles.buttonCompact]: props.compact,
[styles.isSubscribing]: isSubscribing()
[styles.isSubscribing]: isSubscribing(),
[styles.isSubscribed]: subscribed()
}}
disabled={isSubscribing()}
>
<Show when={props.iconButton}>
<Show when={subscribed()} fallback="+">
-
<Icon name="check-subscribed" />
</Show>
</Show>
<Show when={!props.iconButton}>

View File

@ -243,6 +243,11 @@ button {
border: 2px solid #000;
border-radius: 0.8rem;
color: #000;
font-size: 1.2em;
line-height: 2.8rem;
height: 3.2rem;
padding: 0;
width: 3.2rem;
&:hover {
background: #000;