feat(web): refresh the app with Astryx and coral branding
This commit is contained in:
1 parent
f649490cd2
commit
da7b502936
140 files changed
+4531
-2368
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import type { ApiTierInfo } from "../api/types";
|
||||
import { Tooltip } from "@astryxdesign/core/Tooltip";
|
||||
import { formatRankBadge, formatRankDetail } from "./rankBadgeUtils";
|
||||
|
||||
type RankBadgeSize = "sm" | "md";
|
||||
@@ -9,9 +10,12 @@ const SIZE_CLASSES: Record<RankBadgeSize, string> = {
|
||||
md: "h-[18px] min-w-[20px]",
|
||||
};
|
||||
|
||||
const TOOLTIP_CLASSES: Record<RankBadgeTooltipPlacement, string> = {
|
||||
left: "tooltip-left",
|
||||
bottom: "tooltip-bottom",
|
||||
const TOOLTIP_PLACEMENT: Record<
|
||||
RankBadgeTooltipPlacement,
|
||||
"start" | "below"
|
||||
> = {
|
||||
left: "start",
|
||||
bottom: "below",
|
||||
};
|
||||
|
||||
function rankBadgeClass(tier: ApiTierInfo | undefined) {
|
||||
@@ -53,17 +57,14 @@ export function RankBadge({
|
||||
const tooltip = formatRankDetail(tier);
|
||||
|
||||
return (
|
||||
<span
|
||||
className={`tooltip ${TOOLTIP_CLASSES[tooltipPlacement]}`}
|
||||
data-tip={tooltip}
|
||||
>
|
||||
<Tooltip content={tooltip} placement={TOOLTIP_PLACEMENT[tooltipPlacement]}>
|
||||
<span
|
||||
className={`inline-flex ${SIZE_CLASSES[size]} shrink-0 items-center justify-center whitespace-nowrap rounded-[3px] border px-1 text-xs font-black leading-none ${rankBadgeClass(tier)}`}
|
||||
className={`inline-flex ${SIZE_CLASSES[size]} shrink-0 items-center justify-center whitespace-nowrap rounded-[5px] border px-1 text-[11px] font-extrabold leading-none ${rankBadgeClass(tier)}`}
|
||||
aria-label={tooltip}
|
||||
>
|
||||
{formatRankBadge(tier)}
|
||||
</span>
|
||||
</span>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user