This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 833
Update settings tab icons #12867
Merged
Merged
Update settings tab icons #12867
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cccbbc6
Change icon for general/account tab
dbkr aebaf35
Update snapshots
dbkr 3b14c99
Fix responsive mode
dbkr ca2088d
Missed one
dbkr ce64d78
truthy-check the whole block
dbkr 7a8b816
Use asset imports
dbkr 4205006
Update snapshots
dbkr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file modified
BIN
+602 Bytes
(100%)
...user-settings-tab/appearance-user-settings-tab.spec.ts/appearance-tab-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+917 Bytes
(100%)
...ce-user-settings-tab/appearance-user-settings-tab.spec.ts/window-12px-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+576 Bytes
(100%)
playwright/snapshots/settings/general-user-settings-tab.spec.ts/general-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+970 Bytes
(100%)
...pshots/settings/general-user-settings-tab.spec.ts/general-smallscreen-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+654 Bytes
(100%)
...b.spec.ts/Preferences-user-settings-tab-should-be-rendered-properly-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,18 @@ limitations under the License. | |
|
||
import { Toast } from "@vector-im/compound-web"; | ||
import React, { useState } from "react"; | ||
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"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, yes, that's better There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, we should probably eslint ban the source svgs |
||
|
||
import TabbedView, { Tab, useActiveTabWithDefault } from "../../structures/TabbedView"; | ||
import { _t, _td } from "../../../languageHandler"; | ||
|
@@ -93,7 +105,7 @@ export default function UserSettingsDialog(props: IProps): JSX.Element { | |
new Tab( | ||
UserTab.General, | ||
_td("common|general"), | ||
"mx_UserSettingsDialog_settingsIcon", | ||
<UserProfileIcon />, | ||
<GeneralUserSettingsTab closeSettingsFn={props.onFinished} />, | ||
"UserSettingsGeneral", | ||
), | ||
|
@@ -102,7 +114,7 @@ export default function UserSettingsDialog(props: IProps): JSX.Element { | |
new Tab( | ||
UserTab.SessionManager, | ||
_td("settings|sessions|title"), | ||
"mx_UserSettingsDialog_sessionsIcon", | ||
<DevicesIcon />, | ||
<SessionManagerTab showMsc4108QrCode={showMsc4108QrCode} />, | ||
undefined, | ||
), | ||
|
@@ -111,7 +123,7 @@ export default function UserSettingsDialog(props: IProps): JSX.Element { | |
new Tab( | ||
UserTab.Appearance, | ||
_td("common|appearance"), | ||
"mx_UserSettingsDialog_appearanceIcon", | ||
<VisibilityOnIcon />, | ||
<AppearanceUserSettingsTab />, | ||
"UserSettingsAppearance", | ||
), | ||
|
@@ -120,7 +132,7 @@ export default function UserSettingsDialog(props: IProps): JSX.Element { | |
new Tab( | ||
UserTab.Notifications, | ||
_td("notifications|enable_prompt_toast_title"), | ||
"mx_UserSettingsDialog_bellIcon", | ||
<NotificationsIcon />, | ||
<NotificationUserSettingsTab />, | ||
"UserSettingsNotifications", | ||
), | ||
|
@@ -129,7 +141,7 @@ export default function UserSettingsDialog(props: IProps): JSX.Element { | |
new Tab( | ||
UserTab.Preferences, | ||
_td("common|preferences"), | ||
"mx_UserSettingsDialog_preferencesIcon", | ||
<PreferencesIcon />, | ||
<PreferencesUserSettingsTab closeSettingsFn={props.onFinished} />, | ||
"UserSettingsPreferences", | ||
), | ||
|
@@ -138,7 +150,7 @@ export default function UserSettingsDialog(props: IProps): JSX.Element { | |
new Tab( | ||
UserTab.Keyboard, | ||
_td("settings|keyboard|title"), | ||
"mx_UserSettingsDialog_keyboardIcon", | ||
<KeyboardIcon />, | ||
<KeyboardUserSettingsTab />, | ||
"UserSettingsKeyboard", | ||
), | ||
|
@@ -147,7 +159,7 @@ export default function UserSettingsDialog(props: IProps): JSX.Element { | |
new Tab( | ||
UserTab.Sidebar, | ||
_td("settings|sidebar|title"), | ||
"mx_UserSettingsDialog_sidebarIcon", | ||
<SidebarIcon />, | ||
<SidebarUserSettingsTab />, | ||
"UserSettingsSidebar", | ||
), | ||
|
@@ -158,7 +170,7 @@ export default function UserSettingsDialog(props: IProps): JSX.Element { | |
new Tab( | ||
UserTab.Voice, | ||
_td("settings|voip|title"), | ||
"mx_UserSettingsDialog_voiceIcon", | ||
<MicOnIcon />, | ||
<VoiceUserSettingsTab />, | ||
"UserSettingsVoiceVideo", | ||
), | ||
|
@@ -169,29 +181,23 @@ export default function UserSettingsDialog(props: IProps): JSX.Element { | |
new Tab( | ||
UserTab.Security, | ||
_td("room_settings|security|title"), | ||
"mx_UserSettingsDialog_securityIcon", | ||
<LockIcon />, | ||
<SecurityUserSettingsTab closeSettingsFn={props.onFinished} />, | ||
"UserSettingsSecurityPrivacy", | ||
), | ||
); | ||
|
||
if (showLabsFlags() || SettingsStore.getFeatureSettingNames().some((k) => SettingsStore.getBetaInfo(k))) { | ||
tabs.push( | ||
new Tab( | ||
UserTab.Labs, | ||
_td("common|labs"), | ||
"mx_UserSettingsDialog_labsIcon", | ||
<LabsUserSettingsTab />, | ||
"UserSettingsLabs", | ||
), | ||
new Tab(UserTab.Labs, _td("common|labs"), <LabsIcon />, <LabsUserSettingsTab />, "UserSettingsLabs"), | ||
); | ||
} | ||
if (mjolnirEnabled) { | ||
tabs.push( | ||
new Tab( | ||
UserTab.Mjolnir, | ||
_td("labs_mjolnir|title"), | ||
"mx_UserSettingsDialog_mjolnirIcon", | ||
<BlockIcon />, | ||
<MjolnirUserSettingsTab />, | ||
"UserSettingMjolnir", | ||
), | ||
|
@@ -201,7 +207,7 @@ export default function UserSettingsDialog(props: IProps): JSX.Element { | |
new Tab( | ||
UserTab.Help, | ||
_td("setting|help_about|title"), | ||
"mx_UserSettingsDialog_helpIcon", | ||
<HelpIcon />, | ||
<HelpUserSettingsTab />, | ||
"UserSettingsHelpAbout", | ||
), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null
is of typeobject
so it wouldn't match either case.