Skip to content

Commit 0a7dc0f

Browse files
MartinCupelaarnautov-anton
authored andcommitted
style: fix lint issues
1 parent c84f5f8 commit 0a7dc0f

File tree

8 files changed

+25
-26
lines changed

8 files changed

+25
-26
lines changed

src/components/AutoCompleteTextarea/TextareaX.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export const TextareaX = <
115115
disableMentions,
116116
grow = true,
117117
handleSubmit,
118+
innerRef,
118119
maxRows = 10,
119120
minChar = 1,
120121
movePopupAsYouType = false,
@@ -128,12 +129,11 @@ export const TextareaX = <
128129
shouldSubmit,
129130
showCommandsList,
130131
showMentionsList,
131-
SuggestionItem,
132132
// @ts-ignore
133+
SuggestionItem,
133134
SuggestionList = DefaultSuggestionList,
134135
trigger,
135136
value: initialValue = '',
136-
innerRef,
137137
...restProps
138138
} = props;
139139

@@ -794,11 +794,11 @@ export const TextareaX = <
794794

795795
return (
796796
<div
797-
ref={setDropdownRef}
798797
className={clsx(
799798
'str-chat__suggestion-list-container',
800799
restProps.dropdownClassName,
801800
)}
801+
ref={setDropdownRef}
802802
style={restProps.dropdownStyle}
803803
>
804804
{/*// @ts-ignore*/}
@@ -822,6 +822,7 @@ export const TextareaX = <
822822
{..._cleanUpProps()}
823823
{...restProps.additionalTextareaProps}
824824
className={clsx('rta__textarea', restProps.className)}
825+
defaultValue={undefined}
825826
maxRows={grow ? maxRows : 1}
826827
onBlur={(e) => {
827828
_onClickAndBlurHandler(e);
@@ -863,7 +864,6 @@ export const TextareaX = <
863864
}}
864865
style={restProps.style}
865866
value={state.value}
866-
defaultValue={undefined}
867867
/>
868868
</div>
869869
);

src/components/Channel/Channel.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ import { getChannel } from '../../utils';
7070

7171
import type {
7272
APIErrorResponse,
73-
Channel as StreamChannel,
7473
ChannelAPIResponse,
7574
ChannelMemberResponse,
7675
ChannelQueryOptions,
@@ -81,6 +80,7 @@ import type {
8180
Message,
8281
MessageResponse,
8382
SendMessageAPIResponse,
83+
Channel as StreamChannel,
8484
StreamChat,
8585
Thread,
8686
UpdatedMessage,
@@ -1180,7 +1180,7 @@ const ChannelInner = <
11801180
event?.preventDefault();
11811181
// todo: revisit how to open a thread
11821182

1183-
let threadInstance = client.threads.threadsById[message.id];
1183+
const threadInstance = client.threads.threadsById[message.id];
11841184
if (threadInstance) {
11851185
dispatch({ channel, message, threadInstance, type: 'openThread' });
11861186
return;

src/components/MessageInput/MessageDraftSynchronizer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ export const MessageDraftSynchronizer = <
6565
findAndEnqueueURLsToEnrich,
6666
lastChange,
6767
linkPreviews,
68-
message: editedMessage,
6968
mentioned_users,
69+
message: editedMessage,
7070
numberOfUploads,
7171
parent,
7272
setComposerState,

src/components/MessageInput/MessageInputFlat.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import { SendButton as DefaultSendButton } from './SendButton';
1111
import { StopAIGenerationButton as DefaultStopAIGenerationButton } from './StopAIGenerationButton';
1212
import {
1313
AudioRecorder as DefaultAudioRecorder,
14-
RecordingPermission,
1514
RecordingPermissionDeniedNotification as DefaultRecordingPermissionDeniedNotification,
1615
StartRecordingAudioButton as DefaultStartRecordingAudioButton,
16+
RecordingPermission,
1717
} from '../MediaRecorder';
1818
import {
1919
QuotedMessagePreview as DefaultQuotedMessagePreview,

src/components/MessageInput/QuotedMessagePreview.tsx

+10-10
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,23 @@ export const QuotedMessagePreview = <
7373
messageComposerStateStoreSelector,
7474
);
7575

76-
const quotedMessageText = useMemo(() => {
77-
return (
76+
const quotedMessageText = useMemo(
77+
() =>
7878
quotedMessage?.i18n?.[`${userLanguage}_text` as `${TranslationLanguages}_text`] ||
79-
quotedMessage?.text
80-
);
81-
}, [quotedMessage]);
79+
quotedMessage?.text,
80+
[quotedMessage],
81+
);
8282

8383
const renderedText = useMemo(
8484
() => renderText(quotedMessageText, quotedMessage?.mentioned_users),
8585
[quotedMessage?.mentioned_users, quotedMessageText, renderText],
8686
);
8787

88-
const quotedMessageAttachments = useMemo(() => {
89-
return quotedMessage?.attachments?.length
90-
? quotedMessage.attachments.slice(0, 1)
91-
: [];
92-
}, [quotedMessage]);
88+
const quotedMessageAttachments = useMemo(
89+
() =>
90+
quotedMessage?.attachments?.length ? quotedMessage.attachments.slice(0, 1) : [],
91+
[quotedMessage],
92+
);
9393

9494
const poll = quotedMessage?.poll_id && client.polls.fromState(quotedMessage.poll_id);
9595

src/components/MessageInput/hooks/useCreateMessageInputContext.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ export const useCreateMessageInputContext = <
5858
publishTypingEvent,
5959
recordingController,
6060
removeAttachments,
61-
setCooldownRemaining,
6261
setComposerState,
62+
setCooldownRemaining,
6363
setText,
6464
shouldSubmit,
6565
showCommandsList,

src/components/TextAreaComposer/TextAreaComposer.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ export const TextAreaComposer = <
237237
>
238238
{!isComposing && !!suggestions && (
239239
<div
240-
ref={setSuggestionListContainer}
241240
className={clsx('str-chat__suggestion-list-container', dropdownClassName)}
241+
ref={setSuggestionListContainer}
242242
>
243243
<AutocompleteSuggestionList
244244
className={listClassName}
@@ -250,11 +250,12 @@ export const TextAreaComposer = <
250250
<Textarea
251251
{...restProps}
252252
aria-label={cooldownRemaining ? t('Slow Mode ON') : placeholder}
253-
data-testid='message-input'
254253
className={clsx(
255254
'rta__textarea',
256255
'str-chat__textarea__textarea str-chat__message-textarea',
257256
)}
257+
data-testid='message-input'
258+
defaultValue={undefined}
258259
disabled={disabled || !!cooldownRemaining}
259260
maxRows={grow ? maxRows : 1}
260261
onBlur={clickAndBlurHandler}
@@ -272,7 +273,6 @@ export const TextAreaComposer = <
272273
textareaRef.current = ref;
273274
}}
274275
value={text}
275-
defaultValue={undefined}
276276
/>
277277
</div>
278278
);

src/mock-builders/generator/messageDraft.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ export const generateMessageDraft = <
77
>({
88
channel_cid,
99
...customMsgDraft
10-
}: Partial<DraftResponse<StreamChatGenerics>>) => {
11-
return {
10+
}: Partial<DraftResponse<StreamChatGenerics>>) =>
11+
({
1212
channel_cid,
1313
created_at: new Date().toISOString(),
1414
message: generateMessage(),
1515
...customMsgDraft,
16-
} as DraftResponse<StreamChatGenerics>;
17-
};
16+
}) as DraftResponse<StreamChatGenerics>;

0 commit comments

Comments
 (0)