Skip to content

Commit 991b070

Browse files
MartinCupelaarnautov-anton
authored andcommitted
style: fix lint issues
1 parent 7780290 commit 991b070

File tree

8 files changed

+24
-25
lines changed

8 files changed

+24
-25
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ const ChannelInner = <V extends CustomTrigger = CustomTrigger>(
11471147
event?.preventDefault();
11481148
// todo: revisit how to open a thread
11491149

1150-
let threadInstance = client.threads.threadsById[message.id];
1150+
const threadInstance = client.threads.threadsById[message.id];
11511151
if (threadInstance) {
11521152
dispatch({ channel, message, threadInstance, type: 'openThread' });
11531153
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
@@ -65,23 +65,23 @@ export const QuotedMessagePreview = ({
6565
messageComposerStateStoreSelector,
6666
);
6767

68-
const quotedMessageText = useMemo(() => {
69-
return (
68+
const quotedMessageText = useMemo(
69+
() =>
7070
quotedMessage?.i18n?.[`${userLanguage}_text` as `${TranslationLanguages}_text`] ||
71-
quotedMessage?.text
72-
);
73-
}, [quotedMessage]);
71+
quotedMessage?.text,
72+
[quotedMessage],
73+
);
7474

7575
const renderedText = useMemo(
7676
() => renderText(quotedMessageText, quotedMessage.mentioned_users),
7777
[quotedMessage.mentioned_users, quotedMessageText, renderText],
7878
);
7979

80-
const quotedMessageAttachments = useMemo(() => {
81-
return quotedMessage?.attachments?.length
82-
? quotedMessage.attachments.slice(0, 1)
83-
: [];
84-
}, [quotedMessage]);
80+
const quotedMessageAttachments = useMemo(
81+
() =>
82+
quotedMessage?.attachments?.length ? quotedMessage.attachments.slice(0, 1) : [],
83+
[quotedMessage],
84+
);
8585

8686
const poll = quotedMessage?.poll_id && client.polls.fromState(quotedMessage.poll_id);
8787

src/components/MessageInput/hooks/useCreateMessageInputContext.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ export const useCreateMessageInputContext = <V extends CustomTrigger = CustomTri
5555
publishTypingEvent,
5656
recordingController,
5757
removeAttachments,
58-
setCooldownRemaining,
5958
setComposerState,
59+
setCooldownRemaining,
6060
setText,
6161
shouldSubmit,
6262
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)