Skip to content

Commit

Permalink
Merge pull request #10481 from DestinyItemManager/icon-titles
Browse files Browse the repository at this point in the history
Add some titles to icons
  • Loading branch information
bhollis authored Jun 16, 2024
2 parents ea921cf + fb885d2 commit b129cd8
Show file tree
Hide file tree
Showing 17 changed files with 67 additions and 22 deletions.
7 changes: 7 additions & 0 deletions config/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@
"ReportBug": "Report a Bug",
"SaveSearch": "Save Search",
"SearchResults": "Show Items",
"SearchActions": "Open Search Actions",
"Shop": "Shop",
"UpgradeDIM": "Update DIM",
"WhatsNew": "What's New"
Expand Down Expand Up @@ -462,6 +463,10 @@
"Inventory": {
"ClickToExpand": "(Click to expand)"
},
"Item": {
"ThumbsUp": "Thumbs Up",
"ThumbsDown": "Thumbs Down"
},
"ItemFeed": {
"Description": "Item Feed",
"HideTagged": "Hide Tagged",
Expand Down Expand Up @@ -671,6 +676,7 @@
},
"Loadouts": {
"Abilities": "Abilities",
"Actions": "Actions for {{title}}",
"AddEquippedItems": "Add Equipped",
"AddNotes": "Add Notes",
"AddUnequippedItems": "Add Unequipped",
Expand Down Expand Up @@ -724,6 +730,7 @@
"IncludeRuntimeStatBenefits": "Include Font mod stats",
"IncludeRuntimeStatBenefitsDesc": "\"Font of ...\" armor mods provide a flat boost to character stats while you have Armor Charges.\n\nWith this setting, DIM considers these mods active and adds their benefits to this Loadout's stats in calculations and optimizations.",
"InGameLoadouts": "In-Game Loadouts",
"InGameActions": "In-Game Loadout Actions",
"ItemLeveling": "Item Leveling",
"LoadoutName": "Loadout name",
"Loadouts": "Loadouts",
Expand Down
2 changes: 1 addition & 1 deletion src/app/character-tile/CharacterTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function VaultTile({ store }: { store: DimStore }) {

return (
<div className={styles.vaultTile}>
<img className={styles.vaultEmblem} src={store.icon} height={40} width={40} />
<img className={styles.vaultEmblem} src={store.icon} height={40} width={40} alt="" />
<div className={styles.vaultName}>{store.className}</div>
{!isPhonePortrait && (
<div className={clsx(styles.powerLevel, styles.bigPowerLevel)}>
Expand Down
4 changes: 3 additions & 1 deletion src/app/dim-ui/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ interface Props {
offset?: number;
fixed?: boolean;
placement?: Placement;
label: string;
}

function isDropdownOption(option: Option): option is DropdownOption {
Expand All @@ -54,6 +55,7 @@ export default function Dropdown({
offset,
fixed,
placement = kebab ? 'bottom-end' : 'bottom-start',
label,
}: Props) {
const { isOpen, getToggleButtonProps, getMenuProps, highlightedIndex, getItemProps, reset } =
useSelect({
Expand Down Expand Up @@ -84,7 +86,7 @@ export default function Dropdown({
<div className={className}>
<button
type="button"
{...getToggleButtonProps({ ref: buttonRef, disabled })}
{...getToggleButtonProps({ ref: buttonRef, disabled, title: label })}
className={kebab ? styles.kebabButton : styles.button}
>
{kebab ? (
Expand Down
7 changes: 5 additions & 2 deletions src/app/inventory/RatingIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { t } from 'app/i18next-t';
import { UiWishListRoll } from 'app/wishlists/wishlists';
import { AppIcon, thumbsDownIcon, thumbsUpIcon } from '../shell/icons';
import styles from './RatingIcon.m.scss';

export default function RatingIcon({ uiWishListRoll }: { uiWishListRoll: UiWishListRoll }) {
if (uiWishListRoll === UiWishListRoll.Bad) {
return <AppIcon className={styles.trashlist} icon={thumbsDownIcon} />;
return (
<AppIcon className={styles.trashlist} icon={thumbsDownIcon} title={t('Item.ThumbsDown')} />
);
}

return <AppIcon className={styles.godroll} icon={thumbsUpIcon} />;
return <AppIcon className={styles.godroll} icon={thumbsUpIcon} title={t('Item.ThumbsUp')} />;
}
7 changes: 5 additions & 2 deletions src/app/inventory/TagIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
import { t } from 'app/i18next-t';
import { AppIcon } from 'app/shell/icons';
import { itemTagList, TagValue } from './dim-item-info';
import { itemTagList, tagConfig, TagValue } from './dim-item-info';

const tagIcons: { [tag: string]: string | IconDefinition | undefined } = {};
for (const tag of itemTagList) {
Expand All @@ -10,5 +11,7 @@ for (const tag of itemTagList) {
}

export default function TagIcon({ className, tag }: { className?: string; tag: TagValue }) {
return tagIcons[tag] ? <AppIcon className={className} icon={tagIcons[tag]!} /> : null;
return tagIcons[tag] ? (
<AppIcon className={className} icon={tagIcons[tag]!} title={t(tagConfig[tag].label)} />
) : null;
}
6 changes: 2 additions & 4 deletions src/app/inventory/d2-stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,14 @@ function loadProfile(
} else {
warnLog(
TAG,
`Profile from Bungie.net is ${remoteProfileAgeSec}s old, while the cached profile is ${cachedProfileAgeSec}s old`,
`Profile from Bungie.net is ${remoteProfileAgeSec}s old, while the cached profile is ${cachedProfileAgeSec}s old.`,
action,
);
}
// Clear the error since we did load correctly
dispatch(profileError(undefined));
// undefined means skip processing, in case we already have computed stores
return storesLoadedSelector(getState())
? undefined
: { profile: cachedProfileResponse, live: false };
return storesLoaded ? undefined : { profile: cachedProfileResponse, live: false };
} else {
infoLog(
TAG,
Expand Down
1 change: 1 addition & 0 deletions src/app/item-actions/ItemActionsDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ export default memo(function ItemActionsDropdown({
className={styles.dropdownButton}
offset={isPhonePortrait ? 6 : 2}
fixed={fixed}
label={t('Header.SearchActions')}
/>
);
});
8 changes: 7 additions & 1 deletion src/app/loadout/ingame/InGameLoadoutStrip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,13 @@ function InGameLoadoutTile({
{loadoutIcon}
</PressTip>
)}
<Dropdown kebab options={options} placement="bottom-end" className={styles.kebab} />
<Dropdown
label={t('Loadouts.InGameActions')}
kebab
options={options}
placement="bottom-end"
className={styles.kebab}
/>
</div>
);
}
2 changes: 1 addition & 1 deletion src/app/loadout/loadout-edit/LoadoutEditSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default function LoadoutEditSection({
<AppIcon icon={disabledIcon} />
</button>
)}
<Dropdown kebab options={options} />
<Dropdown label={t('Loadouts.Actions', { title })} kebab options={options} />
</div>
{children}
</div>
Expand Down
14 changes: 12 additions & 2 deletions src/app/organizer/ItemActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,21 @@ function ItemActions({
<AppIcon icon={unlockedIcon} />
<span className={styles.label}>{t('Organizer.Unlock')}</span>
</button>
<Dropdown disabled={!itemsAreSelected} options={tagItems} className={styles.actionButton}>
<Dropdown
label={t('Organizer.BulkTag')}
disabled={!itemsAreSelected}
options={tagItems}
className={styles.actionButton}
>
<AppIcon icon={tagIcon} />
<span className={styles.label}>{t('Organizer.BulkTag')}</span>
</Dropdown>
<Dropdown disabled={!itemsAreSelected} options={moveItems} className={styles.actionButton}>
<Dropdown
label={t('Organizer.BulkMove')}
disabled={!itemsAreSelected}
options={moveItems}
className={styles.actionButton}
>
<AppIcon icon={moveIcon} />
<span className={styles.label}>{t('Organizer.BulkMove')}</span>
</Dropdown>
Expand Down
1 change: 1 addition & 0 deletions src/app/search/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ function SearchBar(
placeholder,
type: 'text',
name: 'filter',
'aria-label': placeholder,
})}
enterKeyHint="search"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function StreamDeckSettings() {
href="https://marketplace.elgato.com/product/dim-stream-deck-11883ba5-c8db-4e3a-915f-612c5ba1b2e4"
>
<button type="button" className={clsx('dim-button', styles.button)}>
<AppIcon icon={faArrowCircleDown} /> {t('StreamDeck.Install')}
<AppIcon icon={faArrowCircleDown} ariaHidden /> {t('StreamDeck.Install')}
</button>
</ExternalLink>
) : (
Expand Down
4 changes: 2 additions & 2 deletions src/app/strip-sockets/StripSockets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export default function StripSockets() {
) : state.tag === 'processing' ? (
<>
<span>
<AppIcon icon={refreshIcon} spinning={true} />
<AppIcon icon={refreshIcon} spinning={true} ariaHidden />
</span>{' '}
{t('StripSockets.Running')}
</>
Expand All @@ -192,7 +192,7 @@ export default function StripSockets() {
disabled={selectedSockets.length === 0}
>
<span>
<AppIcon icon={faCheckCircle} />{' '}
<AppIcon icon={faCheckCircle} ariaHidden />{' '}
{t('StripSockets.Button', { numSockets: selectedSockets.length })}
</span>
</button>
Expand Down
13 changes: 10 additions & 3 deletions src/app/vendors/VendorItemComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { t } from 'app/i18next-t';
import { DimItem } from 'app/inventory/item-types';
import { ItemPopupExtraInfo } from 'app/item-popup/item-popup';
import { DestinyCollectibleState } from 'bungie-api-ts/destiny2';
Expand Down Expand Up @@ -116,11 +117,17 @@ export function VendorItemDisplay({
</ItemPopupTrigger>
{children}
{owned ? (
<AppIcon className={styles.ownedIcon} icon={faCheck} />
<AppIcon className={styles.ownedIcon} icon={faCheck} title={t('MovePopup.Owned')} />
) : acquired ? (
<AppIcon className={styles.acquiredIcon} icon={faCheck} />
<AppIcon className={styles.acquiredIcon} icon={faCheck} title={t('MovePopup.Acquired')} />
) : (
locked && <AppIcon className={styles.lockedIcon} icon={lockIcon} />
locked && (
<AppIcon
className={styles.lockedIcon}
icon={lockIcon}
title={t('MovePopup.LockUnlock.Locked')}
/>
)
)}
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/whats-new/WhatsNewLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function WhatsNewLink({
if (dimNeedsUpdate) {
return (
<a className={className({ isActive: false })} onClick={reloadDIM}>
<AppIcon className={styles.upgrade} icon={updateIcon} />
<AppIcon className={styles.upgrade} icon={updateIcon} ariaHidden />
{t('Header.UpgradeDIM')}
</a>
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/wishlists/wishlist-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function toWishList(
}

if (dupes > 0) {
warnLog(TAG, 'Discarded', dupes, 'duplicate rolls from wish list', wishList.source);
warnLog(TAG, 'Discarded', dupes, 'duplicate rolls from wish list', url);
}
wishList.infos.push(info);
}
Expand Down
7 changes: 7 additions & 0 deletions src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@
"ReloadApp": "Reload App",
"ReportBug": "Report a Bug",
"SaveSearch": "Save Search",
"SearchActions": "Open Search Actions",
"SearchResults": "Show Items",
"Shop": "Shop",
"TagAs": "Tag as '{{tag}}'",
Expand Down Expand Up @@ -448,6 +449,10 @@
"Inventory": {
"ClickToExpand": "(Click to expand)"
},
"Item": {
"ThumbsDown": "Thumbs Down",
"ThumbsUp": "Thumbs Up"
},
"ItemFeed": {
"ClearFeed": "Clear Feed",
"Description": "Item Feed",
Expand Down Expand Up @@ -717,6 +722,7 @@
},
"Loadouts": {
"Abilities": "Abilities",
"Actions": "Actions for {{title}}",
"AddEquippedItems": "Add Equipped",
"AddNotes": "Add Notes",
"AddUnequippedItems": "Add Unequipped",
Expand Down Expand Up @@ -774,6 +780,7 @@
"PasteHere": "Paste a loadout link to open the loadout."
},
"ImportLoadout": "Import Loadout",
"InGameActions": "In-Game Loadout Actions",
"InGameLoadouts": "In-Game Loadouts",
"IncludeRuntimeStatBenefits": "Include Font mod stats",
"IncludeRuntimeStatBenefitsDesc": "\"Font of ...\" armor mods provide a flat boost to character stats while you have Armor Charges.\n\nWith this setting, DIM considers these mods active and adds their benefits to this Loadout's stats in calculations and optimizations.",
Expand Down

0 comments on commit b129cd8

Please sign in to comment.