Skip to content

Commit

Permalink
Merge pull request #9855 from DestinyItemManager/close-button
Browse files Browse the repository at this point in the history
Turn sheet close button into a real button
  • Loading branch information
bhollis authored Sep 12, 2023
2 parents 44eb471 + bb1e7d2 commit ab038c6
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 21 deletions.
3 changes: 2 additions & 1 deletion config/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@
"General": {
"ClickForDetails": "Click for details",
"Confirm": "Confirm?",
"UserGuideLink": "User guide"
"UserGuideLink": "User guide",
"Close": "Close"
},
"Glyphs": {
"Missing": "Missing",
Expand Down
4 changes: 0 additions & 4 deletions src/app/armory/ArmorySheet.m.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
.sheet:global(.sheet) {
max-width: 900px;
margin: 0 auto;

:global(.sheet-close) {
right: 16px;
}
}
4 changes: 4 additions & 0 deletions src/app/dim-ui/Sheet.m.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@
opacity: 0.6;
}
}

.noHeader {
right: 16px !important;
}
1 change: 1 addition & 0 deletions src/app/dim-ui/Sheet.m.scss.d.ts

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

7 changes: 2 additions & 5 deletions src/app/dim-ui/Sheet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ $control-color: rgba(255, 255, 255, 0.5);
}

.sheet-close {
all: initial;
z-index: 1;
position: absolute;
right: 0;
Expand All @@ -85,11 +86,7 @@ $control-color: rgba(255, 255, 255, 0.5);
&:active,
&:hover,
&:focus-visible {
color: rgba(255, 255, 255, 1);
}

&.sheet-no-header {
right: 8px;
color: var(--theme-accent-primary);
}
}
}
10 changes: 6 additions & 4 deletions src/app/dim-ui/Sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,15 @@ export default function Sheet({
onKeyPress={stopPropagation}
onClick={allowClickThrough ? undefined : stopPropagation}
>
<a
href="#"
className={clsx('sheet-close', { 'sheet-no-header': !header })}
<button
type="button"
className={clsx('sheet-close', { [styles.noHeader]: !header })}
onClick={triggerClose}
aria-keyshortcuts="esc"
aria-label={t('General.Close')}
>
<AppIcon icon={disabledIcon} />
</a>
</button>

<div className="sheet-container" onPointerDown={dragHandleDown}>
{Boolean(header) && (
Expand Down
7 changes: 0 additions & 7 deletions src/app/item-popup/ItemPopup.m.scss
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,12 @@
color: black;
opacity: 0.7;
}
:global(.sheet-handle) div {
background-color: black;
opacity: 0.7;
}

&.uncommon,
&.rare,
&.legendary {
:global(.sheet-close) {
color: var(--theme-text);
}
:global(.sheet-handle) div {
background-color: white;
}
}
}
1 change: 1 addition & 0 deletions src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@
},
"General": {
"ClickForDetails": "Click for details",
"Close": "Close",
"Confirm": "Confirm?",
"UserGuideLink": "User guide"
},
Expand Down

0 comments on commit ab038c6

Please sign in to comment.