Items: remove bolt icon when item is free

environments/review-items-9u2qry/deployments/4363
Alex Gleason 2024-01-13 15:03:17 -06:00
rodzic 66e92f1a23
commit 4850a4d314
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -60,6 +60,7 @@ const Items: React.FC<IItems> = () => {
}; };
const Item: React.FC<SoapboxItem> = ({ id, name, image, account, price }) => { const Item: React.FC<SoapboxItem> = ({ id, name, image, account, price }) => {
const free = price === 0;
const favicon = account?.pleroma?.favicon; const favicon = account?.pleroma?.favicon;
return ( return (
@ -72,7 +73,8 @@ const Item: React.FC<SoapboxItem> = ({ id, name, image, account, price }) => {
<div> <div>
<Text weight='bold'>{name}</Text> <Text weight='bold'>{name}</Text>
<HStack space={2} alignItems='center'>
<HStack space={1} alignItems='center'>
<Text size='xs' theme='muted'>@{account.acct}</Text> <Text size='xs' theme='muted'>@{account.acct}</Text>
{favicon && ( {favicon && (
<Tooltip text={`Item issued by ${account.acct}`}> <Tooltip text={`Item issued by ${account.acct}`}>
@ -84,9 +86,9 @@ const Item: React.FC<SoapboxItem> = ({ id, name, image, account, price }) => {
<Button <Button
className='mt-auto' className='mt-auto'
icon={require('@tabler/icons/bolt.svg')} icon={free ? undefined : require('@tabler/icons/bolt.svg')}
> >
{price === 0 ? 'Free' : <FormattedNumber value={price} />} {free ? 'Free' : <FormattedNumber value={price} />}
</Button> </Button>
</div> </div>
); );