Skip to content

Commit c1ac7a5

Browse files
committed
Minor layout improvements
1 parent 8c2104c commit c1ac7a5

5 files changed

Lines changed: 12 additions & 16 deletions

File tree

src/app/dim-ui/PressTip.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface Props {
3030
*/
3131
tooltip: React.ReactNode | (() => React.ReactNode);
3232
/**
33-
* Whether the presstip should be shown or not.
33+
* Whether the presstip should react to events or not.
3434
*/
3535
disabled?: boolean;
3636
/**
@@ -153,12 +153,14 @@ function PressTip(props: Props) {
153153

154154
const hover = useCallback(
155155
(e: React.MouseEvent | React.TouchEvent | TouchEvent) => {
156-
e.preventDefault();
157-
clearTimeout(timer.current);
158-
timer.current = window.setTimeout(() => {
159-
setOpen(!props.disabled);
160-
}, hoverDelay);
161-
touchStartTime.current = performance.now();
156+
if (!props.disabled) {
157+
e.preventDefault();
158+
clearTimeout(timer.current);
159+
timer.current = window.setTimeout(() => {
160+
setOpen(true);
161+
}, hoverDelay);
162+
touchStartTime.current = performance.now();
163+
}
162164
},
163165
[props.disabled]
164166
);

src/app/inventory/InventoryItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface Props {
3030
wishlistRoll?: InventoryWishListRoll;
3131
/** Don't show information that relates to currently selected perks (only used for subclasses currently) */
3232
ignoreSelectedPerks?: boolean;
33-
/** Don't show information that relates to currently selected perks (only used for subclasses currently) */
33+
/** Show a tooltip summarizing the item for when a click on the item has other effects than bringing up item popup */
3434
includeTooltip?: boolean;
3535
innerRef?: React.Ref<HTMLDivElement>;
3636
/** TODO: item locked needs to be passed in */

src/app/inventory/ItemTooltip.m.scss

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,7 @@
2929
}
3030

3131
.note {
32-
margin-left: -4px;
33-
}
34-
35-
.noteIcon {
36-
height: 24px;
37-
width: 24px;
32+
margin-left: 2px;
3833
}
3934

4035
.stats {

src/app/inventory/ItemTooltip.m.scss.d.ts

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/inventory/ItemTooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function Tooltip({
8181
{def.itemTypeDisplayName && <h3>{def.itemTypeDisplayName}</h3>}
8282
{notes && (
8383
<div className={clsx(styles.notes)}>
84-
<AppIcon className={styles.noteIcon} icon={stickyNoteIcon} />
84+
<AppIcon icon={stickyNoteIcon} />
8585
<span className={clsx(styles.note)}>{notes}</span>
8686
</div>
8787
)}

0 commit comments

Comments
 (0)