Skip to content

Commit 511c5f2

Browse files
authored
fix: remove channel constants - isAdmin, isOwner and isModerator (#2778)
* fix: sender and receiver message theme colors * fix: remove channel constants - isAdmin, isOwner and isModerator
1 parent bf52846 commit 511c5f2

File tree

3 files changed

+0
-32
lines changed

3 files changed

+0
-32
lines changed

package/src/components/Channel/Channel.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -764,17 +764,6 @@ const ChannelWithContext = <
764764

765765
useAppStateListener(undefined, handleAppBackground);
766766

767-
/**
768-
* CHANNEL CONSTANTS
769-
*/
770-
const isAdmin = client?.user?.role === 'admin' || channel?.state.membership.role === 'admin';
771-
772-
const isModerator =
773-
channel?.state.membership.role === 'channel_moderator' ||
774-
channel?.state.membership.role === 'moderator';
775-
776-
const isOwner = channel?.state.membership.role === 'owner';
777-
778767
/**
779768
* CHANNEL METHODS
780769
*/
@@ -2156,10 +2145,7 @@ const ChannelWithContext = <
21562145
!!(clientChannelConfig?.commands || [])?.some((command) => command.name === 'giphy'),
21572146
hideDateSeparators,
21582147
hideStickyDateHeader,
2159-
isAdmin,
21602148
isChannelActive: shouldSyncChannel,
2161-
isModerator,
2162-
isOwner,
21632149
lastRead,
21642150
loadChannelAroundMessage,
21652151
loading,

package/src/components/Channel/hooks/useCreateChannelContext.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ export const useCreateChannelContext = <
1515
giphyEnabled,
1616
hideDateSeparators,
1717
hideStickyDateHeader,
18-
isAdmin,
1918
isChannelActive,
20-
isModerator,
21-
isOwner,
2219
lastRead,
2320
loadChannelAroundMessage,
2421
loading,
@@ -58,10 +55,7 @@ export const useCreateChannelContext = <
5855
giphyEnabled,
5956
hideDateSeparators,
6057
hideStickyDateHeader,
61-
isAdmin,
6258
isChannelActive,
63-
isModerator,
64-
isOwner,
6559
lastRead,
6660
loadChannelAroundMessage,
6761
loading,

package/src/contexts/channelContext/ChannelContext.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,6 @@ export type ChannelContextValue<
5959
*/
6060
hideDateSeparators: boolean;
6161
hideStickyDateHeader: boolean;
62-
/**
63-
* Returns true if the current user has admin privileges
64-
*/
65-
isAdmin: boolean;
66-
/**
67-
* Returns true if the current user is a moderator
68-
*/
69-
isModerator: boolean;
70-
/**
71-
* Returns true if the current user is a owner
72-
*/
73-
isOwner: boolean;
7462
/**
7563
* Loads channel around a specific message
7664
*

0 commit comments

Comments
 (0)