feat(web/m7-377): LikeButton gains size prop (sm/md/lg)
This commit is contained in:
@@ -4,8 +4,13 @@
|
|||||||
|
|
||||||
let {
|
let {
|
||||||
entityType,
|
entityType,
|
||||||
entityId
|
entityId,
|
||||||
}: { entityType: EntityKind; entityId: string } = $props();
|
size = 'md'
|
||||||
|
}: { entityType: EntityKind; entityId: string; size?: 'sm' | 'md' | 'lg' } = $props();
|
||||||
|
|
||||||
|
const sizeClass = $derived(
|
||||||
|
size === 'sm' ? 'text-base' : size === 'lg' ? 'text-3xl' : 'text-lg'
|
||||||
|
);
|
||||||
|
|
||||||
const SET_KEY = {
|
const SET_KEY = {
|
||||||
track: 'track_ids',
|
track: 'track_ids',
|
||||||
@@ -39,5 +44,5 @@
|
|||||||
aria-label={liked ? 'Unlike' : 'Like'}
|
aria-label={liked ? 'Unlike' : 'Like'}
|
||||||
aria-pressed={liked}
|
aria-pressed={liked}
|
||||||
onclick={onClick}
|
onclick={onClick}
|
||||||
class="rounded p-1 {liked ? 'text-accent' : 'text-text-secondary hover:text-text-primary'}"
|
class="rounded p-1 {sizeClass} {liked ? 'text-accent' : 'text-text-secondary hover:text-text-primary'}"
|
||||||
>{liked ? '♥' : '♡'}</button>
|
>{liked ? '♥' : '♡'}</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user