Message List: Remove extra padding in channels

This commit is contained in:
Alexander Zinchuk 2021-05-12 03:13:17 +03:00
parent f06ef4bd41
commit b96643ea2a
3 changed files with 10 additions and 12 deletions

View File

@ -44,17 +44,19 @@
}
}
&.bottom-padding {
&.no-composer {
margin-bottom: 0;
.messages-container {
padding-bottom: 1rem;
}
&-big {
&.type-pinned {
.messages-container {
padding-bottom: 4.75rem;
padding-bottom: 5rem;
@media (max-width: 600px) {
padding-bottom: 3.5rem;
padding-bottom: 3.75rem;
}
}
}

View File

@ -30,7 +30,6 @@ import {
isChatChannel,
isChatPrivate,
isOwnMessage,
getCanPostInChat,
} from '../../modules/helpers';
import {
compact,
@ -65,15 +64,14 @@ type OwnProps = {
chatId: number;
threadId: number;
type: MessageListType;
canPost: boolean;
onFabToggle: (show: boolean) => void;
hasTools?: boolean;
bottomOffset: 'none' | 'small' | 'big';
};
type StateProps = {
isChatLoaded?: boolean;
isChannelChat?: boolean;
canPost?: boolean;
isChatWithSelf?: boolean;
messageIds?: number[];
messagesById?: Record<number, ApiMessage>;
@ -119,7 +117,6 @@ const MessageList: FC<OwnProps & StateProps & DispatchProps> = ({
isChatLoaded,
isChannelChat,
canPost,
bottomOffset,
isChatWithSelf,
messageIds,
messagesById,
@ -505,8 +502,8 @@ const MessageList: FC<OwnProps & StateProps & DispatchProps> = ({
'MessageList custom-scroll',
!withUsers && 'no-avatars',
isChannelChat && 'no-avatars',
(!canPost || bottomOffset !== 'none') && 'bottom-padding',
(bottomOffset !== 'none') && `bottom-padding-${bottomOffset}`,
!canPost && 'no-composer',
type === 'pinned' && 'type-pinned',
isSelectModeActive && 'select-mode-active',
hasFocusing && 'has-focusing',
isScrolled && 'scrolled',
@ -758,7 +755,6 @@ export default memo(withGlobal<OwnProps>(
isRestricted,
restrictionReason,
isChannelChat: isChatChannel(chat),
canPost: getCanPostInChat(chat, threadId),
isChatWithSelf: selectIsChatWithSelf(global, chatId),
messageIds,
messagesById,

View File

@ -234,9 +234,9 @@ const MiddleColumn: FC<StateProps & DispatchProps> = ({
chatId={renderingChatId}
threadId={renderingThreadId}
type={renderingMessageListType}
canPost={renderingCanPost}
hasTools={hasTools}
onFabToggle={setIsFabShown}
bottomOffset={renderingCanPost ? 'none' : (isPinnedMessageList ? 'big' : 'small')}
/>
<div className={buildClassName('middle-column-footer', !renderingCanPost && 'no-composer')}>
{renderingCanPost && (