fix country flag sizing
Some checks failed
Deploy Website / docker (ubuntu-latest) (push) Has been cancelled
Some checks failed
Deploy Website / docker (ubuntu-latest) (push) Has been cancelled
This commit is contained in:
parent
fcb84f820b
commit
a0dd1b4601
@ -8,13 +8,13 @@ type Props = {
|
|||||||
|
|
||||||
export default function CountryFlag({ code, size = 24 }: Props) {
|
export default function CountryFlag({ code, size = 24 }: Props) {
|
||||||
return (
|
return (
|
||||||
<Tooltip display={<p>{normalizedRegionName(code)}</p>} asChild={false}>
|
<Tooltip display={<p>{normalizedRegionName(code)}</p>} className={`w-[${size * 2}px] min-w-[${size * 2}px]`}>
|
||||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||||
<img
|
<img
|
||||||
alt="Player Country"
|
alt="Player Country"
|
||||||
src={`/assets/flags/${code.toLowerCase()}.png`}
|
src={`/assets/flags/${code.toLowerCase()}.png`}
|
||||||
width={size * 2}
|
width={size * 2}
|
||||||
className={`w-[${size * 2}px] object-contain`}
|
className={`w-[${size * 2}px] min-w-[${size * 2}px] object-contain`}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
|
@ -16,16 +16,23 @@ type Props = {
|
|||||||
*/
|
*/
|
||||||
asChild?: boolean;
|
asChild?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The additional class names
|
||||||
|
*/
|
||||||
|
className?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Where the tooltip will be displayed
|
* Where the tooltip will be displayed
|
||||||
*/
|
*/
|
||||||
side?: "top" | "bottom" | "left" | "right";
|
side?: "top" | "bottom" | "left" | "right";
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function Tooltip({ children, display, asChild = true, side = "top" }: Props) {
|
export default function Tooltip({ children, display, asChild = true, side = "top", className }: Props) {
|
||||||
return (
|
return (
|
||||||
<ShadCnTooltip>
|
<ShadCnTooltip>
|
||||||
<TooltipTrigger asChild={asChild}>{children}</TooltipTrigger>
|
<TooltipTrigger className={className} asChild={asChild}>
|
||||||
|
{children}
|
||||||
|
</TooltipTrigger>
|
||||||
<TooltipContent side={side}>{display}</TooltipContent>
|
<TooltipContent side={side}>{display}</TooltipContent>
|
||||||
</ShadCnTooltip>
|
</ShadCnTooltip>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user