Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Update settings tab icons #12867

Merged
merged 7 commits into from
Aug 6, 2024
Merged

Update settings tab icons #12867

merged 7 commits into from
Aug 6, 2024

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Aug 6, 2024

...and add support for compound design token icons to TabbedView, changing all the other icons over while we're at it.

To go with #12841

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • Sign-off given on the changes (see CONTRIBUTING.md).

...and add support for compound design token icons to TabbedView,
changing all the other icons over while we're at it.
@dbkr dbkr added the T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements label Aug 6, 2024
@dbkr dbkr marked this pull request as ready for review August 6, 2024 14:45
@dbkr dbkr requested a review from a team as a code owner August 6, 2024 14:45
@dbkr dbkr requested review from t3chguy and robintown August 6, 2024 14:45
@t3chguy t3chguy changed the title Change icon for general/account tab Update settings tab icons Aug 6, 2024
Comment on lines 101 to 105
if (tab.icon && typeof tab.icon === "object") {
tabIcon = tab.icon;
} else if (typeof tab.icon === "string") {
tabIcon = <span className={`mx_TabbedView_maskedIcon ${tab.icon}`} />;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does only one of these paths have the truthy check? previously the string path had a truthy check

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would have to be the empty string to be of type string but still falsy, but I can add it around the whole lot easily enough

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null would also hit this edge, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null is of type object so it wouldn't match either case.

Comment on lines 20 to 31
import { Icon as UserProfileIcon } from "@vector-im/compound-design-tokens/icons/user-profile.svg";
import { Icon as DevicesIcon } from "@vector-im/compound-design-tokens/icons/devices.svg";
import { Icon as VisibilityOnIcon } from "@vector-im/compound-design-tokens/icons/visibility-on.svg";
import { Icon as NotificationsIcon } from "@vector-im/compound-design-tokens/icons/notifications.svg";
import { Icon as PreferencesIcon } from "@vector-im/compound-design-tokens/icons/preferences.svg";
import { Icon as KeyboardIcon } from "@vector-im/compound-design-tokens/icons/keyboard.svg";
import { Icon as SidebarIcon } from "@vector-im/compound-design-tokens/icons/sidebar.svg";
import { Icon as MicOnIcon } from "@vector-im/compound-design-tokens/icons/mic-on.svg";
import { Icon as LockIcon } from "@vector-im/compound-design-tokens/icons/lock.svg";
import { Icon as LabsIcon } from "@vector-im/compound-design-tokens/icons/labs.svg";
import { Icon as BlockIcon } from "@vector-im/compound-design-tokens/icons/block.svg";
import { Icon as HelpIcon } from "@vector-im/compound-design-tokens/icons/help.svg";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the new CDT exports please in assets/web, they ensure our snapshots include the svg which means we can detect changes in icons even if we're missing screenshot tests

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, yes, that's better

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, we should probably eslint ban the source svgs

@dbkr dbkr added this pull request to the merge queue Aug 6, 2024
Merged via the queue into develop with commit 6ca4f67 Aug 6, 2024
29 checks passed
@dbkr dbkr deleted the dbkr/user_settings_icons branch August 6, 2024 16:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants