mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-29 22:58:18 -05:00
BuildCard: Modes from popup to top right
This commit is contained in:
@@ -54,7 +54,7 @@ interface BuildProps {
|
||||
|
||||
export function BuildCard({ build, owner, canEdit = false }: BuildProps) {
|
||||
const user = useUser();
|
||||
const { t } = useTranslation(["weapons", "builds", "common"]);
|
||||
const { t } = useTranslation(["weapons", "builds", "common", "game-misc"]);
|
||||
const { i18n } = useTranslation();
|
||||
const isMounted = useIsMounted();
|
||||
|
||||
@@ -75,6 +75,20 @@ export function BuildCard({ build, owner, canEdit = false }: BuildProps) {
|
||||
<div className="build">
|
||||
<div>
|
||||
<div className="build__top-row">
|
||||
{modes && modes.length > 0 && (
|
||||
<div className="build__modes">
|
||||
{modes.map((mode) => (
|
||||
<Image
|
||||
key={mode}
|
||||
alt={t(`game-misc:MODE_LONG_${mode}` as any)}
|
||||
title={t(`game-misc:MODE_LONG_${mode}` as any)}
|
||||
path={modeImageUrl(mode)}
|
||||
width={18}
|
||||
height={18}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<h2 className="build__title">{title}</h2>
|
||||
</div>
|
||||
<div className="build__date-author-row">
|
||||
@@ -138,24 +152,11 @@ export function BuildCard({ build, owner, canEdit = false }: BuildProps) {
|
||||
path={navIconUrl("analyzer")}
|
||||
/>
|
||||
</Link>
|
||||
{description || (modes && modes.length > 0) ? (
|
||||
{description ? (
|
||||
<Popover
|
||||
buttonChildren={<InfoIcon className="build__icon" />}
|
||||
triggerClassName="minimal tiny build__small-text"
|
||||
>
|
||||
{modes && modes.length > 0 && (
|
||||
<div className="build__modes">
|
||||
{modes.map((mode) => (
|
||||
<Image
|
||||
key={mode}
|
||||
alt=""
|
||||
path={modeImageUrl(mode)}
|
||||
width={18}
|
||||
height={18}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
{description}
|
||||
</Popover>
|
||||
) : null}
|
||||
|
||||
@@ -780,11 +780,13 @@ dialog::backdrop {
|
||||
.builds-container {
|
||||
display: grid;
|
||||
justify-content: center;
|
||||
gap: var(--s-3);
|
||||
column-gap: var(--s-3);
|
||||
grid-template-columns: repeat(auto-fit, 240px);
|
||||
row-gap: var(--s-4);
|
||||
}
|
||||
|
||||
.build {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: var(--s-3);
|
||||
@@ -813,8 +815,11 @@ dialog::backdrop {
|
||||
}
|
||||
|
||||
.build__modes {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
display: flex;
|
||||
min-width: max-content;
|
||||
margin-top: -21px;
|
||||
gap: var(--s-1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user