From 2e39a1566039c975a8181005a6fb0b47cb21bb2c Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 21 Mar 2025 14:02:06 +0400 Subject: [PATCH] UI: Design edits (#5668) Co-authored-by: zubiden <19638254+zubiden@users.noreply.github.com> --- src/components/auth/CountryCodeInput.scss | 4 +- src/components/auth/CountryCodeInput.tsx | 5 +- src/components/calls/group/GroupCall.tsx | 1 + src/components/common/LinkField.module.scss | 7 ++- src/components/common/LinkField.tsx | 1 + .../common/ManageUsernames.module.scss | 2 - src/components/left/settings/Settings.scss | 32 ++++------ src/components/left/settings/Settings.tsx | 12 +++- .../left/settings/SettingsEditProfile.tsx | 58 ++++++++++--------- .../left/settings/SettingsGeneral.tsx | 2 +- .../settings/SettingsGeneralBackground.tsx | 2 +- .../left/settings/SettingsPasswordForm.tsx | 2 +- .../left/settings/SettingsPrivacy.tsx | 2 +- .../settings/folders/SettingsFoldersEdit.tsx | 2 +- .../SettingsPasscodeCongratulations.tsx | 2 +- .../passcode/SettingsPasscodeEnabled.tsx | 2 +- .../passcode/SettingsPasscodeStart.tsx | 2 +- .../twoFa/SettingsTwoFaCongratulations.tsx | 2 +- .../settings/twoFa/SettingsTwoFaEmailCode.tsx | 10 ++-- .../settings/twoFa/SettingsTwoFaEnabled.tsx | 2 +- .../twoFa/SettingsTwoFaSkippableForm.tsx | 10 ++-- .../settings/twoFa/SettingsTwoFaStart.tsx | 2 +- src/components/right/Profile.scss | 7 +++ src/components/right/RightColumn.scss | 9 +++ src/components/right/RightColumn.tsx | 14 ++++- .../right/management/ManageChannel.tsx | 2 +- .../management/ManageChatAdministrators.tsx | 2 +- .../management/ManageChatPrivacyType.tsx | 23 ++++---- .../management/ManageChatRemovedUsers.tsx | 2 +- .../right/management/ManageDiscussion.tsx | 2 +- .../right/management/ManageGroup.tsx | 2 +- .../management/ManageGroupAdminRights.tsx | 2 +- .../right/management/ManageGroupMembers.tsx | 2 +- .../management/ManageGroupPermissions.tsx | 2 +- .../right/management/ManageInvite.tsx | 6 +- .../right/management/ManageInviteInfo.tsx | 30 +++------- .../right/management/ManageInvites.tsx | 7 +-- .../right/management/ManageReactions.tsx | 2 +- .../right/management/Management.scss | 10 ++++ .../statistics/BoostStatistics.module.scss | 20 ++++++- .../right/statistics/BoostStatistics.tsx | 2 +- .../right/statistics/Statistics.module.scss | 3 + .../right/statistics/Statistics.tsx | 20 +++---- .../statistics/StatisticsOverview.module.scss | 2 +- src/components/ui/ListItem.scss | 10 ++++ src/components/ui/ListItem.tsx | 3 + src/hooks/useMarkScrolled/useMarkScrolled.ts | 38 ++++++++++++ src/lib/lovely-chart/styles/_header.scss | 2 +- src/styles/_variables.scss | 2 +- 49 files changed, 247 insertions(+), 143 deletions(-) create mode 100644 src/hooks/useMarkScrolled/useMarkScrolled.ts diff --git a/src/components/auth/CountryCodeInput.scss b/src/components/auth/CountryCodeInput.scss index aa2bc7e2d..e95e886d9 100644 --- a/src/components/auth/CountryCodeInput.scss +++ b/src/components/auth/CountryCodeInput.scss @@ -15,7 +15,7 @@ // Prevent loading additional 10 kB of icomoon font on initial load. .css-icon-down { position: absolute; - top: 1.125rem; + top: 1rem; right: 1rem; width: 0.75rem; height: 0.75rem; @@ -29,7 +29,7 @@ &.open { border-color: var(--color-primary); transform: scaleY(-1) rotate(45deg); - top: 1.5rem; + top: 1.3125rem; } } } diff --git a/src/components/auth/CountryCodeInput.tsx b/src/components/auth/CountryCodeInput.tsx index 44e35bf97..c0f720e1a 100644 --- a/src/components/auth/CountryCodeInput.tsx +++ b/src/components/auth/CountryCodeInput.tsx @@ -10,6 +10,7 @@ import { ANIMATION_END_DELAY } from '../../config'; import buildClassName from '../../util/buildClassName'; import { isoToEmoji } from '../../util/emoji/emoji'; import { prepareSearchWordsForNeedle } from '../../util/searchWords'; +import { IS_EMOJI_SUPPORTED } from '../../util/windowEnvironment'; import renderText from '../common/helpers/renderText'; import useLang from '../../hooks/useLang'; @@ -104,7 +105,9 @@ const CountryCodeInput: FC = ({ handleTrigger(); }; - const inputValue = filter ?? (value?.name || value?.defaultName || ''); + const emoji = value && IS_EMOJI_SUPPORTED && renderText(isoToEmoji(value.iso2), ['hq_emoji']); + const name = value?.name || value?.defaultName || ''; + const inputValue = filter ?? [emoji, name].filter(Boolean).join(' '); return (
diff --git a/src/components/calls/group/GroupCall.tsx b/src/components/calls/group/GroupCall.tsx index e3b77e852..49fae0c6f 100644 --- a/src/components/calls/group/GroupCall.tsx +++ b/src/components/calls/group/GroupCall.tsx @@ -537,6 +537,7 @@ const GroupCall: FC = ({

{lang(isEndGroupCallModal ? 'VoipGroupEndAlertText' : 'VoipGroupLeaveAlertText')}

{!isEndGroupCallModal && ( = ({ size="smaller" disabled={isDisabled} onClick={handleShare} + className={styles.share} > {lang('FolderLinkScreen.LinkActionShare')} diff --git a/src/components/common/ManageUsernames.module.scss b/src/components/common/ManageUsernames.module.scss index de4cf855f..f1a527c57 100644 --- a/src/components/common/ManageUsernames.module.scss +++ b/src/components/common/ManageUsernames.module.scss @@ -10,7 +10,6 @@ .header { font-size: 1rem; color: var(--color-text-secondary); - margin-bottom: 2rem; position: relative; &[dir="rtl"] { @@ -22,7 +21,6 @@ font-size: 0.875rem; color: var(--color-text-secondary); - margin-top: 1rem; margin-bottom: 0; padding-top: 0.5rem; padding-bottom: 1.5rem; diff --git a/src/components/left/settings/Settings.scss b/src/components/left/settings/Settings.scss index a90643c8f..356934ce5 100644 --- a/src/components/left/settings/Settings.scss +++ b/src/components/left/settings/Settings.scss @@ -38,13 +38,14 @@ } .settings-content { - border-top: 1px solid var(--color-borders); + border-top: 1px solid transparent; + transition: border-top-color 250ms ease-in-out; height: calc(100% - var(--header-height)); overflow-y: scroll; - &.no-border, &.two-fa, &.local-passcode, &.password-form { - border-top: none; + &.scrolled { + border-top-color: var(--color-borders); } &.password-form .input-group.error label::first-letter { @@ -83,11 +84,9 @@ display: flex; flex-direction: column; align-items: center; - padding: 0 1.5rem 1rem; + padding: 0 1.5rem; text-align: center; - @include mixins.side-panel-section; - &.no-border { margin-bottom: 0; box-shadow: none; @@ -125,7 +124,7 @@ .settings-item-simple, .settings-item { text-align: initial; - padding: 1.5rem 0.5rem 1rem; + padding: 0.5rem 0.5rem 1rem; @include mixins.adapt-padding-to-scrollbar(0.5rem); @include mixins.side-panel-section; @@ -152,10 +151,9 @@ &-description { font-size: 0.875rem; + line-height: 1.3125; color: var(--color-text-secondary); - margin-top: -0.5rem; - margin-bottom: 1rem; - padding-inline-start: 1rem; + margin: -0.5rem 1rem 1rem; .settings-content.two-fa &, .settings-content.password-form &, @@ -163,11 +161,6 @@ font-size: 1rem; } - .settings-edit-profile & { - margin-bottom: 0; - padding-bottom: 1.5rem; - } - &[dir="rtl"] { text-align: right; unicode-bidi: plaintext; @@ -296,10 +289,13 @@ padding: 0.5rem 1rem 0 1rem; } +.settings-group { + padding: 1rem 1.5rem; +} + .settings-fab-wrapper { height: calc(100% - var(--header-height)); position: relative; - overflow: hidden; .settings-content { height: 100%; @@ -315,10 +311,6 @@ } } -.settings-edit-profile { - padding: 0 1.5rem !important; -} - .settings-quick-reaction { .Radio-main .label { display: flex; diff --git a/src/components/left/settings/Settings.tsx b/src/components/left/settings/Settings.tsx index ea4d8cace..381bb4a8e 100644 --- a/src/components/left/settings/Settings.tsx +++ b/src/components/left/settings/Settings.tsx @@ -1,5 +1,5 @@ import type { FC } from '../../../lib/teact/teact'; -import React, { memo, useState } from '../../../lib/teact/teact'; +import React, { memo, useRef, useState } from '../../../lib/teact/teact'; import { getActions, getGlobal } from '../../../global'; import type { FolderEditDispatch, FoldersState } from '../../../hooks/reducers/useFoldersReducer'; @@ -10,6 +10,7 @@ import { LAYERS_ANIMATION_NAME } from '../../../util/windowEnvironment'; import useTwoFaReducer from '../../../hooks/reducers/useTwoFaReducer'; import useLastCallback from '../../../hooks/useLastCallback'; +import useMarkScrolled from '../../../hooks/useMarkScrolled/useMarkScrolled'; import Transition from '../../ui/Transition'; import SettingsFolders from './folders/SettingsFolders'; @@ -161,9 +162,17 @@ const Settings: FC = ({ }) => { const { closeShareChatFolderModal } = getActions(); + // eslint-disable-next-line no-null/no-null + const containerRef = useRef(null); + const [twoFaState, twoFaDispatch] = useTwoFaReducer(); const [privacyPasscode, setPrivacyPasscode] = useState(''); + useMarkScrolled({ + containerRef, + selector: '.settings-content', + }, [currentScreen]); + const handleReset = useLastCallback((forceReturnToChatList?: true | Event) => { const isFromSettings = selectTabState(getGlobal()).shareFolderScreen?.isFromSettings; @@ -506,6 +515,7 @@ const Settings: FC = ({ return ( = ({ return (
-
- - - -