Skip to content

Commit

Permalink
Minor layout improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
robojumper committed Jan 20, 2022
1 parent 8c2104c commit c1ac7a5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
16 changes: 9 additions & 7 deletions src/app/dim-ui/PressTip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface Props {
*/
tooltip: React.ReactNode | (() => React.ReactNode);
/**
* Whether the presstip should be shown or not.
* Whether the presstip should react to events or not.
*/
disabled?: boolean;
/**
Expand Down Expand Up @@ -153,12 +153,14 @@ function PressTip(props: Props) {

const hover = useCallback(
(e: React.MouseEvent | React.TouchEvent | TouchEvent) => {
e.preventDefault();
clearTimeout(timer.current);
timer.current = window.setTimeout(() => {
setOpen(!props.disabled);
}, hoverDelay);
touchStartTime.current = performance.now();
if (!props.disabled) {
e.preventDefault();
clearTimeout(timer.current);
timer.current = window.setTimeout(() => {
setOpen(true);
}, hoverDelay);
touchStartTime.current = performance.now();
}
},
[props.disabled]
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/inventory/InventoryItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface Props {
wishlistRoll?: InventoryWishListRoll;
/** Don't show information that relates to currently selected perks (only used for subclasses currently) */
ignoreSelectedPerks?: boolean;
/** Don't show information that relates to currently selected perks (only used for subclasses currently) */
/** Show a tooltip summarizing the item for when a click on the item has other effects than bringing up item popup */
includeTooltip?: boolean;
innerRef?: React.Ref<HTMLDivElement>;
/** TODO: item locked needs to be passed in */
Expand Down
7 changes: 1 addition & 6 deletions src/app/inventory/ItemTooltip.m.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@
}

.note {
margin-left: -4px;
}

.noteIcon {
height: 24px;
width: 24px;
margin-left: 2px;
}

.stats {
Expand Down
1 change: 0 additions & 1 deletion src/app/inventory/ItemTooltip.m.scss.d.ts

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

2 changes: 1 addition & 1 deletion src/app/inventory/ItemTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function Tooltip({
{def.itemTypeDisplayName && <h3>{def.itemTypeDisplayName}</h3>}
{notes && (
<div className={clsx(styles.notes)}>
<AppIcon className={styles.noteIcon} icon={stickyNoteIcon} />
<AppIcon icon={stickyNoteIcon} />
<span className={clsx(styles.note)}>{notes}</span>
</div>
)}
Expand Down

0 comments on commit c1ac7a5

Please sign in to comment.