Skip to content

Commit

Permalink
refactor(redesign-chat-header): update positioning and styles of mess…
Browse files Browse the repository at this point in the history
…enger chat header (#2260)
  • Loading branch information
domw30 authored Sep 12, 2024
1 parent 37c65b1 commit d1bf6b9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 26 deletions.
11 changes: 1 addition & 10 deletions src/apps/messenger/Main.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@
position: relative;
display: flex;
width: 100%;
gap: 8px;
}

.Header {
left: 0;
pointer-events: all !important;
position: absolute;
top: 16px;
width: calc(100% - 16px) !important;
z-index: 1000;
gap: 45px;
}

.Actions {
Expand Down
3 changes: 0 additions & 3 deletions src/apps/messenger/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { DevPanelContainer } from '../../components/dev-panel/container';
import { FeatureFlag } from '../../components/feature-flag';

import styles from './Main.module.scss';
import { ConversationHeaderContainer as ConversationHeader } from '../../components/messenger/conversation-header/container';
import { denormalize } from '../../store/channels';
import { ConversationActionsContainer as ConversationActions } from '../../components/messenger/conversation-actions/container';

Expand Down Expand Up @@ -50,8 +49,6 @@ export class Container extends React.Component<Properties> {
<Sidekick />

<div className={styles.Split}>
{!this.props.isSocialChannel && <ConversationHeader className={styles.Header} />}

<ConversationActions className={styles.Actions} />

{this.props.isSocialChannel && !this.props.isJoiningConversation && this.props.isValidConversation && (
Expand Down
9 changes: 3 additions & 6 deletions src/components/header/index.module.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
@use '~@zero-tech/zui/styles/theme' as theme;
@import '../../glass';

$header-height: 66px;

.Header {
border-radius: 16px;
box-sizing: border-box;
display: flex;
gap: 8px;
height: $header-height;
padding: 16px;
padding: 12px 18px;
width: 100%;
@include flat-thick;
border-bottom: 1px solid rgba(52, 56, 60, 0.24);
backdrop-filter: blur(64px);

.Avatar {
pointer-events: none;
Expand Down
19 changes: 12 additions & 7 deletions src/components/messenger/chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { JoiningConversationDialog } from '../../joining-conversation-dialog';
import { MessageInput } from '../../message-input/container';
import { searchMentionableUsersForChannel } from '../../../platform-apps/channels/util/api';
import { Media } from '../../message-input/utils';
import { ConversationHeaderContainer as ConversationHeader } from '../conversation-header/container';

import './styles.scss';
import { rawChannelSelector } from '../../../store/channels/saga';
Expand Down Expand Up @@ -156,13 +157,17 @@ export class Container extends React.Component<Properties> {
<div className={classNames('direct-message-chat', 'direct-message-chat--full-screen')}>
<div className='direct-message-chat__content'>
{!this.props.isJoiningConversation && (
<ChatViewContainer
key={this.props.directMessage.optimisticId || this.props.directMessage.id} // Render new component for a new chat
channelId={this.props.activeConversationId}
className='direct-message-chat__channel'
showSenderAvatar={!this.isOneOnOne()}
ref={this.chatViewContainerRef}
/>
<>
{!this.props.directMessage.isSocialChannel && <ConversationHeader />}

<ChatViewContainer
key={this.props.directMessage.optimisticId || this.props.directMessage.id} // Render new component for a new chat
channelId={this.props.activeConversationId}
className='direct-message-chat__channel'
showSenderAvatar={!this.isOneOnOne()}
ref={this.chatViewContainerRef}
/>
</>
)}

<div className='direct-message-chat__footer-position'>
Expand Down

0 comments on commit d1bf6b9

Please sign in to comment.