Skip to content

Commit

Permalink
feat(uikit): added queryCreator prop to OpenChannelMutedParticipantsF…
Browse files Browse the repository at this point in the history
…ragment
  • Loading branch information
bang9 committed Apr 27, 2023
1 parent 16e1e4c commit 0e7c462
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type React from 'react';

import type { UseUserListOptions } from '@sendbird/uikit-chat-hooks';
import type { SendbirdOpenChannel, SendbirdRestrictedUser } from '@sendbird/uikit-utils';

import type { CommonComponent } from '../../types';
Expand All @@ -9,6 +10,7 @@ export type OpenChannelMutedParticipantsProps = {
channel: SendbirdOpenChannel;
onPressHeaderLeft: OpenChannelMutedParticipantsProps['Header']['onPressHeaderLeft'];
renderUser?: OpenChannelMutedParticipantsProps['List']['renderUser'];
queryCreator?: UseUserListOptions<SendbirdRestrictedUser>['queryCreator'];
};
Header: {
onPressHeaderLeft: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ const createOpenChannelMutedParticipantsFragment = (
): OpenChannelMutedParticipantsFragment => {
const OpenChannelMutedParticipantsModule = createOpenChannelMutedParticipantsModule(initModule);

return ({ onPressHeaderLeft = NOOP, channel, renderUser }) => {
return ({ onPressHeaderLeft = NOOP, channel, renderUser, queryCreator }) => {
const handlerId = useUniqHandlerId('OpenChannelMutedParticipants');

const { STRINGS } = useLocalization();
const { sdk, currentUser } = useSendbirdChat();
const { openMenu } = useActionMenu();

const { users, deleteUser, upsertUser, loading, refresh, error, next } = useUserList(sdk, {
queryCreator: () => channel.createMutedUserListQuery({ limit: 20 }),
queryCreator: queryCreator ?? (() => channel.createMutedUserListQuery({ limit: 20 })),
});

useChannelHandler(
Expand Down

0 comments on commit 0e7c462

Please sign in to comment.