feat: shell name tooltips

This commit is contained in:
TrèsAbhi committed 2024-08-19 20:22:37 -05:00
1 parent 16e2f9ac96
commit 9c784228fb
2 files changed
+4 -1

No files matched your search

@@ -7,6 +7,7 @@ import {
Slider, Slider,
Text, Text,
TextField, TextField,
Tooltip,
} from '@radix-ui/themes'; } from '@radix-ui/themes';
import { debounce } from 'lodash'; import { debounce } from 'lodash';
import { Fragment, use, useEffect, useRef, useState } from 'react'; import { Fragment, use, useEffect, useRef, useState } from 'react';
@@ -144,6 +145,7 @@ export function Characteristics() {
<Flex> <Flex>
{gun.shells.map((thisShell, shellIndex) => ( {gun.shells.map((thisShell, shellIndex) => (
<Tooltip content={thisShell.name}>
<IconButton <IconButton
color={thisShell.id === shell.id ? undefined : 'gray'} color={thisShell.id === shell.id ? undefined : 'gray'}
variant="soft" variant="soft"
@@ -170,6 +172,7 @@ export function Characteristics() {
src={asset(`icons/shells/${thisShell.icon}.webp`)} src={asset(`icons/shells/${thisShell.icon}.webp`)}
/> />
</IconButton> </IconButton>
</Tooltip>
))} ))}
</Flex> </Flex>
</Flex> </Flex>
@@ -16,8 +16,8 @@ export function MetaSection() {
typeof tank.price === 'number' ? 'credits' : tank.price.type; typeof tank.price === 'number' ? 'credits' : tank.price.type;
const salePrice = 0.5 * rawPrice; const salePrice = 0.5 * rawPrice;
const purchasePrice = rawPrice; const purchasePrice = rawPrice;
let worthSelling: boolean;
const ClassIcon = classIcons[tank.class]; const ClassIcon = classIcons[tank.class];
let worthSelling: boolean;
if (priceType === 'gold') { if (priceType === 'gold') {
worthSelling = tank.tier <= 6 || purchasePrice - salePrice <= 500; worthSelling = tank.tier <= 6 || purchasePrice - salePrice <= 500;