Skip to content

Commit

Permalink
Other ESLint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arnautov-anton committed Jan 24, 2025
1 parent 15ef32f commit 5275661
Show file tree
Hide file tree
Showing 26 changed files with 59 additions and 59 deletions.
2 changes: 1 addition & 1 deletion src/components/Attachment/AttachmentContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ export const VoiceRecordingContainer = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>({
attachment,
VoiceRecording = DefaultVoiceRecording,
isQuoted,
VoiceRecording = DefaultVoiceRecording,
}: RenderAttachmentProps<StreamChatGenerics>) => (
<AttachmentWithinContainer attachment={attachment} componentType='voiceRecording'>
<div className='str-chat__attachment'>
Expand Down
10 changes: 5 additions & 5 deletions src/components/Channel/hooks/useCreateChannelStateContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ export const useCreateChannelStateContext = <
channel,
channelCapabilitiesArray = [],
channelConfig,
channelUnreadUiState,
debounceURLEnrichmentMs,
dragAndDropWindow,
enrichURLForPreview,
giphyVersion,
error,
findURLFn,
giphyVersion,
hasMore,
hasMoreNewer,
imageAttachmentSizeHandler,
suppressAutoscroll,
highlightedMessageId,
imageAttachmentSizeHandler,
loading,
loadingMore,
maxNumberOfFiles,
Expand All @@ -44,14 +44,14 @@ export const useCreateChannelStateContext = <
read = {},
shouldGenerateVideoThumbnail,
skipMessageDataMemoization,
suppressAutoscroll,
thread,
threadHasMore,
threadLoadingMore,
threadMessages = [],
channelUnreadUiState,
videoAttachmentSizeHandler,
watcherCount,
watcher_count,
watcherCount,
watchers,
} = value;

Expand Down
2 changes: 1 addition & 1 deletion src/components/ChannelHeader/ChannelHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export const ChannelHeader = <
) => {
const {
Avatar = DefaultAvatar,
MenuIcon = DefaultMenuIcon,
image: overrideImage,
live,
MenuIcon = DefaultMenuIcon,
title: overrideTitle,
} = props;

Expand Down
4 changes: 2 additions & 2 deletions src/components/ChannelList/ChannelList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,18 @@ const UnMemoizedChannelList = <SCG extends DefaultStreamChatGenerics = DefaultSt
) => {
const {
additionalChannelSearchProps,
Avatar = DefaultAvatar,
allowNewMessagesFromUnfilteredChannels = true,
Avatar = DefaultAvatar,
channelRenderFilterFn,
ChannelSearch = DefaultChannelSearch,
customActiveChannel,
customQueryChannels,
EmptyStateIndicator = DefaultEmptyStateIndicator,
filters = {},
getLatestMessagePreview,
List = ChannelListMessenger,
LoadingErrorIndicator = NullComponent,
LoadingIndicator = LoadingChannels,
List = ChannelListMessenger,
lockChannelOrder = false,
onAddedToChannel,
onChannelDeleted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export function useSelectedChannelState<SCG extends ExtendableGenerics, O>(_: {
}): O | undefined;
export function useSelectedChannelState<SCG extends ExtendableGenerics, O>({
channel,
stateChangeEventKeys = ['all'],
selector,
stateChangeEventKeys = ['all'],
}: {
selector: (channel: Channel<SCG>) => O;
channel?: Channel<SCG>;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ChannelPreview/ChannelPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ export const ChannelPreview = <
) => {
const {
channel,
Preview = ChannelPreviewMessenger,
channelUpdateCount,
getLatestMessagePreview = defaultGetLatestMessagePreview,
Preview = ChannelPreviewMessenger,
} = props;
const {
channel: activeChannel,
Expand Down
4 changes: 2 additions & 2 deletions src/components/ChannelSearch/ChannelSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ const UnMemoizedChannelSearch = <
SearchBar = DefaultSearchBar,
SearchEmpty,
SearchInput = DefaultSearchInput,
SearchLoading,
SearchInputIcon,
SearchLoading,
SearchResultItem,
SearchResultsList,
SearchResultsHeader,
SearchResultsList,
...channelSearchParams
} = props;

Expand Down
4 changes: 2 additions & 2 deletions src/components/ChannelSearch/SearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,11 @@ export const SearchResults = <
const {
popupResults,
results,
searching,
SearchEmpty = DefaultSearchEmpty,
SearchResultsHeader = DefaultSearchResultsHeader,
searching,
SearchLoading,
SearchResultItem = DefaultSearchResultItem,
SearchResultsHeader = DefaultSearchResultsHeader,
SearchResultsList = DefaultSearchResultsList,
selectResult,
} = props;
Expand Down
2 changes: 1 addition & 1 deletion src/components/EventComponent/EventComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const UnMemoizedEventComponent = <
>(
props: EventComponentProps<StreamChatGenerics>,
) => {
const { calendar, calendarFormats, format, Avatar = DefaultAvatar, message } = props;
const { Avatar = DefaultAvatar, calendar, calendarFormats, format, message } = props;

const { t, tDateTimeParser } = useTranslationContext('EventComponent');
const { created_at = '', event, text, type } = message;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Gallery/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const ImageComponent = <
>(
props: ImageProps<StreamChatGenerics>,
) => {
const { dimensions = {}, fallback, image_url, thumb_url, innerRef, previewUrl, style } = props;
const { dimensions = {}, fallback, image_url, innerRef, previewUrl, style, thumb_url } = props;

const [modalIsOpen, setModalIsOpen] = useState(false);
const { BaseImage = DefaultBaseImage, ModalGallery = DefaultModalGallery } =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ export type InfiniteScrollPaginatorProps = React.ComponentProps<'div'> & {
export const InfiniteScrollPaginator = (props: PropsWithChildren<InfiniteScrollPaginatorProps>) => {
const {
children,
className,
listenToScroll,
loadNextOnScrollToBottom,
loadNextOnScrollToTop,
threshold = DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD,
useCapture = false,
className,
...componentProps
} = props;

Expand Down
4 changes: 2 additions & 2 deletions src/components/Message/MessageText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ const UnMemoizedMessageTextComponent = <
const messageTextToRender =
message.i18n?.[`${userLanguage}_text` as `${TranslationLanguages}_text`] || message.text;

// eslint-disable-next-line react-hooks/exhaustive-deps
const messageText = useMemo(
() => renderText(messageTextToRender, message.mentioned_users),
[message.mentioned_users, messageTextToRender],
[message.mentioned_users, messageTextToRender, renderText],
);

const wrapperClass = customWrapperClass || 'str-chat__message-text';
Expand Down
6 changes: 3 additions & 3 deletions src/components/Message/__tests__/MessageSimple.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ const retrySendMessageMock = jest.fn();
const removeMessageMock = jest.fn();

async function renderMessageSimple({
message,
props = {},
channelConfigOverrides = { replies: true },
channelCapabilities = { 'send-reaction': true },
channelConfigOverrides = { replies: true },
components = {},
message,
props = {},
renderer = render,
}) {
const channel = generateChannel({
Expand Down
4 changes: 2 additions & 2 deletions src/components/Message/__tests__/MessageText.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ function generateAliceMessage(messageOptions) {
}

async function renderMessageText({
customProps = {},
channelCapabilitiesOverrides = {},
channelConfigOverrides = {},
customProps = {},
renderer = render,
channelCapabilitiesOverrides = {},
} = {}) {
const client = await getTestClientWithUser(alice);
const channel = generateChannel({
Expand Down
2 changes: 1 addition & 1 deletion src/components/Message/hooks/useMessageTextStreaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const DEFAULT_RENDERING_LETTER_COUNT = 2;
export const useMessageTextStreaming = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>({
streamingLetterIntervalMs = DEFAULT_LETTER_INTERVAL,
renderingLetterCount = DEFAULT_RENDERING_LETTER_COUNT,
streamingLetterIntervalMs = DEFAULT_LETTER_INTERVAL,
text,
}: UseMessageTextStreamingProps<StreamChatGenerics>): { streamedMessageText: string } => {
const [streamedMessageText, setStreamedMessageText] = useState<string>(text);
Expand Down
4 changes: 2 additions & 2 deletions src/components/MessageInput/MessageInputFlat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ export const MessageInputFlat = <
} = useMessageInputContext<StreamChatGenerics>('MessageInputFlat');

const {
AudioRecorder = DefaultAudioRecorder,
AttachmentPreviewList = DefaultAttachmentPreviewList,
AttachmentSelector = message ? SimpleAttachmentSelector : DefaultAttachmentSelector,
AudioRecorder = DefaultAudioRecorder,
CooldownTimer = DefaultCooldownTimer,
EmojiPicker,
LinkPreviewList = DefaultLinkPreviewList,
QuotedMessagePreview = DefaultQuotedMessagePreview,
RecordingPermissionDeniedNotification = DefaultRecordingPermissionDeniedNotification,
SendButton = DefaultSendButton,
StartRecordingAudioButton = DefaultStartRecordingAudioButton,
StopAIGenerationButton: StopAIGenerationButtonOverride,
EmojiPicker,
} = useComponentContext<StreamChatGenerics>('MessageInputFlat');
const {
acceptedFiles = [],
Expand Down
4 changes: 2 additions & 2 deletions src/components/MessageInput/__tests__/LinkPreviewList.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ const ChatContextOverrider = ({ children, contextOverrides }) => {
const makeRenderFn =
(InputComponent) =>
async ({
messageInputProps = {},
channelProps = {},
chatContextOverrides = {},
client = chatClient,
messageContextOverrides = {},
messageActionsBoxProps = {},
messageContextOverrides = {},
messageInputProps = {},
} = {}) => {
let renderResult;
await act(() => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/MessageInput/__tests__/MessageInput.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ function dropFile(file, formElement) {
const makeRenderFn =
(InputComponent) =>
async ({
channelProps = {},
channelData = [],
channelProps = {},
chatContextOverrides = {},
customChannel,
customClient,
customUser,
messageInputProps = {},
messageContextOverrides = {},
messageActionsBoxProps = {},
messageContextOverrides = {},
messageInputProps = {},
} = {}) => {
let channel = customChannel;
let client = customClient;
Expand Down
28 changes: 14 additions & 14 deletions src/components/MessageList/MessageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,36 +60,36 @@ const MessageListWithContext = <
channelUnreadUiState,
disableDateSeparator = false,
groupStyles,
hasMoreNewer = false,
headerPosition,
hideDeletedMessages = false,
hideNewMessageSeparator = false,
highlightedMessageId,
internalInfiniteScrollProps: {
threshold: loadMoreScrollThreshold = DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD,
...restInternalInfiniteScrollProps
} = {},
jumpToLatestMessage = () => Promise.resolve(),
loadMore: loadMoreCallback,
loadMoreNewer: loadMoreNewerCallback, // @deprecated in favor of `channelCapabilities` - TODO: remove in next major release
maxTimeBetweenGroupedMessages,
messageActions = Object.keys(MESSAGE_ACTIONS),
messageLimit = DEFAULT_NEXT_CHANNEL_PAGE_SIZE,
messages = [],
notifications,
noGroupByUser = false,
pinPermissions = defaultPinPermissions, // @deprecated in favor of `channelCapabilities` - TODO: remove in next major release
returnAllReadData = false,
threadList = false,
unsafeHTML = false,
headerPosition,
notifications,
pinPermissions = defaultPinPermissions,
reactionDetailsSort,
read,
renderMessages = defaultRenderMessages,
returnAllReadData = false,
reviewProcessedMessage,
messageLimit = DEFAULT_NEXT_CHANNEL_PAGE_SIZE,
loadMore: loadMoreCallback,
loadMoreNewer: loadMoreNewerCallback,
hasMoreNewer = false,
reactionDetailsSort,
showUnreadNotificationAlways,
sortReactionDetails,
sortReactions,
suppressAutoscroll,
highlightedMessageId,
jumpToLatestMessage = () => Promise.resolve(),
threadList = false,
unsafeHTML = false,
} = props;

const [listElement, setListElement] = React.useState<HTMLDivElement | null>(null);
Expand All @@ -100,11 +100,11 @@ const MessageListWithContext = <
const {
EmptyStateIndicator = DefaultEmptyStateIndicator,
LoadingIndicator = DefaultLoadingIndicator,
MessageListMainPanel = DefaultMessageListMainPanel,
MessageListNotifications = DefaultMessageListNotifications,
MessageNotification = DefaultMessageNotification,
TypingIndicator = DefaultTypingIndicator,
UnreadMessagesNotification = DefaultUnreadMessagesNotification,
MessageListMainPanel = DefaultMessageListMainPanel,
} = useComponentContext<StreamChatGenerics>('MessageList');

const { hasNewMessages, isMessageListScrolledToBottom, onScroll, scrollToBottom, wrapperRect } =
Expand Down
6 changes: 3 additions & 3 deletions src/components/MessageList/VirtualizedMessageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ const VirtualizedMessageListWithContext = <
openThread,
// TODO: refactor to scrollSeekPlaceHolderConfiguration and components.ScrollSeekPlaceholder, like the Virtuoso Component
overscan = 0,
reactionDetailsSort,
read,
returnAllReadData = false,
reviewProcessedMessage,
Expand All @@ -217,7 +218,6 @@ const VirtualizedMessageListWithContext = <
separateGiphyPreview = false,
shouldGroupByUser = false,
showUnreadNotificationAlways,
reactionDetailsSort,
sortReactionDetails,
sortReactions,
stickToBottomScrollBehavior = 'smooth',
Expand All @@ -235,14 +235,14 @@ const VirtualizedMessageListWithContext = <
const {
DateSeparator = DefaultDateSeparator,
GiphyPreviewMessage = DefaultGiphyPreviewMessage,
MessageListMainPanel = DefaultMessageListMainPanel,
MessageListNotifications = DefaultMessageListNotifications,
MessageNotification = DefaultMessageNotification,
MessageSystem = DefaultMessageSystem,
MessageListMainPanel = DefaultMessageListMainPanel,
TypingIndicator,
UnreadMessagesNotification = DefaultUnreadMessagesNotification,
UnreadMessagesSeparator = DefaultUnreadMessagesSeparator,
VirtualMessage: MessageUIComponentFromContext = MessageSimple,
TypingIndicator,
} = useComponentContext<StreamChatGenerics>('VirtualizedMessageList');
const MessageUIComponent = MessageUIComponentFromProps || MessageUIComponentFromContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ export const useScrollLocationLogic = <
params: UseScrollLocationLogicParams<StreamChatGenerics>,
) => {
const {
hasMoreNewer,
listElement,
loadMoreScrollThreshold,
messages = [],
scrolledUpThreshold = 200,
hasMoreNewer,
suppressAutoscroll,
listElement,
} = params;

const [hasNewMessages, setHasNewMessages] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Poll/PollContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const pollStateSelectorPollContent = <
export const PollContent = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>() => {
const { PollHeader = DefaultPollHeader, PollActions = DefaultPollActions } =
const { PollActions = DefaultPollActions, PollHeader = DefaultPollHeader } =
useComponentContext<StreamChatGenerics>();
const { poll } = usePollContext<StreamChatGenerics>();
const { is_closed } = useStateStore(poll.state, pollStateSelectorPollContent);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Thread/Thread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ const ThreadInner = <
const { closeThread, loadMoreThread } = useChannelActionContext<StreamChatGenerics>('Thread');
const { customClasses } = useChatContext<StreamChatGenerics>('Thread');
const {
ThreadInput: ContextInput,
Message: ContextMessage,
ThreadHead = DefaultThreadHead,
ThreadHeader = DefaultThreadHeader,
ThreadInput: ContextInput,
VirtualMessage,
} = useComponentContext<StreamChatGenerics>('Thread');

Expand Down
Loading

0 comments on commit 5275661

Please sign in to comment.