diff --git a/package.json b/package.json index 648630a253b..356eb7b6862 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "@sentry/browser": "^8.0.0", "@testing-library/react-hooks": "^8.0.1", "@vector-im/compound-design-tokens": "^1.2.0", - "@vector-im/compound-web": "^4.9.0", + "@vector-im/compound-web": "^5.1.2", "@zxcvbn-ts/core": "^3.0.4", "@zxcvbn-ts/language-common": "^3.0.4", "@zxcvbn-ts/language-en": "^3.0.2", diff --git a/playwright/snapshots/settings/appearance-user-settings-tab/appearance-user-settings-tab.spec.ts/theme-panel-custom-theme-added-linux.png b/playwright/snapshots/settings/appearance-user-settings-tab/appearance-user-settings-tab.spec.ts/theme-panel-custom-theme-added-linux.png index ffde3eb92e2..d44c1073072 100644 Binary files a/playwright/snapshots/settings/appearance-user-settings-tab/appearance-user-settings-tab.spec.ts/theme-panel-custom-theme-added-linux.png and b/playwright/snapshots/settings/appearance-user-settings-tab/appearance-user-settings-tab.spec.ts/theme-panel-custom-theme-added-linux.png differ diff --git a/playwright/snapshots/settings/appearance-user-settings-tab/appearance-user-settings-tab.spec.ts/theme-panel-custom-theme-linux.png b/playwright/snapshots/settings/appearance-user-settings-tab/appearance-user-settings-tab.spec.ts/theme-panel-custom-theme-linux.png index 0a24053a1c4..76a0befd339 100644 Binary files a/playwright/snapshots/settings/appearance-user-settings-tab/appearance-user-settings-tab.spec.ts/theme-panel-custom-theme-linux.png and b/playwright/snapshots/settings/appearance-user-settings-tab/appearance-user-settings-tab.spec.ts/theme-panel-custom-theme-linux.png differ diff --git a/playwright/snapshots/settings/general-user-settings-tab.spec.ts/general-linux.png b/playwright/snapshots/settings/general-user-settings-tab.spec.ts/general-linux.png index 4fa467dd351..4cf8df1c326 100644 Binary files a/playwright/snapshots/settings/general-user-settings-tab.spec.ts/general-linux.png and b/playwright/snapshots/settings/general-user-settings-tab.spec.ts/general-linux.png differ diff --git a/playwright/snapshots/settings/general-user-settings-tab.spec.ts/general-smallscreen-linux.png b/playwright/snapshots/settings/general-user-settings-tab.spec.ts/general-smallscreen-linux.png index 0b5a08979d9..d0380e6a4fc 100644 Binary files a/playwright/snapshots/settings/general-user-settings-tab.spec.ts/general-smallscreen-linux.png and b/playwright/snapshots/settings/general-user-settings-tab.spec.ts/general-smallscreen-linux.png differ diff --git a/res/css/views/settings/_UserProfileSettings.pcss b/res/css/views/settings/_UserProfileSettings.pcss index f9ca149bf78..b1909dde12a 100644 --- a/res/css/views/settings/_UserProfileSettings.pcss +++ b/res/css/views/settings/_UserProfileSettings.pcss @@ -35,6 +35,7 @@ limitations under the License. .mx_UserProfileSettings_profile_controls_userId { width: 100%; + margin-top: var(--cpd-space-4x); .mx_CopyableText { margin-top: var(--cpd-space-1x); width: 100%; diff --git a/src/components/views/settings/ThemeChoicePanel.tsx b/src/components/views/settings/ThemeChoicePanel.tsx index e3df157d615..c22da69bedd 100644 --- a/src/components/views/settings/ThemeChoicePanel.tsx +++ b/src/components/views/settings/ThemeChoicePanel.tsx @@ -23,6 +23,8 @@ import { RadioControl, EditInPlace, IconButton, + ErrorMessage, + HelpMessage, } from "@vector-im/compound-web"; import { Icon as DeleteIcon } from "@vector-im/compound-design-tokens/icons/delete.svg"; import classNames from "classnames"; @@ -231,10 +233,9 @@ function CustomTheme({ theme }: CustomThemeProps): JSX.Element { ) => { setError(undefined); @@ -281,7 +282,10 @@ function CustomTheme({ theme }: CustomThemeProps): JSX.Element { await SettingsStore.setValue("custom_themes", null, SettingLevel.ACCOUNT, currentThemes); }} onCancel={clear} - /> + > + {_t("settings|appearance|custom_theme_help")} + {error && {error}} + ); diff --git a/src/components/views/settings/UserProfileSettings.tsx b/src/components/views/settings/UserProfileSettings.tsx index 6d1bccb30e9..af1c098cef3 100644 --- a/src/components/views/settings/UserProfileSettings.tsx +++ b/src/components/views/settings/UserProfileSettings.tsx @@ -16,7 +16,7 @@ limitations under the License. import React, { ChangeEvent, useCallback, useEffect, useMemo, useState } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { EditInPlace, Alert } from "@vector-im/compound-web"; +import { EditInPlace, Alert, ErrorMessage } from "@vector-im/compound-web"; import { _t } from "../../../languageHandler"; import { OwnProfileStore } from "../../../stores/OwnProfileStore"; @@ -68,7 +68,6 @@ interface UserProfileSettingsProps { const UserProfileSettings: React.FC = ({ canSetDisplayName, canSetAvatar }) => { const [avatarURL, setAvatarURL] = useState(OwnProfileStore.instance.avatarMxc); const [displayName, setDisplayName] = useState(OwnProfileStore.instance.displayName ?? ""); - const [initialDisplayName, setInitialDisplayName] = useState(OwnProfileStore.instance.displayName ?? ""); const [avatarError, setAvatarError] = useState(false); const [maxUploadSize, setMaxUploadSize] = useState(); const [displayNameError, setDisplayNameError] = useState(false); @@ -135,7 +134,6 @@ const UserProfileSettings: React.FC = ({ canSetDisplay try { setDisplayNameError(false); await client.setDisplayName(displayName); - setInitialDisplayName(displayName); } catch (e) { setDisplayNameError(true); throw e; @@ -174,7 +172,6 @@ const UserProfileSettings: React.FC = ({ canSetDisplay className="mx_UserProfileSettings_profile_displayName" label={_t("settings|general|display_name")} value={displayName} - disableSaveButton={displayName === initialDisplayName} saveButtonLabel={_t("common|save")} cancelButtonLabel={_t("common|cancel")} savedLabel={_t("common|saved")} @@ -182,9 +179,10 @@ const UserProfileSettings: React.FC = ({ canSetDisplay onChange={onDisplayNameChanged} onCancel={onDisplayNameCancel} onSave={onDisplayNameSave} - error={displayNameError ? _t("settings|general|display_name_error") : undefined} disabled={!canSetDisplayName} - /> + > + {displayNameError && {_t("settings|general|display_name_error")}} + {avatarError && ( diff --git a/test/components/views/settings/__snapshots__/ThemeChoicePanel-test.tsx.snap b/test/components/views/settings/__snapshots__/ThemeChoicePanel-test.tsx.snap index ecbd1e38a4a..15889d241b7 100644 --- a/test/components/views/settings/__snapshots__/ThemeChoicePanel-test.tsx.snap +++ b/test/components/views/settings/__snapshots__/ThemeChoicePanel-test.tsx.snap @@ -19,20 +19,20 @@ exports[` custom theme should display custom theme 1`] = ` class="mx_SettingsSubsection_content mx_SettingsSubsection_content_newUi" >
custom theme should display custom theme 1`] = `
@@ -55,13 +55,13 @@ exports[` custom theme should display custom theme 1`] = `
custom theme should display custom theme 1`] = ` custom theme should display custom theme 1`] = `
custom theme should display custom theme 1`] = `
custom theme should display custom theme 1`] = `
custom theme should display custom theme 1`] = `
@@ -195,72 +195,36 @@ exports[` custom theme should display custom theme 1`] = ` class="mx_ThemeChoicePanel_CustomTheme" >
- Add custom theme -
-
- +
- - +
+ + Enter the URL of a custom theme you want to apply. +
- - Enter the URL of a custom theme you want to apply. -
    custom theme should render the custom theme sectio class="mx_SettingsSubsection_content mx_SettingsSubsection_content_newUi" >
    custom theme should render the custom theme sectio
    custom theme should render the custom theme sectio
    custom theme should render the custom theme sectio
    custom theme should render the custom theme sectio
    custom theme should render the custom theme sectio