@sendbird/uikit-react
Version:
Sendbird UIKit for React: A feature-rich and customizable chat UI kit with messaging, channel management, and user authentication.
60 lines (57 loc) • 3.44 kB
JavaScript
import React__default, { useState, useContext } from 'react';
import { L as LocalizationContext } from '../../chunks/bundle-DxLnjDoJ.js';
import { L as Label, a as LabelTypography, b as LabelColors } from '../../chunks/bundle-FZ_FdxZT.js';
import TextButton from '../../ui/TextButton.js';
import ChannelAvatar from '../../ui/OpenChannelAvatar.js';
import EditDetails from './EditDetailsModal.js';
import { useOpenChannelSettingsContext } from '../context.js';
import { u as useSendbird } from '../../chunks/bundle-BnaoVUUl.js';
import '../../chunks/bundle-DlZj_j5B.js';
import '../../chunks/bundle-Dhutxl0X.js';
import '../../chunks/bundle-D89Qj0P4.js';
import '../../chunks/bundle-Bv6iXkjg.js';
import '../../chunks/bundle-Dgt7lb2O.js';
import '../../ui/ImageRenderer.js';
import '../../chunks/bundle-CaW4IP0_.js';
import '../../chunks/bundle-h43SVTxb.js';
import '../../ui/Icon.js';
import '../../chunks/bundle-DGOBflIQ.js';
import '../../chunks/bundle-D9lZlE3H.js';
import '../../chunks/bundle-BDItDVZl.js';
import 'react-dom';
import '../../chunks/bundle-DWJPyrDa.js';
import '../../ui/IconButton.js';
import '../../ui/Button.js';
import '../../chunks/bundle-CSjCAZib.js';
import '../../ui/Input.js';
import '@sendbird/chat/openChannel';
import '../../chunks/bundle-tDk7wyaM.js';
import '../../chunks/bundle-C1jTnXNH.js';
import '../../chunks/bundle-C8kxBudB.js';
import '@sendbird/chat';
import '@sendbird/chat/groupChannel';
function ChannelProfile() {
var _a, _b;
var state = useSendbird().state;
var disabled = !((_a = state === null || state === void 0 ? void 0 : state.config) === null || _a === void 0 ? void 0 : _a.isOnline);
var theme = (_b = state === null || state === void 0 ? void 0 : state.config) === null || _b === void 0 ? void 0 : _b.theme;
var channel = useOpenChannelSettingsContext().channel;
var title = channel === null || channel === void 0 ? void 0 : channel.name;
var _c = useState(false), showModal = _c[0], setShowModal = _c[1];
var stringSet = useContext(LocalizationContext).stringSet;
return (React__default.createElement("div", { className: "sendbird-openchannel-profile" },
React__default.createElement("div", { className: "sendbird-openchannel-profile--inner" },
React__default.createElement("div", { className: "sendbird-openchannel-profile__avatar" },
React__default.createElement(ChannelAvatar, { channel: channel, theme: theme, height: 80, width: 80 })),
React__default.createElement(Label, { type: LabelTypography.SUBTITLE_2, color: LabelColors.ONBACKGROUND_1, className: "sendbird-openchannel-profile__title" }, title || stringSet.OPEN_CHANNEL_SETTINGS__NO_TITLE),
React__default.createElement(TextButton, { disabled: disabled, className: "sendbird-openchannel-profile__edit", onClick: function () {
if (disabled) {
return;
}
setShowModal(true);
}, disableUnderline: true },
React__default.createElement(Label, { type: LabelTypography.BUTTON_1, color: disabled ? LabelColors.ONBACKGROUND_2 : LabelColors.PRIMARY }, stringSet.CHANNEL_SETTING__PROFILE__EDIT)),
showModal && (React__default.createElement(EditDetails, { onCancel: function () { return setShowModal(false); } })))));
}
export { ChannelProfile as default };
//# sourceMappingURL=OpenChannelProfile.js.map