Skip to content

Commit

Permalink
fix/lint-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
umangutkarsh committed Feb 17, 2024
1 parent 17c9a2b commit 248e0bc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
8 changes: 4 additions & 4 deletions packages/react/src/components/ChatInput/ChatInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
useUserStore,
useMessageStore,
loginModalStore,
useChannelStore
useChannelStore,
} from '../../store';
import ChatInputFormattingToolbar from './ChatInputFormattingToolbar';
import useAttachmentWindowStore from '../../store/attachmentwindow';
Expand Down Expand Up @@ -87,7 +87,6 @@ const ChatInput = ({ scrollToBottom }) => {
(state) => state.setIsLoginModalOpen
);
const isChannelPrivate = useChannelStore((state) => state.isChannelPrivate);
const setIsChannelPrivate = useChannelStore((state) => state.setIsChannelPrivate);

const {
editMessage,
Expand Down Expand Up @@ -217,7 +216,9 @@ const ChatInput = ({ scrollToBottom }) => {
};
const getAllChannelMembers = useCallback(async () => {
try {
const channelMembers = await RCInstance.getChannelMembers(isChannelPrivate);
const channelMembers = await RCInstance.getChannelMembers(
isChannelPrivate
);
setRoomMembers(channelMembers.members);
} catch (e) {
console.error(e);
Expand Down Expand Up @@ -279,7 +280,6 @@ const ChatInput = ({ scrollToBottom }) => {
tokens[firstTokenIdx] += ' ';
const newMessageString = tokens.join(' ');
messageRef.current.value = newMessageString;
messageRef.current.selectionStart = messageRef.current.selectionEnd = tokens[firstTokenIdx].length;

messageRef.current.focus();
setFilteredCommands([]);
Expand Down
10 changes: 5 additions & 5 deletions packages/react/src/components/CommandList/CommandsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/* eslint-disable jsx-a11y/click-events-have-key-events */
import React, { useEffect } from 'react';
import { css } from '@emotion/react';
import PropTypes from 'prop-types';
import { Box } from '../Box';
import useComponentOverrides from '../../theme/useComponentOverrides';
import PropTypes from 'prop-types';

function CommandsList({
className = '',
Expand Down Expand Up @@ -42,10 +42,10 @@ function CommandsList({

const listItemStyle = css`
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
padding-left: 0;
display: flex;
justify-content: space-between;
align-items: center;
padding-left: 0;
padding-right: 2px;
&:hover {
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/components/RoomMembers/RoomMember.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const RoomMembers = ({ members }) => {
const roles = userInfo && userInfo.roles ? userInfo.roles : [];
const isAdmin = roles.includes('admin');


const [inviteData, setInviteData] = useState(null);

if (showInvite) return <InviteMembers inviteData={inviteData} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ const InviteMembers = ({ inviteData }) => {
const dispatchToastMessage = useToastBarDispatch();

const copyToClipboard = () => {
navigator.clipboard.writeText(inviteData.url)
navigator.clipboard
.writeText(inviteData.url)
.then(() => {
dispatchToastMessage({
type: 'success',
message: 'Copied to clipboard'
message: 'Copied to clipboard',
});
})
.catch((error) => {
console.error('Error copying to clipboard:', error);
});
};


return (
<Box style={{ padding: '16px' }} className={classes.modal}>
<Box
Expand Down Expand Up @@ -68,7 +68,9 @@ const InviteMembers = ({ inviteData }) => {
margin-bottom: 10px;
`}
>
<span><b>Invite Link</b></span>
<span>
<b>Invite Link</b>
</span>
<ActionButton onClick={copyToClipboard} ghost size="small">
<Icon name="copy" size="1.25rem" />
</ActionButton>
Expand Down

0 comments on commit 248e0bc

Please sign in to comment.