@sendbird/uikit-react-native-foundation 3.1.2 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/assets/icon/icon-audio-off-filled.png +0 -0
- package/lib/commonjs/assets/icon/icon-audio-off-filled@2x.png +0 -0
- package/lib/commonjs/assets/icon/icon-audio-off-filled@3x.png +0 -0
- package/lib/commonjs/assets/icon/icon-audio-off.png +0 -0
- package/lib/commonjs/assets/icon/icon-audio-off@2x.png +0 -0
- package/lib/commonjs/assets/icon/icon-audio-off@3x.png +0 -0
- package/lib/commonjs/assets/icon/icon-audio-on-filled.png +0 -0
- package/lib/commonjs/assets/icon/icon-audio-on-filled@2x.png +0 -0
- package/lib/commonjs/assets/icon/icon-audio-on-filled@3x.png +0 -0
- package/lib/commonjs/assets/icon/icon-audio-on.png +0 -0
- package/lib/commonjs/assets/icon/icon-audio-on@2x.png +0 -0
- package/lib/commonjs/assets/icon/icon-audio-on@3x.png +0 -0
- package/lib/commonjs/assets/icon/icon-pause.png +0 -0
- package/lib/commonjs/assets/icon/icon-pause@2x.png +0 -0
- package/lib/commonjs/assets/icon/icon-pause@3x.png +0 -0
- package/lib/commonjs/assets/icon/icon-recording.png +0 -0
- package/lib/commonjs/assets/icon/icon-recording@2x.png +0 -0
- package/lib/commonjs/assets/icon/icon-recording@3x.png +0 -0
- package/lib/commonjs/assets/icon/icon-stop.png +0 -0
- package/lib/commonjs/assets/icon/icon-stop@2x.png +0 -0
- package/lib/commonjs/assets/icon/icon-stop@3x.png +0 -0
- package/lib/commonjs/assets/icon/index.js +7 -0
- package/lib/commonjs/assets/icon/index.js.map +1 -1
- package/lib/commonjs/components/Box/index.js +2 -2
- package/lib/commonjs/components/Box/index.js.map +1 -1
- package/lib/commonjs/components/Icon/index.js +4 -3
- package/lib/commonjs/components/Icon/index.js.map +1 -1
- package/lib/commonjs/components/Image/FastImageInternal.js.map +1 -1
- package/lib/commonjs/components/Image/index.js.map +1 -1
- package/lib/commonjs/components/Modal/index.js +1 -1
- package/lib/commonjs/components/Modal/index.js.map +1 -1
- package/lib/commonjs/components/PressBox/index.js.map +1 -1
- package/lib/commonjs/components/ProgressBar/index.js +72 -0
- package/lib/commonjs/components/ProgressBar/index.js.map +1 -0
- package/lib/commonjs/components/RegexText/index.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/styles/HeaderStyleContext.js.map +1 -1
- package/lib/commonjs/styles/createScaleFactor.js +5 -4
- package/lib/commonjs/styles/createScaleFactor.js.map +1 -1
- package/lib/commonjs/theme/DarkUIKitTheme.js +80 -36
- package/lib/commonjs/theme/DarkUIKitTheme.js.map +1 -1
- package/lib/commonjs/theme/LightUIKitTheme.js +80 -36
- package/lib/commonjs/theme/LightUIKitTheme.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/ui/Avatar/index.js +4 -3
- package/lib/commonjs/ui/Avatar/index.js.map +1 -1
- package/lib/commonjs/ui/BottomSheet/index.js.map +1 -1
- package/lib/commonjs/ui/Dialog/DialogSheet.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.voice.js +108 -0
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.voice.js.map +1 -0
- package/lib/commonjs/ui/GroupChannelMessage/Message.unknown.js +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.unknown.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/index.js +2 -0
- package/lib/commonjs/ui/GroupChannelMessage/index.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/commonjs/ui/Header/index.js +5 -4
- package/lib/commonjs/ui/Header/index.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/MessageContainer.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelPreview/index.js.map +1 -1
- package/lib/commonjs/ui/ProfileCard/index.js.map +1 -1
- package/lib/module/assets/icon/icon-audio-off-filled.png +0 -0
- package/lib/module/assets/icon/icon-audio-off-filled@2x.png +0 -0
- package/lib/module/assets/icon/icon-audio-off-filled@3x.png +0 -0
- package/lib/module/assets/icon/icon-audio-off.png +0 -0
- package/lib/module/assets/icon/icon-audio-off@2x.png +0 -0
- package/lib/module/assets/icon/icon-audio-off@3x.png +0 -0
- package/lib/module/assets/icon/icon-audio-on-filled.png +0 -0
- package/lib/module/assets/icon/icon-audio-on-filled@2x.png +0 -0
- package/lib/module/assets/icon/icon-audio-on-filled@3x.png +0 -0
- package/lib/module/assets/icon/icon-audio-on.png +0 -0
- package/lib/module/assets/icon/icon-audio-on@2x.png +0 -0
- package/lib/module/assets/icon/icon-audio-on@3x.png +0 -0
- package/lib/module/assets/icon/icon-pause.png +0 -0
- package/lib/module/assets/icon/icon-pause@2x.png +0 -0
- package/lib/module/assets/icon/icon-pause@3x.png +0 -0
- package/lib/module/assets/icon/icon-recording.png +0 -0
- package/lib/module/assets/icon/icon-recording@2x.png +0 -0
- package/lib/module/assets/icon/icon-recording@3x.png +0 -0
- package/lib/module/assets/icon/icon-stop.png +0 -0
- package/lib/module/assets/icon/icon-stop@2x.png +0 -0
- package/lib/module/assets/icon/icon-stop@3x.png +0 -0
- package/lib/module/assets/icon/index.js +7 -0
- package/lib/module/assets/icon/index.js.map +1 -1
- package/lib/module/components/Box/index.js +2 -2
- package/lib/module/components/Box/index.js.map +1 -1
- package/lib/module/components/Icon/index.js +4 -3
- package/lib/module/components/Icon/index.js.map +1 -1
- package/lib/module/components/Image/FastImageInternal.js.map +1 -1
- package/lib/module/components/Image/index.js.map +1 -1
- package/lib/module/components/Modal/index.js +1 -1
- package/lib/module/components/Modal/index.js.map +1 -1
- package/lib/module/components/PressBox/index.js.map +1 -1
- package/lib/module/components/ProgressBar/index.js +62 -0
- package/lib/module/components/ProgressBar/index.js.map +1 -0
- package/lib/module/components/RegexText/index.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/styles/HeaderStyleContext.js.map +1 -1
- package/lib/module/styles/createScaleFactor.js +5 -4
- package/lib/module/styles/createScaleFactor.js.map +1 -1
- package/lib/module/theme/DarkUIKitTheme.js +80 -36
- package/lib/module/theme/DarkUIKitTheme.js.map +1 -1
- package/lib/module/theme/LightUIKitTheme.js +80 -36
- package/lib/module/theme/LightUIKitTheme.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/ui/Avatar/index.js +4 -3
- package/lib/module/ui/Avatar/index.js.map +1 -1
- package/lib/module/ui/BottomSheet/index.js.map +1 -1
- package/lib/module/ui/Dialog/DialogSheet.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.file.voice.js +98 -0
- package/lib/module/ui/GroupChannelMessage/Message.file.voice.js.map +1 -0
- package/lib/module/ui/GroupChannelMessage/Message.unknown.js +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.unknown.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/index.js +2 -0
- package/lib/module/ui/GroupChannelMessage/index.js.map +1 -1
- package/lib/module/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/module/ui/Header/index.js +5 -4
- package/lib/module/ui/Header/index.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/MessageContainer.js.map +1 -1
- package/lib/module/ui/OpenChannelPreview/index.js.map +1 -1
- package/lib/module/ui/ProfileCard/index.js.map +1 -1
- package/lib/typescript/src/assets/icon/index.d.ts +7 -0
- package/lib/typescript/src/components/Box/index.d.ts +2 -1
- package/lib/typescript/src/components/Divider/index.d.ts +2 -1
- package/lib/typescript/src/components/Icon/index.d.ts +76 -7
- package/lib/typescript/src/components/Image/FastImageInternal.d.ts +2 -1
- package/lib/typescript/src/components/Image/index.d.ts +2 -1
- package/lib/typescript/src/components/ImageWithPlaceholder/index.d.ts +2 -1
- package/lib/typescript/src/components/Modal/index.d.ts +2 -1
- package/lib/typescript/src/components/PressBox/index.d.ts +2 -1
- package/lib/typescript/src/components/ProgressBar/index.d.ts +12 -0
- package/lib/typescript/src/components/RegexText/index.d.ts +3 -2
- package/lib/typescript/src/components/Switch/index.d.ts +1 -1
- package/lib/typescript/src/components/Text/index.d.ts +2 -1
- package/lib/typescript/src/components/VideoThumbnail/index.d.ts +2 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/styles/HeaderStyleContext.d.ts +2 -2
- package/lib/typescript/src/styles/createScaleFactor.d.ts +4 -5
- package/lib/typescript/src/theme/UIKitThemeProvider.d.ts +1 -1
- package/lib/typescript/src/types.d.ts +11 -7
- package/lib/typescript/src/ui/ActionMenu/index.d.ts +2 -1
- package/lib/typescript/src/ui/Alert/index.d.ts +2 -1
- package/lib/typescript/src/ui/Avatar/AvatarGroup.d.ts +1 -1
- package/lib/typescript/src/ui/Avatar/AvatarIcon.d.ts +2 -1
- package/lib/typescript/src/ui/Avatar/index.d.ts +16 -8
- package/lib/typescript/src/ui/Badge/index.d.ts +2 -1
- package/lib/typescript/src/ui/BottomSheet/index.d.ts +3 -2
- package/lib/typescript/src/ui/Button/index.d.ts +1 -1
- package/lib/typescript/src/ui/ChannelFrozenBanner/index.d.ts +2 -1
- package/lib/typescript/src/ui/Dialog/DialogBox.d.ts +1 -1
- package/lib/typescript/src/ui/Dialog/DialogSheet.d.ts +3 -3
- package/lib/typescript/src/ui/Dialog/index.d.ts +1 -1
- package/lib/typescript/src/ui/GroupChannelMessage/Message.admin.d.ts +2 -1
- package/lib/typescript/src/ui/GroupChannelMessage/Message.file.d.ts +2 -1
- package/lib/typescript/src/ui/GroupChannelMessage/Message.file.image.d.ts +2 -1
- package/lib/typescript/src/ui/GroupChannelMessage/Message.file.video.d.ts +2 -1
- package/lib/typescript/src/ui/GroupChannelMessage/Message.file.voice.d.ts +14 -0
- package/lib/typescript/src/ui/GroupChannelMessage/Message.unknown.d.ts +2 -1
- package/lib/typescript/src/ui/GroupChannelMessage/Message.user.d.ts +2 -1
- package/lib/typescript/src/ui/GroupChannelMessage/Message.user.og.d.ts +2 -1
- package/lib/typescript/src/ui/GroupChannelMessage/MessageBubbleWithText.d.ts +2 -1
- package/lib/typescript/src/ui/GroupChannelMessage/MessageContainer.d.ts +4 -3
- package/lib/typescript/src/ui/GroupChannelMessage/MessageOpenGraph.d.ts +2 -1
- package/lib/typescript/src/ui/GroupChannelMessage/index.d.ts +43 -7
- package/lib/typescript/src/ui/GroupChannelPreview/index.d.ts +3 -3
- package/lib/typescript/src/ui/Header/index.d.ts +8 -12
- package/lib/typescript/src/ui/LoadingSpinner/index.d.ts +2 -1
- package/lib/typescript/src/ui/MenuBar/index.d.ts +1 -1
- package/lib/typescript/src/ui/OpenChannelMessage/Message.admin.d.ts +2 -1
- package/lib/typescript/src/ui/OpenChannelMessage/Message.file.d.ts +2 -1
- package/lib/typescript/src/ui/OpenChannelMessage/Message.file.image.d.ts +2 -1
- package/lib/typescript/src/ui/OpenChannelMessage/Message.file.video.d.ts +2 -1
- package/lib/typescript/src/ui/OpenChannelMessage/Message.unknown.d.ts +2 -1
- package/lib/typescript/src/ui/OpenChannelMessage/Message.user.d.ts +2 -1
- package/lib/typescript/src/ui/OpenChannelMessage/Message.user.og.d.ts +2 -1
- package/lib/typescript/src/ui/OpenChannelMessage/MessageContainer.d.ts +2 -1
- package/lib/typescript/src/ui/OpenChannelMessage/index.d.ts +7 -7
- package/lib/typescript/src/ui/OpenChannelPreview/index.d.ts +2 -2
- package/lib/typescript/src/ui/OutlinedButton/index.d.ts +2 -1
- package/lib/typescript/src/ui/Placeholder/index.d.ts +2 -1
- package/lib/typescript/src/ui/ProfileCard/index.d.ts +3 -2
- package/lib/typescript/src/ui/Prompt/index.d.ts +2 -1
- package/lib/typescript/src/ui/Toast/index.d.ts +2 -2
- package/package.json +5 -9
- package/src/assets/icon/icon-audio-off-filled.png +0 -0
- package/src/assets/icon/icon-audio-off-filled@2x.png +0 -0
- package/src/assets/icon/icon-audio-off-filled@3x.png +0 -0
- package/src/assets/icon/icon-audio-off.png +0 -0
- package/src/assets/icon/icon-audio-off@2x.png +0 -0
- package/src/assets/icon/icon-audio-off@3x.png +0 -0
- package/src/assets/icon/icon-audio-on-filled.png +0 -0
- package/src/assets/icon/icon-audio-on-filled@2x.png +0 -0
- package/src/assets/icon/icon-audio-on-filled@3x.png +0 -0
- package/src/assets/icon/icon-audio-on.png +0 -0
- package/src/assets/icon/icon-audio-on@2x.png +0 -0
- package/src/assets/icon/icon-audio-on@3x.png +0 -0
- package/src/assets/icon/icon-pause.png +0 -0
- package/src/assets/icon/icon-pause@2x.png +0 -0
- package/src/assets/icon/icon-pause@3x.png +0 -0
- package/src/assets/icon/icon-recording.png +0 -0
- package/src/assets/icon/icon-recording@2x.png +0 -0
- package/src/assets/icon/icon-recording@3x.png +0 -0
- package/src/assets/icon/icon-stop.png +0 -0
- package/src/assets/icon/icon-stop@2x.png +0 -0
- package/src/assets/icon/icon-stop@3x.png +0 -0
- package/src/assets/icon/index.ts +7 -0
- package/src/components/Box/index.tsx +1 -1
- package/src/components/Icon/index.tsx +6 -7
- package/src/components/Image/FastImageInternal.tsx +3 -2
- package/src/components/Image/index.ts +2 -1
- package/src/components/Modal/index.tsx +1 -1
- package/src/components/PressBox/index.tsx +1 -0
- package/src/components/ProgressBar/index.tsx +72 -0
- package/src/components/RegexText/index.tsx +3 -3
- package/src/index.ts +1 -0
- package/src/styles/HeaderStyleContext.tsx +1 -1
- package/src/styles/createScaleFactor.ts +5 -5
- package/src/theme/DarkUIKitTheme.ts +80 -37
- package/src/theme/LightUIKitTheme.ts +80 -37
- package/src/types.ts +31 -7
- package/src/ui/Avatar/index.tsx +6 -14
- package/src/ui/BottomSheet/index.tsx +2 -2
- package/src/ui/Dialog/DialogSheet.tsx +2 -2
- package/src/ui/GroupChannelMessage/Message.file.voice.tsx +123 -0
- package/src/ui/GroupChannelMessage/Message.unknown.tsx +1 -1
- package/src/ui/GroupChannelMessage/index.ts +7 -0
- package/src/ui/GroupChannelPreview/index.tsx +2 -2
- package/src/ui/Header/index.tsx +8 -12
- package/src/ui/OpenChannelMessage/MessageContainer.tsx +1 -1
- package/src/ui/OpenChannelPreview/index.tsx +1 -1
- package/src/ui/ProfileCard/index.tsx +2 -2
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _uikitUtils = require("@sendbird/uikit-utils");
|
|
9
|
+
var _Box = _interopRequireDefault(require("../../components/Box"));
|
|
10
|
+
var _Icon = _interopRequireDefault(require("../../components/Icon"));
|
|
11
|
+
var _PressBox = _interopRequireDefault(require("../../components/PressBox"));
|
|
12
|
+
var _ProgressBar = _interopRequireDefault(require("../../components/ProgressBar"));
|
|
13
|
+
var _Text = _interopRequireDefault(require("../../components/Text"));
|
|
14
|
+
var _createStyleSheet = _interopRequireDefault(require("../../styles/createStyleSheet"));
|
|
15
|
+
var _useUIKitTheme = _interopRequireDefault(require("../../theme/useUIKitTheme"));
|
|
16
|
+
var _LoadingSpinner = _interopRequireDefault(require("../LoadingSpinner"));
|
|
17
|
+
var _MessageContainer = _interopRequireDefault(require("./MessageContainer"));
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
const VoiceFileMessage = props => {
|
|
22
|
+
const {
|
|
23
|
+
onLongPress,
|
|
24
|
+
variant = 'incoming',
|
|
25
|
+
onToggleVoiceMessage,
|
|
26
|
+
message,
|
|
27
|
+
durationMetaArrayKey = 'KEY_VOICE_MESSAGE_DURATION',
|
|
28
|
+
onUnmount
|
|
29
|
+
} = props;
|
|
30
|
+
const {
|
|
31
|
+
colors
|
|
32
|
+
} = (0, _useUIKitTheme.default)();
|
|
33
|
+
const [state, setState] = (0, _react.useState)(() => {
|
|
34
|
+
var _meta$value;
|
|
35
|
+
const meta = message.metaArrays.find(it => it.key === durationMetaArrayKey);
|
|
36
|
+
const value = meta === null || meta === void 0 ? void 0 : (_meta$value = meta.value) === null || _meta$value === void 0 ? void 0 : _meta$value[0];
|
|
37
|
+
const initialDuration = value ? parseInt(value, 10) : 0;
|
|
38
|
+
return {
|
|
39
|
+
status: 'paused',
|
|
40
|
+
currentTime: 0,
|
|
41
|
+
duration: initialDuration
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
(0, _react.useEffect)(() => {
|
|
45
|
+
return () => {
|
|
46
|
+
onUnmount();
|
|
47
|
+
};
|
|
48
|
+
}, []);
|
|
49
|
+
const uiColors = colors.ui.groupChannelMessage[variant];
|
|
50
|
+
const remainingTime = state.duration - state.currentTime;
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement(_MessageContainer.default, props, /*#__PURE__*/_react.default.createElement(_Box.default, {
|
|
52
|
+
style: styles.container,
|
|
53
|
+
backgroundColor: uiColors.enabled.background
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement(_PressBox.default, {
|
|
55
|
+
onPress: () => onToggleVoiceMessage === null || onToggleVoiceMessage === void 0 ? void 0 : onToggleVoiceMessage(state, setState),
|
|
56
|
+
onLongPress: onLongPress
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement(_ProgressBar.default, {
|
|
58
|
+
current: state.currentTime,
|
|
59
|
+
total: state.duration,
|
|
60
|
+
style: {
|
|
61
|
+
minWidth: 136,
|
|
62
|
+
height: 44
|
|
63
|
+
},
|
|
64
|
+
trackColor: uiColors.enabled.voiceProgressTrack,
|
|
65
|
+
overlay: /*#__PURE__*/_react.default.createElement(_Box.default, {
|
|
66
|
+
flex: 1,
|
|
67
|
+
flexDirection: 'row',
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
justifyContent: 'space-between',
|
|
70
|
+
paddingHorizontal: 12
|
|
71
|
+
}, state.status === 'preparing' ? /*#__PURE__*/_react.default.createElement(_LoadingSpinner.default, {
|
|
72
|
+
size: 24,
|
|
73
|
+
color: uiColors.enabled.voiceSpinner
|
|
74
|
+
}) : /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
75
|
+
size: 16,
|
|
76
|
+
containerStyle: {
|
|
77
|
+
backgroundColor: uiColors.enabled.voiceActionIconBackground,
|
|
78
|
+
padding: 6,
|
|
79
|
+
borderRadius: 16
|
|
80
|
+
},
|
|
81
|
+
icon: state.status === 'paused' ? 'play' : 'pause'
|
|
82
|
+
}), /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
83
|
+
body3: true,
|
|
84
|
+
style: {
|
|
85
|
+
lineHeight: undefined,
|
|
86
|
+
marginLeft: 6,
|
|
87
|
+
opacity: 0.88
|
|
88
|
+
},
|
|
89
|
+
color: uiColors.enabled.textVoicePlaytime
|
|
90
|
+
}, (0, _uikitUtils.millsToMSS)(state.currentTime === 0 ? state.duration : remainingTime)))
|
|
91
|
+
})), props.children));
|
|
92
|
+
};
|
|
93
|
+
const styles = (0, _createStyleSheet.default)({
|
|
94
|
+
container: {
|
|
95
|
+
borderRadius: 16,
|
|
96
|
+
overflow: 'hidden'
|
|
97
|
+
},
|
|
98
|
+
image: {
|
|
99
|
+
maxWidth: 240,
|
|
100
|
+
width: 240,
|
|
101
|
+
height: 160,
|
|
102
|
+
borderRadius: 16,
|
|
103
|
+
overflow: 'hidden'
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
var _default = VoiceFileMessage;
|
|
107
|
+
exports.default = _default;
|
|
108
|
+
//# sourceMappingURL=Message.file.voice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_uikitUtils","_Box","_interopRequireDefault","_Icon","_PressBox","_ProgressBar","_Text","_createStyleSheet","_useUIKitTheme","_LoadingSpinner","_MessageContainer","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","VoiceFileMessage","props","onLongPress","variant","onToggleVoiceMessage","message","durationMetaArrayKey","onUnmount","colors","useUIKitTheme","state","setState","useState","_meta$value","meta","metaArrays","find","it","value","initialDuration","parseInt","status","currentTime","duration","useEffect","uiColors","ui","groupChannelMessage","remainingTime","createElement","style","styles","container","backgroundColor","enabled","background","onPress","current","total","minWidth","height","trackColor","voiceProgressTrack","overlay","flex","flexDirection","alignItems","justifyContent","paddingHorizontal","size","color","voiceSpinner","containerStyle","voiceActionIconBackground","padding","borderRadius","icon","body3","lineHeight","undefined","marginLeft","opacity","textVoicePlaytime","millsToMSS","children","createStyleSheet","overflow","image","maxWidth","width","_default","exports"],"sources":["Message.file.voice.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport type { SendbirdFileMessage } from '@sendbird/uikit-utils';\nimport { millsToMSS } from '@sendbird/uikit-utils';\n\nimport Box from '../../components/Box';\nimport Icon from '../../components/Icon';\nimport PressBox from '../../components/PressBox';\nimport ProgressBar from '../../components/ProgressBar';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport LoadingSpinner from '../LoadingSpinner';\nimport MessageContainer from './MessageContainer';\nimport type { GroupChannelMessageProps } from './index';\n\nexport type VoiceFileMessageState = {\n status: 'preparing' | 'playing' | 'paused';\n currentTime: number;\n duration: number;\n};\n\ntype Props = GroupChannelMessageProps<\n SendbirdFileMessage,\n {\n durationMetaArrayKey?: string;\n onUnmount: () => void;\n }\n>;\nconst VoiceFileMessage = (props: Props) => {\n const {\n onLongPress,\n variant = 'incoming',\n onToggleVoiceMessage,\n message,\n durationMetaArrayKey = 'KEY_VOICE_MESSAGE_DURATION',\n onUnmount,\n } = props;\n\n const { colors } = useUIKitTheme();\n\n const [state, setState] = useState<VoiceFileMessageState>(() => {\n const meta = message.metaArrays.find((it) => it.key === durationMetaArrayKey);\n const value = meta?.value?.[0];\n const initialDuration = value ? parseInt(value, 10) : 0;\n return {\n status: 'paused',\n currentTime: 0,\n duration: initialDuration,\n };\n });\n\n useEffect(() => {\n return () => {\n onUnmount();\n };\n }, []);\n\n const uiColors = colors.ui.groupChannelMessage[variant];\n const remainingTime = state.duration - state.currentTime;\n\n return (\n <MessageContainer {...props}>\n <Box style={styles.container} backgroundColor={uiColors.enabled.background}>\n <PressBox onPress={() => onToggleVoiceMessage?.(state, setState)} onLongPress={onLongPress}>\n <ProgressBar\n current={state.currentTime}\n total={state.duration}\n style={{ minWidth: 136, height: 44 }}\n trackColor={uiColors.enabled.voiceProgressTrack}\n overlay={\n <Box\n flex={1}\n flexDirection={'row'}\n alignItems={'center'}\n justifyContent={'space-between'}\n paddingHorizontal={12}\n >\n {state.status === 'preparing' ? (\n <LoadingSpinner size={24} color={uiColors.enabled.voiceSpinner} />\n ) : (\n <Icon\n size={16}\n containerStyle={{\n backgroundColor: uiColors.enabled.voiceActionIconBackground,\n padding: 6,\n borderRadius: 16,\n }}\n icon={state.status === 'paused' ? 'play' : 'pause'}\n />\n )}\n <Text\n body3\n style={{ lineHeight: undefined, marginLeft: 6, opacity: 0.88 }}\n color={uiColors.enabled.textVoicePlaytime}\n >\n {millsToMSS(state.currentTime === 0 ? state.duration : remainingTime)}\n </Text>\n </Box>\n }\n />\n </PressBox>\n {props.children}\n </Box>\n </MessageContainer>\n );\n};\n\nconst styles = createStyleSheet({\n container: {\n borderRadius: 16,\n overflow: 'hidden',\n },\n image: {\n maxWidth: 240,\n width: 240,\n height: 160,\n borderRadius: 16,\n overflow: 'hidden',\n },\n});\n\nexport default VoiceFileMessage;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,IAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,KAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,SAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,YAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,KAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,iBAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,cAAA,GAAAN,sBAAA,CAAAH,OAAA;AACA,IAAAU,eAAA,GAAAP,sBAAA,CAAAH,OAAA;AACA,IAAAW,iBAAA,GAAAR,sBAAA,CAAAH,OAAA;AAAkD,SAAAG,uBAAAS,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAjB,wBAAAa,GAAA,E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K,CAAC,GAAGZ,KAAK,CAACa,QAAQ,GAAGK,aAAa,CAAC,CAChE;EAEV,EACD,CACO,EACV3B,KAAK,CAAC+D,QAAQ,CACX,CACW;AAEvB,CAAC;AAED,MAAMjC,MAAM,GAAG,IAAAkC,yBAAgB,EAAC;EAC9BjC,SAAS,EAAE;IACTuB,YAAY,EAAE,EAAE;IAChBW,QAAQ,EAAE;EACZ,CAAC;EACDC,KAAK,EAAE;IACLC,QAAQ,EAAE,GAAG;IACbC,KAAK,EAAE,GAAG;IACV7B,MAAM,EAAE,GAAG;IACXe,YAAY,EAAE,EAAE;IAChBW,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAAC,IAAAI,QAAA,GAEYtE,gBAAgB;AAAAuE,OAAA,CAAA3F,OAAA,GAAA0F,QAAA"}
|
|
@@ -19,7 +19,7 @@ const UnknownMessage = props => {
|
|
|
19
19
|
const {
|
|
20
20
|
colors
|
|
21
21
|
} = (0, _useUIKitTheme.default)();
|
|
22
|
-
const color = colors.ui.groupChannelMessage[
|
|
22
|
+
const color = colors.ui.groupChannelMessage[variant];
|
|
23
23
|
const titleColor = variant === 'incoming' ? colors.onBackground01 : colors.onBackgroundReverse01;
|
|
24
24
|
const descColor = variant === 'incoming' ? colors.onBackground02 : colors.onBackgroundReverse02;
|
|
25
25
|
return /*#__PURE__*/_react.default.createElement(_MessageContainer.default, props, /*#__PURE__*/_react.default.createElement(_PressBox.default, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_Box","_PressBox","_Text","_createStyleSheet","_useUIKitTheme","_MessageContainer","obj","__esModule","default","UnknownMessage","props","variant","colors","useUIKitTheme","color","ui","groupChannelMessage","titleColor","onBackground01","onBackgroundReverse01","descColor","onBackground02","onBackgroundReverse02","createElement","onPress","onLongPress","_ref","_props$strings","_props$strings2","pressed","style","styles","bubble","backgroundColor","background","enabled","body3","strings","unknownTitle","unknownDescription","createStyleSheet","paddingVertical","paddingHorizontal","borderRadius","_default","exports"],"sources":["Message.unknown.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { SendbirdMessage } from '@sendbird/uikit-utils';\n\nimport Box from '../../components/Box';\nimport PressBox from '../../components/PressBox';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport MessageContainer from './MessageContainer';\nimport type { GroupChannelMessageProps } from './index';\n\nconst UnknownMessage = (props: GroupChannelMessageProps<SendbirdMessage>) => {\n const { variant = 'incoming' } = props;\n\n const { colors } = useUIKitTheme();\n const color = colors.ui.groupChannelMessage[
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_Box","_PressBox","_Text","_createStyleSheet","_useUIKitTheme","_MessageContainer","obj","__esModule","default","UnknownMessage","props","variant","colors","useUIKitTheme","color","ui","groupChannelMessage","titleColor","onBackground01","onBackgroundReverse01","descColor","onBackground02","onBackgroundReverse02","createElement","onPress","onLongPress","_ref","_props$strings","_props$strings2","pressed","style","styles","bubble","backgroundColor","background","enabled","body3","strings","unknownTitle","unknownDescription","createStyleSheet","paddingVertical","paddingHorizontal","borderRadius","_default","exports"],"sources":["Message.unknown.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { SendbirdMessage } from '@sendbird/uikit-utils';\n\nimport Box from '../../components/Box';\nimport PressBox from '../../components/PressBox';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport MessageContainer from './MessageContainer';\nimport type { GroupChannelMessageProps } from './index';\n\nconst UnknownMessage = (props: GroupChannelMessageProps<SendbirdMessage>) => {\n const { variant = 'incoming' } = props;\n\n const { colors } = useUIKitTheme();\n const color = colors.ui.groupChannelMessage[variant];\n const titleColor = variant === 'incoming' ? colors.onBackground01 : colors.onBackgroundReverse01;\n const descColor = variant === 'incoming' ? colors.onBackground02 : colors.onBackgroundReverse02;\n\n return (\n <MessageContainer {...props}>\n <PressBox onPress={props.onPress} onLongPress={props.onLongPress}>\n {({ pressed }) => (\n <Box style={styles.bubble} backgroundColor={pressed ? color.pressed.background : color.enabled.background}>\n <Text body3 color={titleColor}>\n {props.strings?.unknownTitle ?? '(Unknown message type)'}\n </Text>\n <Text body3 color={descColor}>\n {props.strings?.unknownDescription ?? 'Cannot read this message.'}\n </Text>\n </Box>\n )}\n </PressBox>\n </MessageContainer>\n );\n};\n\nconst styles = createStyleSheet({\n bubble: {\n paddingVertical: 6,\n paddingHorizontal: 12,\n borderRadius: 16,\n },\n});\n\nexport default UnknownMessage;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,IAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,cAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,iBAAA,GAAAP,sBAAA,CAAAC,OAAA;AAAkD,SAAAD,uBAAAQ,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGlD,MAAMG,cAAc,GAAIC,KAAgD,IAAK;EAC3E,MAAM;IAAEC,OAAO,GAAG;EAAW,CAAC,GAAGD,KAAK;EAEtC,MAAM;IAAEE;EAAO,CAAC,GAAG,IAAAC,sBAAa,GAAE;EAClC,MAAMC,KAAK,GAAGF,MAAM,CAACG,EAAE,CAACC,mBAAmB,CAACL,OAAO,CAAC;EACpD,MAAMM,UAAU,GAAGN,OAAO,KAAK,UAAU,GAAGC,MAAM,CAACM,cAAc,GAAGN,MAAM,CAACO,qBAAqB;EAChG,MAAMC,SAAS,GAAGT,OAAO,KAAK,UAAU,GAAGC,MAAM,CAACS,cAAc,GAAGT,MAAM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Ac;AAAAoC,OAAA,CAAArC,OAAA,GAAAoC,QAAA"}
|
|
@@ -8,6 +8,7 @@ var _Message = _interopRequireDefault(require("./Message.admin"));
|
|
|
8
8
|
var _Message2 = _interopRequireDefault(require("./Message.file"));
|
|
9
9
|
var _MessageFile = _interopRequireDefault(require("./Message.file.image"));
|
|
10
10
|
var _MessageFile2 = _interopRequireDefault(require("./Message.file.video"));
|
|
11
|
+
var _MessageFile3 = _interopRequireDefault(require("./Message.file.voice"));
|
|
11
12
|
var _Message3 = _interopRequireDefault(require("./Message.unknown"));
|
|
12
13
|
var _Message4 = _interopRequireDefault(require("./Message.user"));
|
|
13
14
|
var _MessageUser = _interopRequireDefault(require("./Message.user.og"));
|
|
@@ -18,6 +19,7 @@ const GroupChannelMessage = {
|
|
|
18
19
|
File: _Message2.default,
|
|
19
20
|
ImageFile: _MessageFile.default,
|
|
20
21
|
VideoFile: _MessageFile2.default,
|
|
22
|
+
VoiceFile: _MessageFile3.default,
|
|
21
23
|
Admin: _Message.default,
|
|
22
24
|
Unknown: _Message3.default
|
|
23
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Message","_interopRequireDefault","require","_Message2","_MessageFile","_MessageFile2","_Message3","_Message4","_MessageUser","obj","__esModule","default","GroupChannelMessage","User","UserMessage","OpenGraphUser","File","FileMessage","ImageFile","ImageFileMessage","VideoFile","VideoFileMessage","Admin","AdminMessage","Unknown","UnknownMessage","_default","exports"],"sources":["index.ts"],"sourcesContent":["import type React from 'react';\n\nimport type { SendbirdGroupChannel, SendbirdMessage, SendbirdUser } from '@sendbird/uikit-utils';\n\nimport AdminMessage from './Message.admin';\nimport FileMessage from './Message.file';\nimport ImageFileMessage from './Message.file.image';\nimport VideoFileMessage from './Message.file.video';\nimport UnknownMessage from './Message.unknown';\nimport UserMessage from './Message.user';\nimport OpenGraphUser from './Message.user.og';\n\nexport type GroupChannelMessageProps<T extends SendbirdMessage, AdditionalProps = unknown> = {\n channel: SendbirdGroupChannel;\n message: T;\n variant?: 'outgoing' | 'incoming';\n strings?: {\n senderName?: string;\n sentDate?: string;\n edited?: string;\n fileName?: string;\n unknownTitle?: string;\n unknownDescription?: string;\n };\n\n children?: React.ReactNode;\n sendingStatus?: React.ReactNode;\n parentMessage?: React.ReactNode;\n\n groupedWithPrev: boolean;\n groupedWithNext: boolean;\n onPress?: () => void;\n onLongPress?: () => void;\n onPressAvatar?: () => void;\n onPressURL?: (url: string) => void;\n onPressMentionedUser?: (mentionedUser?: SendbirdUser) => void;\n} & AdditionalProps;\n\nconst GroupChannelMessage = {\n User: UserMessage,\n OpenGraphUser: OpenGraphUser,\n File: FileMessage,\n ImageFile: ImageFileMessage,\n VideoFile: VideoFileMessage,\n Admin: AdminMessage,\n Unknown: UnknownMessage,\n};\n\nexport default GroupChannelMessage;\n"],"mappings":";;;;;;AAIA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,aAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,
|
|
1
|
+
{"version":3,"names":["_Message","_interopRequireDefault","require","_Message2","_MessageFile","_MessageFile2","_MessageFile3","_Message3","_Message4","_MessageUser","obj","__esModule","default","GroupChannelMessage","User","UserMessage","OpenGraphUser","File","FileMessage","ImageFile","ImageFileMessage","VideoFile","VideoFileMessage","VoiceFile","VoiceFileMessage","Admin","AdminMessage","Unknown","UnknownMessage","_default","exports"],"sources":["index.ts"],"sourcesContent":["import type React from 'react';\n\nimport type { SendbirdGroupChannel, SendbirdMessage, SendbirdUser } from '@sendbird/uikit-utils';\n\nimport AdminMessage from './Message.admin';\nimport FileMessage from './Message.file';\nimport ImageFileMessage from './Message.file.image';\nimport VideoFileMessage from './Message.file.video';\nimport VoiceFileMessage from './Message.file.voice';\nimport type { VoiceFileMessageState } from './Message.file.voice';\nimport UnknownMessage from './Message.unknown';\nimport UserMessage from './Message.user';\nimport OpenGraphUser from './Message.user.og';\n\nexport type GroupChannelMessageProps<T extends SendbirdMessage, AdditionalProps = unknown> = {\n channel: SendbirdGroupChannel;\n message: T;\n variant?: 'outgoing' | 'incoming';\n strings?: {\n senderName?: string;\n sentDate?: string;\n edited?: string;\n fileName?: string;\n unknownTitle?: string;\n unknownDescription?: string;\n };\n\n children?: React.ReactNode;\n sendingStatus?: React.ReactNode;\n parentMessage?: React.ReactNode;\n\n groupedWithPrev: boolean;\n groupedWithNext: boolean;\n onPress?: () => void;\n onLongPress?: () => void;\n onPressAvatar?: () => void;\n onPressURL?: (url: string) => void;\n onPressMentionedUser?: (mentionedUser?: SendbirdUser) => void;\n onToggleVoiceMessage?: (\n state: VoiceFileMessageState,\n setState: React.Dispatch<React.SetStateAction<VoiceFileMessageState>>,\n ) => Promise<void>;\n} & AdditionalProps;\n\nconst GroupChannelMessage = {\n User: UserMessage,\n OpenGraphUser: OpenGraphUser,\n File: FileMessage,\n ImageFile: ImageFileMessage,\n VideoFile: VideoFileMessage,\n VoiceFile: VoiceFileMessage,\n Admin: AdminMessage,\n Unknown: UnknownMessage,\n};\n\nexport default GroupChannelMessage;\n"],"mappings":";;;;;;AAIA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,aAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,SAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,YAAA,GAAAR,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAS,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAgC9C,MAAMG,mBAAmB,GAAG;EAC1BC,IAAI,EAAEC,iBAAW;EACjBC,aAAa,EAAEA,oBAAa;EAC5BC,IAAI,EAAEC,iBAAW;EACjBC,SAAS,EAAEC,oBAAgB;EAC3BC,SAAS,EAAEC,qBAAgB;EAC3BC,SAAS,EAAEC,qBAAgB;EAC3BC,KAAK,EAAEC,gBAAY;EACnBC,OAAO,EAAEC;AACX,CAAC;AAAC,IAAAC,QAAA,GAEahB,mBAAmB;AAAAiB,OAAA,CAAAlB,OAAA,GAAAiB,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_uikitUtils","_Icon","_Image","_Text","_createStyleSheet","_useUIKitTheme","_Badge","obj","__esModule","default","GroupChannelPreview","_ref","customCover","coverUrl","memberCount","badgeCount","maxBadgeCount","body","bodyIcon","title","titleCaption","titleCaptionLeft","frozen","notificationOff","broadcast","mentioned","mentionTrigger","colors","useUIKitTheme","color","ui","groupChannelPreview","createElement","View","style","styles","container","backgroundColor","none","background","coverContainer","conditionChaining","Boolean","resizeMode","channelCover","coverBackground","source","uri","rightSection","rightTopSection","channelInfoContainer","size","icon","secondary","containerStyle","channelInfoBroadcast","numberOfLines","subtitle1","channelInfoTitle","textTitle","caption1","channelInfoMemberCount","primary","channelInfoFrozen","onBackground03","titleCaptionContainer","caption2","textTitleCaption","titleCaptionText","rightBottomSection","bodyWrapper","bodyIconBackground","body3","ellipsizeMode","bodyText","textBody","unreadContainer","h2","badge","unreadMention","count","maxCount","Separator","separator","_ref2","createStyleSheet","height","width","flexDirection","alignItems","justifyContent","marginLeft","marginRight","borderRadius","flex","paddingTop","paddingRight","marginBottom","flexShrink","marginTop","position","left","right","bottom","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport { conditionChaining } from '@sendbird/uikit-utils';\n\nimport Icon from '../../components/Icon';\nimport Image from '../../components/Image';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport Badge from '../Badge';\n\ntype Props = {\n customCover?: React.ReactElement;\n coverUrl: string;\n\n title: string;\n\n titleCaption: string;\n titleCaptionLeft?: React.ReactElement;\n\n bodyIcon?: keyof typeof Icon.Assets;\n body: string;\n\n memberCount?: number;\n badgeCount: number;\n maxBadgeCount?: number;\n\n frozen?: boolean;\n notificationOff?: boolean;\n broadcast?: boolean;\n mentioned?: boolean;\n mentionTrigger?: string;\n};\n\nconst GroupChannelPreview = ({\n customCover,\n coverUrl,\n memberCount,\n badgeCount,\n maxBadgeCount,\n body,\n bodyIcon,\n title,\n titleCaption,\n titleCaptionLeft,\n frozen,\n notificationOff,\n broadcast,\n mentioned,\n mentionTrigger = '@',\n}: Props) => {\n const { colors } = useUIKitTheme();\n const color = colors.ui.groupChannelPreview;\n\n return (\n <View style={[styles.container, { backgroundColor: color.default.none.background }]}>\n <View style={styles.coverContainer}>\n {conditionChaining(\n [Boolean(customCover)],\n [\n customCover,\n <Image\n resizeMode={'cover'}\n style={[styles.channelCover, { backgroundColor: color.default.none.coverBackground }]}\n source={{ uri: coverUrl }}\n />,\n ],\n )}\n </View>\n <View style={styles.rightSection}>\n <View style={styles.rightTopSection}>\n <View style={styles.channelInfoContainer}>\n {broadcast && (\n <Icon\n size={16}\n icon={'broadcast'}\n color={colors.secondary}\n containerStyle={styles.channelInfoBroadcast}\n />\n )}\n <Text numberOfLines={1} subtitle1 style={styles.channelInfoTitle} color={color.default.none.textTitle}>\n {title}\n </Text>\n {Boolean(memberCount) && (\n <Text caption1 style={styles.channelInfoMemberCount} color={color.default.none.memberCount}>\n {memberCount}\n </Text>\n )}\n {frozen && (\n <Icon size={16} icon={'freeze'} color={colors.primary} containerStyle={styles.channelInfoFrozen} />\n )}\n {notificationOff && <Icon size={16} icon={'notifications-off-filled'} color={colors.onBackground03} />}\n </View>\n <View style={styles.titleCaptionContainer}>\n {titleCaptionLeft}\n <Text caption2 color={color.default.none.textTitleCaption} style={styles.titleCaptionText}>\n {titleCaption}\n </Text>\n </View>\n </View>\n\n <View style={styles.rightBottomSection}>\n <View style={styles.body}>\n <View style={styles.bodyWrapper}>\n {bodyIcon && (\n <Icon\n size={18}\n icon={bodyIcon}\n color={color.default.none.bodyIcon}\n containerStyle={[\n styles.bodyIcon,\n { backgroundColor: colors.ui.groupChannelPreview.default.none.bodyIconBackground },\n ]}\n />\n )}\n <Text\n body3\n numberOfLines={1}\n ellipsizeMode={bodyIcon ? 'middle' : 'tail'}\n style={styles.bodyText}\n color={color.default.none.textBody}\n >\n {body}\n </Text>\n </View>\n </View>\n <View style={styles.unreadContainer}>\n {mentioned && (\n <Text h2 color={colors.ui.badge.default.none.background} style={styles.unreadMention}>\n {mentionTrigger}\n </Text>\n )}\n {badgeCount > 0 && <Badge count={badgeCount} maxCount={maxBadgeCount} />}\n </View>\n </View>\n <Separator color={color.default.none.separator} />\n </View>\n </View>\n );\n};\n\ntype SeparatorProps = { color: string };\nconst Separator = ({ color }: SeparatorProps) => <View style={[styles.separator, { backgroundColor: color }]} />;\n\nconst styles = createStyleSheet({\n container: {\n height: 76,\n width: '100%',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n },\n coverContainer: {\n marginLeft: 16,\n marginRight: 16,\n },\n channelCover: {\n width: 56,\n height: 56,\n borderRadius: 28,\n },\n rightSection: {\n flex: 1,\n paddingTop: 10,\n paddingRight: 16,\n },\n rightTopSection: {\n flexDirection: 'row',\n marginBottom: 4,\n },\n channelInfoContainer: {\n flex: 1,\n marginRight: 4,\n alignItems: 'center',\n flexDirection: 'row',\n },\n channelInfoBroadcast: {\n marginRight: 4,\n },\n channelInfoTitle: {\n flexShrink: 1,\n marginRight: 4,\n },\n channelInfoMemberCount: {\n paddingTop: 2,\n marginRight: 4,\n },\n channelInfoFrozen: {\n marginRight: 4,\n },\n titleCaptionContainer: {\n alignItems: 'flex-start',\n flexDirection: 'row',\n marginLeft: 4,\n },\n titleCaptionText: {\n marginTop: 2,\n },\n rightBottomSection: {\n flex: 1,\n height: '100%',\n flexDirection: 'row',\n },\n body: {\n marginRight: 4,\n flex: 1,\n flexDirection: 'row',\n alignItems: 'flex-start',\n },\n bodyWrapper: {\n flexDirection: 'row',\n alignItems: 'center',\n },\n bodyText: {\n flex: 1,\n },\n bodyIcon: {\n borderRadius: 8,\n width: 26,\n height: 26,\n marginRight: 4,\n },\n unreadContainer: {\n flexDirection: 'row',\n alignItems: 'flex-start',\n },\n unreadMention: {\n marginRight: 4,\n },\n separator: {\n position: 'absolute',\n left: 0,\n right: -16,\n bottom: 0,\n height: 1,\n },\n});\n\nexport default GroupChannelPreview;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,KAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,iBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,cAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,MAAA,GAAAT,sBAAA,CAAAC,OAAA;AAA6B,SAAAD,uBAAAU,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAyB7B,MAAMG,mBAAmB,GAAGC,IAAA,IAgBf;EAAA,IAhBgB;IAC3BC,WAAW;IACXC,QAAQ;IACRC,WAAW;IACXC,UAAU;IACVC,aAAa;IACbC,IAAI;IACJC,QAAQ;IACRC,KAAK;IACLC,YAAY;IACZC,gBAAgB;IAChBC,MAAM;IACNC,eAAe;IACfC,SAAS;IACTC,SAAS;IACTC,cAAc,GAAG;EACZ,C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aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd,CAAC;EACDV,aAAa,EAAE;IACba,WAAW,EAAE;EACf,CAAC;EACDT,SAAS,EAAE;IACTiB,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC,EAAE;IACVC,MAAM,EAAE,CAAC;IACTjB,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAAC,IAAAkB,QAAA,GAEY9F,mBAAmB;AAAA+F,OAAA,CAAAhG,OAAA,GAAA+F,QAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_uikitUtils","_Icon","_Image","_Text","_createStyleSheet","_useUIKitTheme","_Badge","obj","__esModule","default","GroupChannelPreview","_ref","customCover","coverUrl","memberCount","badgeCount","maxBadgeCount","body","bodyIcon","title","titleCaption","titleCaptionLeft","frozen","notificationOff","broadcast","mentioned","mentionTrigger","colors","useUIKitTheme","color","ui","groupChannelPreview","createElement","View","style","styles","container","backgroundColor","none","background","coverContainer","conditionChaining","Boolean","resizeMode","channelCover","coverBackground","source","uri","rightSection","rightTopSection","channelInfoContainer","size","icon","secondary","containerStyle","channelInfoBroadcast","numberOfLines","subtitle1","channelInfoTitle","textTitle","caption1","channelInfoMemberCount","primary","channelInfoFrozen","onBackground03","titleCaptionContainer","caption2","textTitleCaption","titleCaptionText","rightBottomSection","bodyWrapper","bodyIconBackground","body3","ellipsizeMode","bodyText","textBody","unreadContainer","h2","badge","unreadMention","count","maxCount","Separator","separator","_ref2","createStyleSheet","height","width","flexDirection","alignItems","justifyContent","marginLeft","marginRight","borderRadius","flex","paddingTop","paddingRight","marginBottom","flexShrink","marginTop","position","left","right","bottom","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport { conditionChaining } from '@sendbird/uikit-utils';\n\nimport Icon from '../../components/Icon';\nimport Image from '../../components/Image';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport Badge from '../Badge';\n\ntype Props = {\n customCover?: React.ReactNode;\n coverUrl: string;\n\n title: string;\n\n titleCaption: string;\n titleCaptionLeft?: React.ReactNode;\n\n bodyIcon?: keyof typeof Icon.Assets;\n body: string;\n\n memberCount?: number;\n badgeCount: number;\n maxBadgeCount?: number;\n\n frozen?: boolean;\n notificationOff?: boolean;\n broadcast?: boolean;\n mentioned?: boolean;\n mentionTrigger?: string;\n};\n\nconst GroupChannelPreview = ({\n customCover,\n coverUrl,\n memberCount,\n badgeCount,\n maxBadgeCount,\n body,\n bodyIcon,\n title,\n titleCaption,\n titleCaptionLeft,\n frozen,\n notificationOff,\n broadcast,\n mentioned,\n mentionTrigger = '@',\n}: Props) => {\n const { colors } = useUIKitTheme();\n const color = colors.ui.groupChannelPreview;\n\n return (\n <View style={[styles.container, { backgroundColor: color.default.none.background }]}>\n <View style={styles.coverContainer}>\n {conditionChaining(\n [Boolean(customCover)],\n [\n customCover,\n <Image\n resizeMode={'cover'}\n style={[styles.channelCover, { backgroundColor: color.default.none.coverBackground }]}\n source={{ uri: coverUrl }}\n />,\n ],\n )}\n </View>\n <View style={styles.rightSection}>\n <View style={styles.rightTopSection}>\n <View style={styles.channelInfoContainer}>\n {broadcast && (\n <Icon\n size={16}\n icon={'broadcast'}\n color={colors.secondary}\n containerStyle={styles.channelInfoBroadcast}\n />\n )}\n <Text numberOfLines={1} subtitle1 style={styles.channelInfoTitle} color={color.default.none.textTitle}>\n {title}\n </Text>\n {Boolean(memberCount) && (\n <Text caption1 style={styles.channelInfoMemberCount} color={color.default.none.memberCount}>\n {memberCount}\n </Text>\n )}\n {frozen && (\n <Icon size={16} icon={'freeze'} color={colors.primary} containerStyle={styles.channelInfoFrozen} />\n )}\n {notificationOff && <Icon size={16} icon={'notifications-off-filled'} color={colors.onBackground03} />}\n </View>\n <View style={styles.titleCaptionContainer}>\n {titleCaptionLeft}\n <Text caption2 color={color.default.none.textTitleCaption} style={styles.titleCaptionText}>\n {titleCaption}\n </Text>\n </View>\n </View>\n\n <View style={styles.rightBottomSection}>\n <View style={styles.body}>\n <View style={styles.bodyWrapper}>\n {bodyIcon && (\n <Icon\n size={18}\n icon={bodyIcon}\n color={color.default.none.bodyIcon}\n containerStyle={[\n styles.bodyIcon,\n { backgroundColor: colors.ui.groupChannelPreview.default.none.bodyIconBackground },\n ]}\n />\n )}\n <Text\n body3\n numberOfLines={1}\n ellipsizeMode={bodyIcon ? 'middle' : 'tail'}\n style={styles.bodyText}\n color={color.default.none.textBody}\n >\n {body}\n </Text>\n </View>\n </View>\n <View style={styles.unreadContainer}>\n {mentioned && (\n <Text h2 color={colors.ui.badge.default.none.background} style={styles.unreadMention}>\n {mentionTrigger}\n </Text>\n )}\n {badgeCount > 0 && <Badge count={badgeCount} maxCount={maxBadgeCount} />}\n </View>\n </View>\n <Separator color={color.default.none.separator} />\n </View>\n </View>\n );\n};\n\ntype SeparatorProps = { color: string };\nconst Separator = ({ color }: SeparatorProps) => <View style={[styles.separator, { backgroundColor: color }]} />;\n\nconst styles = createStyleSheet({\n container: {\n height: 76,\n width: '100%',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n },\n coverContainer: {\n marginLeft: 16,\n marginRight: 16,\n },\n channelCover: {\n width: 56,\n height: 56,\n borderRadius: 28,\n },\n rightSection: {\n flex: 1,\n paddingTop: 10,\n paddingRight: 16,\n },\n rightTopSection: {\n flexDirection: 'row',\n marginBottom: 4,\n },\n channelInfoContainer: {\n flex: 1,\n marginRight: 4,\n alignItems: 'center',\n flexDirection: 'row',\n },\n channelInfoBroadcast: {\n marginRight: 4,\n },\n channelInfoTitle: {\n flexShrink: 1,\n marginRight: 4,\n },\n channelInfoMemberCount: {\n paddingTop: 2,\n marginRight: 4,\n },\n channelInfoFrozen: {\n marginRight: 4,\n },\n titleCaptionContainer: {\n alignItems: 'flex-start',\n flexDirection: 'row',\n marginLeft: 4,\n },\n titleCaptionText: {\n marginTop: 2,\n },\n rightBottomSection: {\n flex: 1,\n height: '100%',\n flexDirection: 'row',\n },\n body: {\n marginRight: 4,\n flex: 1,\n flexDirection: 'row',\n alignItems: 'flex-start',\n },\n bodyWrapper: {\n flexDirection: 'row',\n alignItems: 'center',\n },\n bodyText: {\n flex: 1,\n },\n bodyIcon: {\n borderRadius: 8,\n width: 26,\n height: 26,\n marginRight: 4,\n },\n unreadContainer: {\n flexDirection: 'row',\n alignItems: 'flex-start',\n },\n unreadMention: {\n marginRight: 4,\n },\n separator: {\n position: 'absolute',\n left: 0,\n right: -16,\n bottom: 0,\n height: 1,\n },\n});\n\nexport default GroupChannelPreview;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,KAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,iBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,cAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,MAAA,GAAAT,sBAAA,CAAAC,OAAA;AAA6B,SAAAD,uBAAAU,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAyB7B,MAAMG,mBAAmB,GAAGC,IAAA,IAgBf;EAAA,IAhBgB;IAC3BC,WAAW;IACXC,QAAQ;IACRC,WAAW;IACXC,UAAU;IACVC,aAAa;IACbC,IAAI;IACJC,QAAQ;IACRC,KAAK;IACLC,YAAY;IACZC,gBAAgB;IAChBC,MAAM;IACNC,eAAe;IACfC,SAAS;IACTC,SAAS;IACTC,cAAc,GAAG;EACZ,CAAC,GAAAf,IAAA;EACN,MAAM;IAAEgB;EAA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,CAAC;EACDV,aAAa,EAAE;IACba,WAAW,EAAE;EACf,CAAC;EACDT,SAAS,EAAE;IACTiB,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC,EAAE;IACVC,MAAM,EAAE,CAAC;IACTjB,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAAC,IAAAkB,QAAA,GAEY9F,mBAAmB;AAAA+F,OAAA,CAAAhG,OAAA,GAAA+F,QAAA"}
|
|
@@ -203,9 +203,10 @@ const styles = (0, _createStyleSheet.default)({
|
|
|
203
203
|
padding: 4
|
|
204
204
|
}
|
|
205
205
|
});
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
206
|
+
var _default = Object.assign(Header, {
|
|
207
|
+
Button: HeaderButton,
|
|
208
|
+
Title: HeaderTitle,
|
|
209
|
+
Subtitle: HeaderSubtitle
|
|
210
|
+
});
|
|
210
211
|
exports.default = _default;
|
|
211
212
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_reactNativeSafeAreaContext","_uikitUtils","_Text","_createStyleSheet","_useHeaderStyle","_useUIKitTheme","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","AlignMapper","left","center","right","Header","_ref","children","titleAlign","title","onPressLeft","onPressRight","clearTitleMargin","clearStatusBarTopInset","statusBarTopInsetAs","topInset","defaultTitleAlign","defaultHeight","useHeaderStyle","colors","useUIKitTheme","paddingLeft","paddingRight","useSafeAreaInsets","actualTitleAlign","actualTopInset","createElement","View","style","paddingTop","backgroundColor","ui","header","nav","none","background","styles","container","paddingHorizontal","borderBottomColor","borderBottom","height","LeftSide","marginHorizontal","justifyContent","HeaderTitle","RightSide","_ref2","HeaderButton","onPress","_ref3","_ref4","props","h1","numberOfLines","HeaderSubtitle","_ref5","color","onBackground03","caption2","_ref6","disabled","TouchableOpacity","button","e","activeOpacity","conditionChaining","createStyleSheet","borderBottomWidth","flexDirection","flex","alignItems","minWidth","marginRight","marginLeft","padding","Button","Title","Subtitle","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\nimport { TouchableOpacity, TouchableOpacityProps, View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { conditionChaining } from '@sendbird/uikit-utils';\n\nimport Text, { TextProps } from '../../components/Text';\nimport type { BaseHeaderProps } from '../../index';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useHeaderStyle from '../../styles/useHeaderStyle';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\n\ntype HeaderElement = string | React.ReactElement | null;\nexport type HeaderProps = BaseHeaderProps<\n {\n title?: HeaderElement;\n left?: HeaderElement;\n right?: HeaderElement;\n onPressLeft?: () => void;\n onPressRight?: () => void;\n },\n {\n clearTitleMargin?: boolean;\n clearStatusBarTopInset?: boolean;\n statusBarTopInsetAs?: 'padding' | 'margin';\n }\n>;\n\nconst AlignMapper = { left: 'flex-start', center: 'center', right: 'flex-end' } as const;\nconst Header: ((props: HeaderProps) => JSX.Element) & {\n Button: typeof HeaderButton;\n Title: typeof HeaderTitle;\n Subtitle: typeof HeaderSubtitle;\n} = ({\n children,\n titleAlign,\n title = null,\n left = null,\n right = null,\n onPressLeft,\n onPressRight,\n clearTitleMargin = false,\n clearStatusBarTopInset = false,\n statusBarTopInsetAs = 'padding',\n}) => {\n const { topInset, defaultTitleAlign, defaultHeight } = useHeaderStyle();\n\n const { colors } = useUIKitTheme();\n const { left: paddingLeft, right: paddingRight } = useSafeAreaInsets();\n\n const actualTitleAlign = titleAlign ?? defaultTitleAlign;\n const actualTopInset = clearStatusBarTopInset ? 0 : topInset;\n\n if (!title && !left && !right) {\n return (\n <View style={{ paddingTop: actualTopInset, backgroundColor: colors.ui.header.nav.none.background }}>\n {children}\n </View>\n );\n }\n\n return (\n <View\n style={[\n styles.container,\n {\n [statusBarTopInsetAs === 'padding' ? 'paddingTop' : 'marginTop']: actualTopInset,\n paddingLeft: paddingLeft + styles.container.paddingHorizontal,\n paddingRight: paddingRight + styles.container.paddingHorizontal,\n backgroundColor: colors.ui.header.nav.none.background,\n borderBottomColor: colors.ui.header.nav.none.borderBottom,\n },\n ]}\n >\n <View style={[styles.header, { height: defaultHeight }]}>\n <LeftSide titleAlign={actualTitleAlign} left={left} onPressLeft={onPressLeft} />\n <View\n style={[\n styles.title,\n clearTitleMargin && { marginHorizontal: 0 },\n { justifyContent: AlignMapper[actualTitleAlign] },\n ]}\n >\n {typeof title === 'string' ? <HeaderTitle>{title}</HeaderTitle> : title}\n </View>\n <RightSide titleAlign={actualTitleAlign} right={right} onPressRight={onPressRight} />\n </View>\n {children}\n </View>\n );\n};\n\nconst LeftSide = ({ titleAlign, onPressLeft, left }: HeaderProps) => {\n if (titleAlign === 'center') {\n return <View style={styles.left}>{left && <HeaderButton onPress={onPressLeft}>{left}</HeaderButton>}</View>;\n }\n if (!left) return null;\n return (\n <View style={styles.left}>\n <HeaderButton onPress={onPressLeft}>{left}</HeaderButton>\n </View>\n );\n};\n\nconst RightSide = ({ titleAlign, onPressRight, right }: HeaderProps) => {\n if (titleAlign === 'center') {\n return <View style={styles.right}>{right && <HeaderButton onPress={onPressRight}>{right}</HeaderButton>}</View>;\n }\n if (!right) return null;\n return (\n <View style={styles.right}>\n <HeaderButton onPress={onPressRight}>{right}</HeaderButton>\n </View>\n );\n};\n\nconst HeaderTitle = ({ children, style, ...props }: TextProps) => {\n return (\n <Text {...props} h1 numberOfLines={1} style={style}>\n {children}\n </Text>\n );\n};\nconst HeaderSubtitle = ({ children, style, ...props }: TextProps) => {\n const { colors } = useUIKitTheme();\n return (\n <Text color={colors.onBackground03} {...props} caption2 numberOfLines={1} style={style}>\n {children}\n </Text>\n );\n};\nconst HeaderButton = ({ children, disabled, onPress, color, ...props }: TouchableOpacityProps & { color?: string }) => {\n return (\n <TouchableOpacity\n style={styles.button}\n {...props}\n disabled={!onPress || disabled}\n onPress={(e) => onPress?.(e)}\n activeOpacity={0.7}\n >\n {conditionChaining(\n [typeof children === 'string' || typeof children === 'number'],\n [\n <Text button numberOfLines={1} color={color}>\n {children}\n </Text>,\n children,\n ],\n )}\n </TouchableOpacity>\n );\n};\n\nconst styles = createStyleSheet({\n container: {\n paddingHorizontal: 12,\n borderBottomWidth: 1,\n },\n header: {\n flexDirection: 'row',\n },\n title: {\n flex: 1,\n flexDirection: 'row',\n alignItems: 'center',\n marginHorizontal: 12,\n },\n left: {\n height: '100%',\n minWidth: 32,\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: 12,\n },\n right: {\n height: '100%',\n minWidth: 32,\n alignItems: 'center',\n justifyContent: 'center',\n marginLeft: 12,\n },\n button: {\n padding: 4,\n },\n});\n\nHeader.Button = HeaderButton;\nHeader.Title = HeaderTitle;\nHeader.Subtitle = HeaderSubtitle;\nexport default Header;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAAK,iBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,eAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,cAAA,GAAAR,sBAAA,CAAAC,OAAA;AAAsD,SAAAD,uBAAAS,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAA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,CAAC;EACDX,MAAM,EAAE;IACNY,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAEFtE,MAAM,CAACuE,MAAM,GAAG5B,YAAY;AAC5B3C,MAAM,CAACwE,KAAK,GAAGhC,WAAW;AAC1BxC,MAAM,CAACyE,QAAQ,GAAGvB,cAAc;AAAC,IAAAwB,QAAA,GAClB1E,MAAM;AAAA2E,OAAA,CAAA9F,OAAA,GAAA6F,QAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_reactNativeSafeAreaContext","_uikitUtils","_Text","_createStyleSheet","_useHeaderStyle","_useUIKitTheme","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","AlignMapper","left","center","right","Header","_ref","children","titleAlign","title","onPressLeft","onPressRight","clearTitleMargin","clearStatusBarTopInset","statusBarTopInsetAs","topInset","defaultTitleAlign","defaultHeight","useHeaderStyle","colors","useUIKitTheme","paddingLeft","paddingRight","useSafeAreaInsets","actualTitleAlign","actualTopInset","createElement","View","style","paddingTop","backgroundColor","ui","header","nav","none","background","styles","container","paddingHorizontal","borderBottomColor","borderBottom","height","LeftSide","marginHorizontal","justifyContent","HeaderTitle","RightSide","_ref2","HeaderButton","onPress","_ref3","_ref4","props","h1","numberOfLines","HeaderSubtitle","_ref5","color","onBackground03","caption2","_ref6","disabled","TouchableOpacity","button","e","activeOpacity","conditionChaining","createStyleSheet","borderBottomWidth","flexDirection","flex","alignItems","minWidth","marginRight","marginLeft","padding","_default","Button","Title","Subtitle","exports"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\nimport { TouchableOpacity, TouchableOpacityProps, View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { conditionChaining } from '@sendbird/uikit-utils';\n\nimport Text, { TextProps } from '../../components/Text';\nimport type { BaseHeaderProps, HeaderElement } from '../../index';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useHeaderStyle from '../../styles/useHeaderStyle';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\n\nexport type HeaderProps = BaseHeaderProps<\n {\n title?: HeaderElement;\n left?: HeaderElement;\n right?: HeaderElement;\n onPressLeft?: () => void;\n onPressRight?: () => void;\n },\n {\n clearTitleMargin?: boolean;\n clearStatusBarTopInset?: boolean;\n statusBarTopInsetAs?: 'padding' | 'margin';\n }\n>;\n\nconst AlignMapper = { left: 'flex-start', center: 'center', right: 'flex-end' } as const;\nconst Header = ({\n children,\n titleAlign,\n title = null,\n left = null,\n right = null,\n onPressLeft,\n onPressRight,\n clearTitleMargin = false,\n clearStatusBarTopInset = false,\n statusBarTopInsetAs = 'padding',\n}: HeaderProps) => {\n const { topInset, defaultTitleAlign, defaultHeight } = useHeaderStyle();\n\n const { colors } = useUIKitTheme();\n const { left: paddingLeft, right: paddingRight } = useSafeAreaInsets();\n\n const actualTitleAlign = titleAlign ?? defaultTitleAlign;\n const actualTopInset = clearStatusBarTopInset ? 0 : topInset;\n\n if (!title && !left && !right) {\n return (\n <View style={{ paddingTop: actualTopInset, backgroundColor: colors.ui.header.nav.none.background }}>\n {children}\n </View>\n );\n }\n\n return (\n <View\n style={[\n styles.container,\n {\n [statusBarTopInsetAs === 'padding' ? 'paddingTop' : 'marginTop']: actualTopInset,\n paddingLeft: paddingLeft + styles.container.paddingHorizontal,\n paddingRight: paddingRight + styles.container.paddingHorizontal,\n backgroundColor: colors.ui.header.nav.none.background,\n borderBottomColor: colors.ui.header.nav.none.borderBottom,\n },\n ]}\n >\n <View style={[styles.header, { height: defaultHeight }]}>\n <LeftSide titleAlign={actualTitleAlign} left={left} onPressLeft={onPressLeft} />\n <View\n style={[\n styles.title,\n clearTitleMargin && { marginHorizontal: 0 },\n { justifyContent: AlignMapper[actualTitleAlign] },\n ]}\n >\n {typeof title === 'string' ? <HeaderTitle>{title}</HeaderTitle> : title}\n </View>\n <RightSide titleAlign={actualTitleAlign} right={right} onPressRight={onPressRight} />\n </View>\n {children}\n </View>\n );\n};\n\nconst LeftSide = ({ titleAlign, onPressLeft, left }: HeaderProps) => {\n if (titleAlign === 'center') {\n return <View style={styles.left}>{left && <HeaderButton onPress={onPressLeft}>{left}</HeaderButton>}</View>;\n }\n if (!left) return null;\n return (\n <View style={styles.left}>\n <HeaderButton onPress={onPressLeft}>{left}</HeaderButton>\n </View>\n );\n};\n\nconst RightSide = ({ titleAlign, onPressRight, right }: HeaderProps) => {\n if (titleAlign === 'center') {\n return <View style={styles.right}>{right && <HeaderButton onPress={onPressRight}>{right}</HeaderButton>}</View>;\n }\n if (!right) return null;\n return (\n <View style={styles.right}>\n <HeaderButton onPress={onPressRight}>{right}</HeaderButton>\n </View>\n );\n};\n\nconst HeaderTitle = ({ children, style, ...props }: TextProps) => {\n return (\n <Text {...props} h1 numberOfLines={1} style={style}>\n {children}\n </Text>\n );\n};\nconst HeaderSubtitle = ({ children, style, ...props }: TextProps) => {\n const { colors } = useUIKitTheme();\n return (\n <Text color={colors.onBackground03} {...props} caption2 numberOfLines={1} style={style}>\n {children}\n </Text>\n );\n};\nconst HeaderButton = ({ children, disabled, onPress, color, ...props }: TouchableOpacityProps & { color?: string }) => {\n return (\n <TouchableOpacity\n style={styles.button}\n {...props}\n disabled={!onPress || disabled}\n onPress={(e) => onPress?.(e)}\n activeOpacity={0.7}\n >\n {conditionChaining(\n [typeof children === 'string' || typeof children === 'number'],\n [\n <Text button numberOfLines={1} color={color}>\n {children}\n </Text>,\n children,\n ],\n )}\n </TouchableOpacity>\n );\n};\n\nconst styles = createStyleSheet({\n container: {\n paddingHorizontal: 12,\n borderBottomWidth: 1,\n },\n header: {\n flexDirection: 'row',\n },\n title: {\n flex: 1,\n flexDirection: 'row',\n alignItems: 'center',\n marginHorizontal: 12,\n },\n left: {\n height: '100%',\n minWidth: 32,\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: 12,\n },\n right: {\n height: '100%',\n minWidth: 32,\n alignItems: 'center',\n justifyContent: 'center',\n marginLeft: 12,\n },\n button: {\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M,OAAI;IAAC6E,MAAM;IAACT,aAAa,EAAE,CAAE;IAACG,KAAK,EAAEA;EAAM,GACzClD,QAAQ,CACJ,EACPA,QAAQ,CACT,CACF,CACgB;AAEvB,CAAC;AAED,MAAM6B,MAAM,GAAG,IAAA+B,yBAAgB,EAAC;EAC9B9B,SAAS,EAAE;IACTC,iBAAiB,EAAE,EAAE;IACrB8B,iBAAiB,EAAE;EACrB,CAAC;EACDpC,MAAM,EAAE;IACNqC,aAAa,EAAE;EACjB,CAAC;EACD5D,KAAK,EAAE;IACL6D,IAAI,EAAE,CAAC;IACPD,aAAa,EAAE,KAAK;IACpBE,UAAU,EAAE,QAAQ;IACpB5B,gBAAgB,EAAE;EACpB,CAAC;EACDzC,IAAI,EAAE;IACJuC,MAAM,EAAE,MAAM;IACd+B,QAAQ,EAAE,EAAE;IACZD,UAAU,EAAE,QAAQ;IACpB3B,cAAc,EAAE,QAAQ;IACxB6B,WAAW,EAAE;EACf,CAAC;EACDrE,KAAK,EAAE;IACLqC,MAAM,EAAE,MAAM;IACd+B,QAAQ,EAAE,EAAE;IACZD,UAAU,EAAE,QAAQ;IACpB3B,cAAc,EAAE,QAAQ;IACxB8B,UAAU,EAAE;EACd,CAAC;EACDX,MAAM,EAAE;IACNY,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEYxF,MAAM,CAACC,MAAM,CAACgB,MAAM,EAAE;EACnCwE,MAAM,EAAE7B,YAAY;EACpB8B,KAAK,EAAEjC,WAAW;EAClBkC,QAAQ,EAAExB;AACZ,CAAC,CAAC;AAAAyB,OAAA,CAAA9F,OAAA,GAAA0F,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_message","_uikitUtils","_Box","_Icon","_PressBox","_Text","_createStyleSheet","_useUIKitTheme","_Avatar","_LoadingSpinner","obj","__esModule","default","MessageContainer","_ref","_props$strings","_props$strings2","children","channel","grouped","pressed","props","colors","useUIKitTheme","color","ui","openChannelMessage","renderSendingStatus","message","sendingStatus","SendingStatus","PENDING","createElement","SendingStatusContainer","primary","size","FAILED","icon","error","flexDirection","paddingVertical","paddingLeft","paddingRight","backgroundColor","background","enabled","marginRight","onPress","onPressAvatar","styles","avatar","width","uri","sender","profileUrl","style","flexShrink","flex","alignItems","marginBottom","caption1","ellipsizeMode","numberOfLines","isOperator","userId","textOperator","textSenderName","strings","senderName","nickname","caption4","textTime","sentDate","getMessageTimeFormat","Date","createdAt","_ref2","marginTop","createStyleSheet","_default","exports"],"sources":["MessageContainer.tsx"],"sourcesContent":["import React from 'react';\n\nimport { SendingStatus } from '@sendbird/chat/message';\nimport type { SendbirdMessage } from '@sendbird/uikit-utils';\nimport { getMessageTimeFormat } from '@sendbird/uikit-utils';\n\nimport Box from '../../components/Box';\nimport Icon from '../../components/Icon';\nimport PressBox from '../../components/PressBox';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport Avatar from '../Avatar';\nimport LoadingSpinner from '../LoadingSpinner';\nimport type { OpenChannelMessageProps } from './index';\n\ntype Props = {\n pressed?: boolean;\n};\n\nconst MessageContainer = ({\n children,\n channel,\n grouped,\n pressed,\n ...props\n}: OpenChannelMessageProps<SendbirdMessage, Props>) => {\n const { colors } = useUIKitTheme();\n const color = colors.ui.openChannelMessage.default;\n\n const renderSendingStatus = () => {\n if (!('sendingStatus' in props.message)) return null;\n\n switch (props.message.sendingStatus) {\n case SendingStatus.PENDING: {\n return (\n <SendingStatusContainer>\n <LoadingSpinner color={colors.primary} size={16} />\n </SendingStatusContainer>\n );\n }\n case SendingStatus.FAILED: {\n return (\n <SendingStatusContainer>\n <Icon icon={'error'} color={colors.error} size={16} />\n </SendingStatusContainer>\n );\n }\n default: {\n return null;\n }\n }\n };\n\n return (\n <Box\n flexDirection={'row'}\n paddingVertical={grouped ? 5 : 6}\n paddingLeft={12}\n paddingRight={12}\n backgroundColor={pressed ? color.pressed.background : color.enabled.background}\n >\n <Box marginRight={12}>\n {!grouped && 'sender' in props.message ? (\n <PressBox onPress={props.onPressAvatar}>\n <Avatar size={styles.avatar.width} uri={props.message.sender.profileUrl} />\n </PressBox>\n ) : (\n <Box style={styles.avatar} />\n )}\n </Box>\n <Box flexShrink={1} flex={1} flexDirection={'column'} alignItems={'flex-start'}>\n {!grouped && 'sender' in props.message && (\n <Box flexDirection={'row'} alignItems={'center'} marginBottom={2}>\n <Box marginRight={4} flexShrink={1}>\n <Text\n caption1\n ellipsizeMode={'middle'}\n numberOfLines={1}\n color={\n channel.isOperator(props.message.sender.userId)\n ? color.enabled.textOperator\n : color.enabled.textSenderName\n }\n >\n {props.strings?.senderName ?? props.message.sender.nickname}\n </Text>\n </Box>\n <Box>\n <Text caption4 color={color.enabled.textTime}>\n {props.strings?.sentDate ?? getMessageTimeFormat(new Date(props.message.createdAt))}\n </Text>\n </Box>\n </Box>\n )}\n <Box style={styles.message}>{children}</Box>\n\n {renderSendingStatus()}\n </Box>\n </Box>\n );\n};\n\nconst SendingStatusContainer = ({ children }: { children: React.
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_message","_uikitUtils","_Box","_Icon","_PressBox","_Text","_createStyleSheet","_useUIKitTheme","_Avatar","_LoadingSpinner","obj","__esModule","default","MessageContainer","_ref","_props$strings","_props$strings2","children","channel","grouped","pressed","props","colors","useUIKitTheme","color","ui","openChannelMessage","renderSendingStatus","message","sendingStatus","SendingStatus","PENDING","createElement","SendingStatusContainer","primary","size","FAILED","icon","error","flexDirection","paddingVertical","paddingLeft","paddingRight","backgroundColor","background","enabled","marginRight","onPress","onPressAvatar","styles","avatar","width","uri","sender","profileUrl","style","flexShrink","flex","alignItems","marginBottom","caption1","ellipsizeMode","numberOfLines","isOperator","userId","textOperator","textSenderName","strings","senderName","nickname","caption4","textTime","sentDate","getMessageTimeFormat","Date","createdAt","_ref2","marginTop","createStyleSheet","_default","exports"],"sources":["MessageContainer.tsx"],"sourcesContent":["import React from 'react';\n\nimport { SendingStatus } from '@sendbird/chat/message';\nimport type { SendbirdMessage } from '@sendbird/uikit-utils';\nimport { getMessageTimeFormat } from '@sendbird/uikit-utils';\n\nimport Box from '../../components/Box';\nimport Icon from '../../components/Icon';\nimport PressBox from '../../components/PressBox';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport Avatar from '../Avatar';\nimport LoadingSpinner from '../LoadingSpinner';\nimport type { OpenChannelMessageProps } from './index';\n\ntype Props = {\n pressed?: boolean;\n};\n\nconst MessageContainer = ({\n children,\n channel,\n grouped,\n pressed,\n ...props\n}: OpenChannelMessageProps<SendbirdMessage, Props>) => {\n const { colors } = useUIKitTheme();\n const color = colors.ui.openChannelMessage.default;\n\n const renderSendingStatus = () => {\n if (!('sendingStatus' in props.message)) return null;\n\n switch (props.message.sendingStatus) {\n case SendingStatus.PENDING: {\n return (\n <SendingStatusContainer>\n <LoadingSpinner color={colors.primary} size={16} />\n </SendingStatusContainer>\n );\n }\n case SendingStatus.FAILED: {\n return (\n <SendingStatusContainer>\n <Icon icon={'error'} color={colors.error} size={16} />\n </SendingStatusContainer>\n );\n }\n default: {\n return null;\n }\n }\n };\n\n return (\n <Box\n flexDirection={'row'}\n paddingVertical={grouped ? 5 : 6}\n paddingLeft={12}\n paddingRight={12}\n backgroundColor={pressed ? color.pressed.background : color.enabled.background}\n >\n <Box marginRight={12}>\n {!grouped && 'sender' in props.message ? (\n <PressBox onPress={props.onPressAvatar}>\n <Avatar size={styles.avatar.width} uri={props.message.sender.profileUrl} />\n </PressBox>\n ) : (\n <Box style={styles.avatar} />\n )}\n </Box>\n <Box flexShrink={1} flex={1} flexDirection={'column'} alignItems={'flex-start'}>\n {!grouped && 'sender' in props.message && (\n <Box flexDirection={'row'} alignItems={'center'} marginBottom={2}>\n <Box marginRight={4} flexShrink={1}>\n <Text\n caption1\n ellipsizeMode={'middle'}\n numberOfLines={1}\n color={\n channel.isOperator(props.message.sender.userId)\n ? color.enabled.textOperator\n : color.enabled.textSenderName\n }\n >\n {props.strings?.senderName ?? props.message.sender.nickname}\n </Text>\n </Box>\n <Box>\n <Text caption4 color={color.enabled.textTime}>\n {props.strings?.sentDate ?? getMessageTimeFormat(new Date(props.message.createdAt))}\n </Text>\n </Box>\n </Box>\n )}\n <Box style={styles.message}>{children}</Box>\n\n {renderSendingStatus()}\n </Box>\n </Box>\n );\n};\n\nconst SendingStatusContainer = ({ children }: { children: React.ReactNode }) => {\n return (\n <Box flexDirection={'row'}>\n <Box marginTop={2}>{children}</Box>\n </Box>\n );\n};\n\nconst styles = createStyleSheet({\n avatar: {\n width: 28,\n },\n message: {\n width: '100%',\n },\n});\n\nexport default MessageContainer;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAEA,IAAAG,IAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,KAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,iBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,cAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,OAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,eAAA,GAAAX,sBAAA,CAAAC,OAAA;AAA+C,SAAAD,uBAAAY,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAO/C,MAAMG,gBAAgB,GAAGC,IAAA,IAM8B;EAAA,IAAAC,cAAA,EAAAC,eAAA;EAAA,IAN7B;IACxBC,QAAQ;IACRC,OAAO;IACPC,OAAO;IACPC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AEV,CAAC;AAED,MAAMgC,MAAM,GAAG,IAAA6B,yBAAgB,EAAC;EAC9B5B,MAAM,EAAE;IACNC,KAAK,EAAE;EACT,CAAC;EACDvB,OAAO,EAAE;IACPuB,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAAC,IAAA4B,QAAA,GAEYlE,gBAAgB;AAAAmE,OAAA,CAAApE,OAAA,GAAAmE,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_uikitUtils","_Box","_Icon","_Image","_Text","_createStyleSheet","_useUIKitTheme","obj","__esModule","default","OpenChannelPreview","_ref","customCover","coverUrl","participantsCount","title","frozen","colors","useUIKitTheme","color","ui","openChannelPreview","none","createElement","backgroundColor","background","width","height","flexDirection","alignItems","paddingHorizontal","styles","channelCover","borderRadius","overflow","marginRight","conditionChaining","Boolean","resizeMode","style","coverBackground","source","uri","flex","justifyContent","flexShrink","marginBottom","subtitle1","channelInfoTitle","numberOfLines","textTitle","size","icon","frozenIcon","containerStyle","marginLeft","participantsIcon","caption2","textParticipants","truncatedCount","Separator","separator","_ref2","createStyleSheet","position","left","right","bottom","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { conditionChaining, truncatedCount } from '@sendbird/uikit-utils';\n\nimport Box from '../../components/Box';\nimport Icon from '../../components/Icon';\nimport Image from '../../components/Image';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\n\ntype Props = {\n customCover?: React.
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_uikitUtils","_Box","_Icon","_Image","_Text","_createStyleSheet","_useUIKitTheme","obj","__esModule","default","OpenChannelPreview","_ref","customCover","coverUrl","participantsCount","title","frozen","colors","useUIKitTheme","color","ui","openChannelPreview","none","createElement","backgroundColor","background","width","height","flexDirection","alignItems","paddingHorizontal","styles","channelCover","borderRadius","overflow","marginRight","conditionChaining","Boolean","resizeMode","style","coverBackground","source","uri","flex","justifyContent","flexShrink","marginBottom","subtitle1","channelInfoTitle","numberOfLines","textTitle","size","icon","frozenIcon","containerStyle","marginLeft","participantsIcon","caption2","textParticipants","truncatedCount","Separator","separator","_ref2","createStyleSheet","position","left","right","bottom","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { conditionChaining, truncatedCount } from '@sendbird/uikit-utils';\n\nimport Box from '../../components/Box';\nimport Icon from '../../components/Icon';\nimport Image from '../../components/Image';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\n\ntype Props = {\n customCover?: React.ReactNode;\n coverUrl: string;\n title: string;\n participantsCount?: number;\n frozen?: boolean;\n};\nconst OpenChannelPreview = ({ customCover, coverUrl, participantsCount = 0, title, frozen }: Props) => {\n const { colors } = useUIKitTheme();\n const color = colors.ui.openChannelPreview.default.none;\n\n return (\n <Box\n backgroundColor={color.background}\n width={'100%'}\n height={62}\n flexDirection={'row'}\n alignItems={'center'}\n paddingHorizontal={16}\n >\n <Box\n width={styles.channelCover.width}\n height={styles.channelCover.height}\n borderRadius={styles.channelCover.width}\n overflow={'hidden'}\n marginRight={16}\n >\n {conditionChaining(\n [Boolean(customCover)],\n [\n customCover,\n <Image\n resizeMode={'cover'}\n style={[styles.channelCover, { backgroundColor: color.coverBackground }]}\n source={{ uri: coverUrl }}\n />,\n ],\n )}\n </Box>\n <Box flex={1} height={'100%'} justifyContent={'center'}>\n <Box flexDirection={'row'} flexShrink={1} marginBottom={4} alignItems={'center'}>\n <Text subtitle1 style={styles.channelInfoTitle} numberOfLines={1} color={color.textTitle}>\n {title}\n </Text>\n {frozen && <Icon size={16} icon={'freeze'} color={color.frozenIcon} containerStyle={styles.marginLeft} />}\n </Box>\n <Box flexDirection={'row'} flexShrink={1} alignItems={'center'} justifyContent={'flex-start'}>\n <Box flexDirection={'row'} alignItems={'center'}>\n <Icon size={16} icon={'members'} color={color.participantsIcon} containerStyle={styles.marginRight} />\n <Text caption2 color={color.textParticipants}>\n {truncatedCount(participantsCount, 999)}\n </Text>\n </Box>\n </Box>\n <Separator color={color.separator} />\n </Box>\n </Box>\n );\n};\n\nconst Separator = ({ color }: { color: string }) => <Box style={[styles.separator, { backgroundColor: color }]} />;\n\nconst styles = createStyleSheet({\n channelCover: {\n width: 32,\n height: 32,\n },\n channelInfoTitle: {\n flexShrink: 1,\n },\n marginRight: {\n marginRight: 4,\n },\n marginLeft: {\n marginLeft: 4,\n },\n separator: {\n position: 'absolute',\n left: 0,\n right: -16,\n bottom: 0,\n height: 1,\n },\n});\n\nexport default OpenChannelPreview;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,IAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,KAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,iBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,cAAA,GAAAR,sBAAA,CAAAC,OAAA;AAAsD,SAAAD,uBAAAS,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAStD,MAAMG,kBAAkB,GAAGC,IAAA,IAA4E;EAAA,IAA3E;IAAEC,WAAW;IAAEC,QAAQ;IAAEC,iBAAiB,GAAG,CAAC;IAAEC,KAAK;IAAEC;EAAc,CAAC,GAAAL,IAAA;EAChG,MAAM;IAAEM;EAAO,CAAC,GAAG,IAAAC,sBAAa,GAAE;EAClC,MAAMC,KAAK,GAAGF,MAAM,CAACG,EAAE,CAACC,kBAAkB,CAACZ,OAAO,CAACa,IAAI;EAEvD,oBACEzB,MAAA,CAA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A2C,KAAA;EAAA,oBAAKjE,MAAA,CAAAY,OAAA,CAAAc,aAAA,CAACtB,IAAA,CAAAQ,OAAG;IAAC8B,KAAK,EAAE,CAACR,MAAM,CAAC8B,SAAS,EAAE;MAAErC,eAAe,EAAEL;IAAM,CAAC;EAAE,EAAG;AAAA;AAElH,MAAMY,MAAM,GAAG,IAAAgC,yBAAgB,EAAC;EAC9B/B,YAAY,EAAE;IACZN,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACV,CAAC;EACDqB,gBAAgB,EAAE;IAChBH,UAAU,EAAE;EACd,CAAC;EACDV,WAAW,EAAE;IACXA,WAAW,EAAE;EACf,CAAC;EACDoB,UAAU,EAAE;IACVA,UAAU,EAAE;EACd,CAAC;EACDM,SAAS,EAAE;IACTG,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC,EAAE;IACVC,MAAM,EAAE,CAAC;IACTxC,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAAC,IAAAyC,QAAA,GAEY1D,kBAAkB;AAAA2D,OAAA,CAAA5D,OAAA,GAAA2D,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_Divider","_Text","_createStyleSheet","_useUIKitTheme","_Avatar","obj","__esModule","default","ProfileCard","_ref","uri","username","bodyLabel","body","button","containerStyle","colors","useUIKitTheme","color","ui","profileCard","none","createElement","View","style","styles","container","backgroundColor","background","profileContainer","size","profileAvatar","h1","textUsername","numberOfLines","messageButtonArea","space","profileInfoContainer","body2","textBodyLabel","profileInfoBodyLabel","body3","textBody","createStyleSheet","paddingTop","width","alignItems","paddingHorizontal","marginBottom","padding","marginHorizontal","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleProp, View, ViewStyle } from 'react-native';\n\nimport Divider from '../../components/Divider';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport Avatar from '../Avatar';\n\ntype Props = {\n uri: string;\n username: string;\n\n button?:
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_Divider","_Text","_createStyleSheet","_useUIKitTheme","_Avatar","obj","__esModule","default","ProfileCard","_ref","uri","username","bodyLabel","body","button","containerStyle","colors","useUIKitTheme","color","ui","profileCard","none","createElement","View","style","styles","container","backgroundColor","background","profileContainer","size","profileAvatar","h1","textUsername","numberOfLines","messageButtonArea","space","profileInfoContainer","body2","textBodyLabel","profileInfoBodyLabel","body3","textBody","createStyleSheet","paddingTop","width","alignItems","paddingHorizontal","marginBottom","padding","marginHorizontal","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { StyleProp, View, ViewStyle } from 'react-native';\n\nimport Divider from '../../components/Divider';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport Avatar from '../Avatar';\n\ntype Props = {\n uri: string;\n username: string;\n\n button?: ReactNode;\n\n bodyLabel: string;\n body: string;\n\n containerStyle?: StyleProp<ViewStyle>;\n};\n\nconst ProfileCard = ({ uri, username, bodyLabel, body, button, containerStyle }: Props) => {\n const { colors } = useUIKitTheme();\n const color = colors.ui.profileCard.default.none;\n\n return (\n <View style={[styles.container, { backgroundColor: color.background }, containerStyle]}>\n <View style={styles.profileContainer}>\n <Avatar uri={uri} size={80} containerStyle={styles.profileAvatar} />\n <Text h1 color={color.textUsername} numberOfLines={1}>\n {username}\n </Text>\n </View>\n {button && <View style={styles.messageButtonArea}>{button}</View>}\n <Divider space={16} />\n <View style={styles.profileInfoContainer}>\n <Text body2 color={color.textBodyLabel} style={styles.profileInfoBodyLabel}>\n {bodyLabel}\n </Text>\n <Text body3 numberOfLines={1} color={color.textBody}>\n {body}\n </Text>\n </View>\n </View>\n );\n};\n\nconst styles = createStyleSheet({\n container: {\n paddingTop: 32,\n width: '100%',\n },\n profileContainer: {\n alignItems: 'center',\n paddingHorizontal: 16,\n marginBottom: 24,\n },\n profileAvatar: {\n marginBottom: 8,\n },\n profileInfoContainer: {\n padding: 16,\n },\n profileInfoBodyLabel: {\n marginBottom: 4,\n },\n messageButtonArea: {\n marginHorizontal: 24,\n marginBottom: 24,\n },\n});\n\nexport default ProfileCard;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,cAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,OAAA,GAAAP,sBAAA,CAAAC,OAAA;AAA+B,SAAAD,uBAAAQ,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAc/B,MAAMG,WAAW,GAAGC,IAAA,IAAuE;EAAA,IAAtE;IAAEC,GAAG;IAAEC,QAAQ;IAAEC,SAAS;IAAEC,IAAI;IAAEC,MAAM;IAAEC;EAAsB,CAAC,GAAAN,IAAA;EACpF,MAAM;IAAEO;EAAO,CAAC,GAAG,IAAAC,sBAAa,GAAE;EAClC,MAAMC,KAAK,GAAGF,MAAM,CAACG,EAAE,CAACC,WAAW,CAACb,OAAO,CAACc,IAAI;EAEhD,oBACEzB,MAAA,CAAAW,OAAA,CAAAe,aAAA,CAACvB,YAAA,CAAAwB,IAAI;IAACC,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,EAAE;MAAEC,eAAe,EAAET,KAAK,CAACU;IAAW,CAAC,EAAEb,cAAc;EAAE,gBACrFnB,MAAA,CAAAW,OAAA,CAAAe,aAAA,CAACvB,YAAA,CAAAwB,IAAI;IAACC,KAAK,E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QAAQ;IACpBC,iBAAiB,EAAE,EAAE;IACrBC,YAAY,EAAE;EAChB,CAAC;EACDjB,aAAa,EAAE;IACbiB,YAAY,EAAE;EAChB,CAAC;EACDX,oBAAoB,EAAE;IACpBY,OAAO,EAAE;EACX,CAAC;EACDT,oBAAoB,EAAE;IACpBQ,YAAY,EAAE;EAChB,CAAC;EACDb,iBAAiB,EAAE;IACjBe,gBAAgB,EAAE,EAAE;IACpBF,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAAC,IAAAG,QAAA,GAEY3C,WAAW;AAAA4C,OAAA,CAAA7C,OAAA,GAAA4C,QAAA"}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -4,6 +4,10 @@ const IconAssets = {
|
|
|
4
4
|
'add': require('./icon-add.png'),
|
|
5
5
|
'archive': require('./icon-archive.png'),
|
|
6
6
|
'arrow-left': require('./icon-arrow-left.png'),
|
|
7
|
+
'audio-off-filled': require('./icon-audio-off-filled.png'),
|
|
8
|
+
'audio-off': require('./icon-audio-off.png'),
|
|
9
|
+
'audio-on-filled': require('./icon-audio-on-filled.png'),
|
|
10
|
+
'audio-on': require('./icon-audio-on.png'),
|
|
7
11
|
'ban': require('./icon-ban.png'),
|
|
8
12
|
'broadcast': require('./icon-broadcast.png'),
|
|
9
13
|
'camera': require('./icon-camera.png'),
|
|
@@ -40,12 +44,14 @@ const IconAssets = {
|
|
|
40
44
|
'notifications-off-filled': require('./icon-notifications-off-filled.png'),
|
|
41
45
|
'notifications': require('./icon-notifications.png'),
|
|
42
46
|
'operator': require('./icon-operator.png'),
|
|
47
|
+
'pause': require('./icon-pause.png'),
|
|
43
48
|
'photo': require('./icon-photo.png'),
|
|
44
49
|
'play': require('./icon-play.png'),
|
|
45
50
|
'plus': require('./icon-plus.png'),
|
|
46
51
|
'question': require('./icon-question.png'),
|
|
47
52
|
'radio-off': require('./icon-radio-off.png'),
|
|
48
53
|
'radio-on': require('./icon-radio-on.png'),
|
|
54
|
+
'recording': require('./icon-recording.png'),
|
|
49
55
|
'refresh': require('./icon-refresh.png'),
|
|
50
56
|
'remove': require('./icon-remove.png'),
|
|
51
57
|
'reply-filled': require('./icon-reply-filled.png'),
|
|
@@ -54,6 +60,7 @@ const IconAssets = {
|
|
|
54
60
|
'send': require('./icon-send.png'),
|
|
55
61
|
'settings-filled': require('./icon-settings-filled.png'),
|
|
56
62
|
'spinner': require('./icon-spinner.png'),
|
|
63
|
+
'stop': require('./icon-stop.png'),
|
|
57
64
|
'streaming': require('./icon-streaming.png'),
|
|
58
65
|
'supergroup': require('./icon-supergroup.png'),
|
|
59
66
|
'theme': require('./icon-theme.png'),
|