Skip to content

Commit

Permalink
Merge pull request #10205 from DestinyItemManager/tile-grid
Browse files Browse the repository at this point in the history
Tile grid tweaks
  • Loading branch information
bhollis authored Jan 5, 2024
2 parents 0b5f64f + be514ad commit d02e9a5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
26 changes: 17 additions & 9 deletions src/app/dim-ui/TileGrid.m.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

.header {
font-weight: 600;
font-size: 14px;
font-size: 16px;
text-transform: uppercase;
padding-top: 8px;
padding-bottom: 8px;
Expand Down Expand Up @@ -39,17 +39,27 @@
outline: none;
}

// On mobile, don't scale up items
@include phone-portrait {
--item-size: 50px;
// Don't scale up items even if users have item tiles set to large
--item-size: 50px;

&.compact {
grid-template-areas:
'icon title'
'icon details';
row-gap: 4px;
}

> :global(.item) {
grid-area: icon;
}
}

.details {
display: flex;
flex-direction: column;
gap: 4px;
grid-column-end: span 3;
grid-area: details;
text-wrap: pretty;
}

.selected {
Expand All @@ -66,8 +76,6 @@
color: var(--theme-text);
font-weight: bold;
font-size: 16px;
grid-column-end: span 2;
&.withCorner {
grid-column-end: span 1;
}
grid-area: title;
text-wrap: balance;
}
2 changes: 1 addition & 1 deletion src/app/dim-ui/TileGrid.m.scss.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/app/dim-ui/TileGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export function TileGridTile({
selected,
disabled,
onClick,
compact,
}: {
className?: string;
children: React.ReactNode;
Expand All @@ -45,12 +46,14 @@ export function TileGridTile({
selected?: boolean;
disabled?: boolean;
onClick: React.MouseEventHandler<HTMLElement>;
compact?: boolean;
}) {
return (
<div
className={clsx(className, styles.tile, {
[styles.selected]: selected,
[styles.disabled]: disabled,
[styles.compact]: compact,
})}
onClick={disabled ? undefined : onClick}
role="button"
Expand All @@ -60,7 +63,7 @@ export function TileGridTile({
>
<>
{icon}
<div className={clsx(styles.title, { [styles.withCorner]: corner })}>{title}</div>
<div className={styles.title}>{title}</div>
{corner}
<div className={styles.details}>{children}</div>
</>
Expand Down
1 change: 1 addition & 0 deletions src/app/loadout-builder/filter/ExoticTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default function ExoticTile({
disabled={exotic.isArmor1}
title={title}
icon={icon}
compact
>
{description}
</TileGridTile>
Expand Down

0 comments on commit d02e9a5

Please sign in to comment.