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

fix: ChatInput Formatter Tool UI for small screens #693

Merged
merged 36 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
00baef5
Fix chatFormatter Toolbar UI
abirc8010 Dec 17, 2024
1e07b9b
make message box and popover menu occupy full width
abirc8010 Dec 19, 2024
8e8c7a4
Merge branch 'develop' into fix/message-box-UI
abirc8010 Dec 22, 2024
f1363b0
Merge branch 'develop' into fix/message-box-UI
abirc8010 Dec 22, 2024
0cc4ce4
Merge branch 'develop' into fix/message-box-UI
abirc8010 Dec 23, 2024
e3a962a
make message composer configurable
abirc8010 Dec 28, 2024
7806db6
Merge branch 'develop' into fix/message-box-UI
abirc8010 Jan 1, 2025
34c5bc6
resolve conflicts
abirc8010 Jan 1, 2025
09accdf
Merge branch 'fix/message-box-UI' of https://github.com/abirc8010/Emb…
abirc8010 Jan 1, 2025
f6d80f7
zIndex fix
abirc8010 Jan 4, 2025
529467e
Merge branch 'develop' into fix/message-box-UI
abirc8010 Jan 5, 2025
0854be1
Merge branch 'develop' into fix/message-box-UI
abirc8010 Jan 5, 2025
149b253
resolve conflict
abirc8010 Jan 5, 2025
a576f8b
resolve conflicts
abirc8010 Jan 5, 2025
f856524
Merge branch 'develop' into fix/message-box-UI
abirc8010 Jan 8, 2025
a3ce271
Merge branch 'develop' into fix/message-box-UI
abirc8010 Jan 11, 2025
07be90b
Merge branch 'develop' into fix/message-box-UI
abirc8010 Jan 11, 2025
3899db9
Merge branch 'develop' into fix/message-box-UI
abirc8010 Jan 11, 2025
786109a
Merge branch 'develop' into fix/message-box-UI
abirc8010 Jan 14, 2025
e75ce2a
Place popoverMenu icon to the extreme right
abirc8010 Jan 14, 2025
9ed4ae0
Merge branch 'develop' into fix/message-box-UI
abirc8010 Jan 27, 2025
dd832fc
Merge branch 'develop' into fix/message-box-UI
abirc8010 Jan 27, 2025
7d2f141
Merge branch 'develop' into fix/message-box-UI
abirc8010 Jan 27, 2025
d34f6ef
Merge branch 'develop' into fix/message-box-UI
abirc8010 Jan 27, 2025
ac55f74
Merge branch 'develop' into fix/message-box-UI
abirc8010 Jan 27, 2025
2c123e3
Merge branch 'develop' into fix/message-box-UI
abirc8010 Jan 27, 2025
29b8481
feat: Add 'Cancel Recording' and 'Finish Recording' tooltips for audi…
dhairyashiil Jan 27, 2025
439f7cd
Merge branch 'develop' into fix/message-box-UI
abirc8010 Jan 27, 2025
b1edb03
fix message box width and minor UI issues for chatinput formatters
abirc8010 Jan 27, 2025
0ff4e98
remove redundant tooltip
abirc8010 Jan 27, 2025
56ef1f6
remove audio from pop over menu
abirc8010 Jan 28, 2025
8d9a555
run prettier
abirc8010 Jan 28, 2025
f4cd266
Merge branch 'develop' into fix/message-box-UI
abirc8010 Jan 30, 2025
fd3b616
fix audio issue
abirc8010 Jan 30, 2025
de84394
change font size for chat input
abirc8010 Jan 30, 2025
6e6b235
Merge branch 'develop' into fix/message-box-UI
abirc8010 Jan 30, 2025
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
15 changes: 13 additions & 2 deletions packages/react/src/views/ChatInput/AudioMessageRecorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import useMessageStore from '../../store/messageStore';
import { getCommonRecorderStyles } from './ChatInput.styles';
import useAttachmentWindowStore from '../../store/attachmentwindow';

const AudioMessageRecorder = ({ disabled }) => {
const AudioMessageRecorder = (props) => {
const { disabled, displayName, popOverItemStyles } = props;
const videoRef = useRef(null);
const { theme } = useTheme();
const styles = getCommonRecorderStyles(theme);
Expand Down Expand Up @@ -136,7 +137,17 @@ const AudioMessageRecorder = ({ disabled }) => {
}, [isRecorded, file]);

if (state === 'idle') {
return (
return displayName ? (
<Box
key="audio"
css={popOverItemStyles}
onClick={handleRecordButtonClick}
disabled={disabled}
>
<Icon name="mic" size="1rem" />
<span>{displayName}</span>
</Box>
) : (
<Tooltip text="Audio Message" position="top">
<ActionButton
ghost
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/views/ChatInput/ChatInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ const ChatInput = ({ scrollToBottom }) => {
disabled={!isUserAuthenticated || !canSendMsg || isRecordingMessage}
placeholder={
isUserAuthenticated && canSendMsg
? `Message #${channelInfo.name}`
? `Message ${channelInfo.name ? `#${channelInfo.name}` : ''}`
: isUserAuthenticated
? 'This room is read only'
: 'Sign in to chat'
Expand Down
31 changes: 26 additions & 5 deletions packages/react/src/views/ChatInput/ChatInput.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export const getChatInputStyles = (theme) => {
&.focused {
border: ${`1.5px solid ${theme.colors.ring}`};
}
@media (max-width: 500px) {
margin: 0;
width: 100%;
}
`,

editMessage: css`
Expand Down Expand Up @@ -80,10 +84,27 @@ export const getChatInputFormattingToolbarStyles = ({ theme, mode }) => {
position: relative;
gap: 0.1rem;
border-radius: 0 0 ${theme.radius} ${theme.radius};
@media (max-width: 383px) {
display: grid;
grid-template-columns: repeat(5, 0.2fr);
}
`,
popOverStyles: css`
position: absolute;
bottom: 3rem;
left: 0;
width: 100%;
background: ${theme.colors.background};
box-shadow: 0 -8px 10px ${mode === 'light' ? darken(theme.colors.background, 0.1) : lighten(theme.colors.background, 1)};
border-radius: 8px;
padding: 1rem;
display: flex;
flex-direction: column;
align-items: flex-start;
z-index: 1300;
`,
popOverItemStyles: css`
display: flex;
gap: 0.5rem;
align-items: center;
cursor: pointer;
padding: 0.5rem;
`,
};
return styles;
Expand All @@ -101,8 +122,8 @@ export const getCommonRecorderStyles = (theme) => {
`,

controller: css`
display: flex;
gap: 0.15rem;
display: inline-flex;
`,

timer: css`
Expand Down
Loading
Loading