Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(redesign-message-input): update input positioning/styles and add placeholder to mentions component #2256

Merged
merged 20 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 26 additions & 30 deletions src/components/message-input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,24 +284,22 @@ export class MessageInput extends React.Component<Properties, State> {

<div {...cn('input-row')}>
{this.allowLeftIcons && (
<div {...cn('icon-outer')}>
<div {...cn('icon-wrapper')}>
{this.allowGiphy && (
<IconButton {...cn('icon', 'giphy')} onClick={this.openGiphy} Icon={IconStickerCircle} size='small' />
)}

{this.allowFileAttachment && (
<Menu
onSelected={this.mediaSelected}
mimeTypes={this.mimeTypes}
maxSize={config.cloudinary.max_file_size}
/>
)}
</div>
<div {...cn('icon-wrapper')}>
{this.allowGiphy && (
<IconButton {...cn('icon', 'giphy')} onClick={this.openGiphy} Icon={IconStickerCircle} size='small' />
)}

{this.allowFileAttachment && (
<Menu
onSelected={this.mediaSelected}
mimeTypes={this.mimeTypes}
maxSize={config.cloudinary.max_file_size}
/>
)}
</div>
)}

<div {...cn('chat-container')}>
<div {...cn('chat-container', this.props.isEditing && 'editing')}>
<div {...cn('scroll-container')}>
<div {...cn('text-and-emoji-wrapper')}>
<Dropzone
Expand Down Expand Up @@ -361,21 +359,19 @@ export class MessageInput extends React.Component<Properties, State> {
</div>

{!this.props.isEditing && (
<div {...cn('icon-outer')}>
<div {...cn('icon-wrapper')}>
{/* See: ZOS-115
* @ts-ignore */}
<Tooltip content={this.sendDisabledTooltipContent} open={this.state.isSendTooltipOpen}>
<IconButton
{...cn('icon', 'end-action')}
onClick={this.onSend}
Icon={IconSend3}
size='small'
isFilled={this.sendHighlighted()}
label='send'
/>
</Tooltip>
</div>
<div {...cn('icon-wrapper')}>
{/* See: ZOS-115
* @ts-ignore */}
<Tooltip content={this.sendDisabledTooltipContent} open={this.state.isSendTooltipOpen}>
<IconButton
{...cn('icon', 'end-action')}
onClick={this.onSend}
Icon={IconSend3}
size='small'
isFilled={this.sendHighlighted()}
label='send'
/>
</Tooltip>
</div>
)}
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/message-input/mentions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export class Mentions extends React.Component<Properties> {
allowSuggestionsAboveCursor
suggestionsPortalHost={document.body}
onContextMenu={this.handleOnContextMenu}
placeholder='Write a Message...'
>
{this.renderMentionTypes()}
</MentionsInput>
Expand Down
22 changes: 11 additions & 11 deletions src/components/message-input/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

.message-input {
display: flex;
padding: 8px 16px;
flex-direction: column;
justify-content: flex-end;
align-items: flex-end;
gap: 8px;
padding: 12px 18px;

&--editing {
padding: 0;

margin-right: none;
}

Expand All @@ -34,16 +35,11 @@
width: 100%;
}

&__icon-outer {
padding-bottom: 8px;
}

&__emoji-icon-outer {
display: flex;
align-self: flex-end;
position: sticky;
bottom: 0;
margin-right: 3px;
}

&__icon-wrapper {
Expand All @@ -63,19 +59,23 @@

&__chat-container {
display: flex;
padding: 8px 0px 8px 16px;
padding: 0;
flex-direction: column;
justify-content: center;
align-items: flex-end;
gap: 8px;
width: 100%;
border-radius: 8px;

@include glass-input-inset-default;
&--editing {
padding: 8px 0px 8px 16px;

@include glass-input-inset-default;

&:focus-within {
border-color: theme.$color-primary-7;
@include glass-input-inset-active;
&:focus-within {
border-color: theme.$color-primary-7;
@include glass-input-inset-active;
}
}
}

Expand Down
Loading