Skip to content

Commit 3dcaab9

Browse files
authored
fix: Remove the duplicated UserProfileProvider from OpenChannelSettings (#821)
### Issue There has been UserProfileProvider in both places in the OpenChannelSettings module 1. OpenChannelSettingsProvider 2. OpenChannelSettingsUI We applied the `renderUserProfile` props to the UserProfileProvider under the OpenChannelSettingsProvider However, the other one under the OpenChannelSettingsUI blocked it. ### Fix * remove the duplicated UserProfileProvider from OpenChannelSettings to apply the `renderUserProfile` props
1 parent 128c10b commit 3dcaab9

File tree

1 file changed

+32
-35
lines changed
  • src/modules/OpenChannelSettings/components/OpenChannelSettingsUI

1 file changed

+32
-35
lines changed

src/modules/OpenChannelSettings/components/OpenChannelSettingsUI/index.tsx

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import './open-channel-ui.scss';
33
import React, { useContext } from 'react';
44
import useSendbirdStateContext from '../../../../hooks/useSendbirdStateContext';
55
import { useOpenChannelSettingsContext } from '../../context/OpenChannelSettingsProvider';
6-
import { UserProfileProvider } from '../../../../lib/UserProfileContext';
76
import { LocalizationContext } from '../../../../lib/LocalizationContext';
87

98
import InvalidChannel from '../InvalidChannel';
@@ -45,42 +44,40 @@ const OpenChannelUI: React.FC<OpenChannelUIProps> = ({
4544
);
4645
}
4746
return (
48-
<UserProfileProvider isOpenChannel>
49-
<div className='sendbird-openchannel-settings'>
50-
{
51-
channel?.isOperator(user) && (
52-
renderOperatorUI?.() || (
53-
<OperatorUI />
54-
)
47+
<div className='sendbird-openchannel-settings'>
48+
{
49+
channel?.isOperator(user) && (
50+
renderOperatorUI?.() || (
51+
<OperatorUI />
5552
)
56-
}
57-
{
58-
!(channel?.isOperator(user)) && (
59-
<div className="sendbird-openchannel-settings__participant">
60-
<div className="sendbird-openchannel-settings__header">
61-
<Label type={LabelTypography.H_2} color={LabelColors.ONBACKGROUND_1}>
62-
{stringSet.OPEN_CHANNEL_SETTINGS__PARTICIPANTS_TITLE}
63-
</Label>
64-
<Icon
65-
type={IconTypes.CLOSE}
66-
className="sendbird-openchannel-settings__close-icon"
67-
height="24px"
68-
width="24px"
69-
onClick={() => {
70-
onCloseClick();
71-
}}
72-
/>
73-
</div>
74-
{
75-
renderParticipantList?.() || (
76-
<ParticipantUI />
77-
)
78-
}
53+
)
54+
}
55+
{
56+
!(channel?.isOperator(user)) && (
57+
<div className="sendbird-openchannel-settings__participant">
58+
<div className="sendbird-openchannel-settings__header">
59+
<Label type={LabelTypography.H_2} color={LabelColors.ONBACKGROUND_1}>
60+
{stringSet.OPEN_CHANNEL_SETTINGS__PARTICIPANTS_TITLE}
61+
</Label>
62+
<Icon
63+
type={IconTypes.CLOSE}
64+
className="sendbird-openchannel-settings__close-icon"
65+
height="24px"
66+
width="24px"
67+
onClick={() => {
68+
onCloseClick();
69+
}}
70+
/>
7971
</div>
80-
)
81-
}
82-
</div>
83-
</UserProfileProvider>
72+
{
73+
renderParticipantList?.() || (
74+
<ParticipantUI />
75+
)
76+
}
77+
</div>
78+
)
79+
}
80+
</div>
8481
);
8582
};
8683

0 commit comments

Comments
 (0)