Message List: Tune the date position for full-width pinned messages (#3134)

This commit is contained in:
Alexander Zinchuk 2023-05-02 15:23:29 +04:00
parent 1e6f16ab33
commit cf1d5c6636
2 changed files with 6 additions and 9 deletions

View File

@ -77,9 +77,6 @@
}
@media (min-width: 1276px) {
transform: translate3d(0, 0, 0);
transition: opacity 0.15s ease, transform var(--layer-transition);
:global(#Main.right-column-open) & {
padding-left: calc(var(--right-column-width) + 1rem);
}

View File

@ -14,17 +14,16 @@ import type {
import type { ThemeKey } from '../../types';
import {
MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN,
MOBILE_SCREEN_MAX_WIDTH,
MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,
SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN,
SAFE_SCREEN_WIDTH_FOR_CHAT_INFO,
ANIMATION_END_DELAY,
DARK_THEME_BG_COLOR,
LIGHT_THEME_BG_COLOR,
SUPPORTED_IMAGE_CONTENT_TYPES,
GENERAL_TOPIC_ID,
TMP_CHAT_ID,
MAX_SCREEN_WIDTH_FOR_EXPAND_PINNED_MESSAGES,
} from '../../config';
import { IS_ANDROID, IS_IOS, MASK_IMAGE_DISABLED } from '../../util/windowEnvironment';
import { DropAreaState } from './composer/DropArea';
@ -106,6 +105,7 @@ type StateProps = {
defaultBannedRights?: ApiChatBannedRights;
hasPinned?: boolean;
hasAudioPlayer?: boolean;
hasButtonInHeader?: boolean;
pinnedMessagesCount?: number;
theme: ThemeKey;
customBackground?: string;
@ -156,6 +156,7 @@ const MiddleColumn: FC<OwnProps & StateProps> = ({
defaultBannedRights,
hasPinned,
hasAudioPlayer,
hasButtonInHeader,
pinnedMessagesCount,
customBackground,
theme,
@ -221,14 +222,12 @@ const MiddleColumn: FC<OwnProps & StateProps> = ({
const closeAnimationDuration = isMobile ? LAYER_ANIMATION_DURATION_MS : undefined;
const hasTools = hasPinned && (
windowWidth < MOBILE_SCREEN_MAX_WIDTH
|| hasAudioPlayer
|| (
isRightColumnShown && windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN
&& windowWidth < SAFE_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN
) || (
windowWidth >= MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN
&& windowWidth < SAFE_SCREEN_WIDTH_FOR_CHAT_INFO
&& hasAudioPlayer
)
|| (!isMobile && hasButtonInHeader && windowWidth < MAX_SCREEN_WIDTH_FOR_EXPAND_PINNED_MESSAGES)
);
const renderingChatId = usePrevDuringAnimation(chatId, closeAnimationDuration);
@ -720,6 +719,7 @@ export default memo(withGlobal<OwnProps>(
|| Boolean(!isPinnedMessageList && pinnedIds?.length)
),
hasAudioPlayer: Boolean(audioMessage),
hasButtonInHeader: canStartBot || canRestartBot || canSubscribe || shouldSendJoinRequest,
pinnedMessagesCount: pinnedIds ? pinnedIds.length : 0,
shouldSkipHistoryAnimations,
isChannel,