stream-chat-react 12.15.4 → 12.15.6
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/dist/components/Chat/hooks/useChat.js +1 -1
- package/dist/components/Dialog/FormDialog.js +16 -12
- package/dist/components/Poll/PollHeader.js +4 -2
- package/dist/css/v2/index.css +1 -1
- package/dist/css/v2/index.layout.css +1 -1
- package/dist/index.browser.cjs +42 -31
- package/dist/index.browser.cjs.map +3 -3
- package/dist/index.node.cjs +42 -31
- package/dist/index.node.cjs.map +3 -3
- package/dist/scss/v2/AttachmentPreviewList/AttachmentPreviewList-layout.scss +1 -1
- package/dist/scss/v2/Dialog/Dialog-layout.scss +1 -1
- package/dist/scss/v2/Message/Message-layout.scss +8 -1
- package/package.json +2 -2
|
@@ -24,7 +24,7 @@ export const useChat = ({ client, defaultLanguage = 'en', i18nInstance, initialN
|
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
if (!client)
|
|
26
26
|
return;
|
|
27
|
-
const version = "12.15.
|
|
27
|
+
const version = "12.15.6";
|
|
28
28
|
const userAgent = client.getUserAgent();
|
|
29
29
|
if (!userAgent.includes('stream-chat-react')) {
|
|
30
30
|
// result looks like: 'stream-chat-react-2.3.2-stream-chat-javascript-client-browser-2.2.2'
|
|
@@ -57,16 +57,20 @@ export const FormDialog = ({ className, close, fields, onSubmit, shouldDisableSu
|
|
|
57
57
|
return (React.createElement("div", { className: clsx('str-chat__dialog str-chat__dialog--form', className) },
|
|
58
58
|
React.createElement("div", { className: 'str-chat__dialog__body' },
|
|
59
59
|
title && React.createElement("div", { className: 'str-chat__dialog__title' }, title),
|
|
60
|
-
React.createElement("form", { autoComplete: 'off'
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
60
|
+
React.createElement("form", { autoComplete: 'off', onSubmit: (e) => {
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
handleSubmit();
|
|
63
|
+
} },
|
|
64
|
+
Object.entries(fields).map(([id, fieldConfig]) => (React.createElement("div", { className: 'str-chat__dialog__field', key: `dialog-field-${id}` },
|
|
65
|
+
fieldConfig.label && (React.createElement("label", { className: clsx(`str-chat__dialog__title str-chat__dialog__title--${id}`), htmlFor: id }, fieldConfig.label)),
|
|
66
|
+
React.createElement(fieldConfig.element, {
|
|
67
|
+
id,
|
|
68
|
+
...fieldConfig.props,
|
|
69
|
+
onChange: handleChange,
|
|
70
|
+
value: value[id],
|
|
71
|
+
}),
|
|
72
|
+
React.createElement(FieldError, { text: fieldErrors[id]?.message })))),
|
|
73
|
+
React.createElement("div", { className: 'str-chat__dialog__controls' },
|
|
74
|
+
React.createElement("button", { className: 'str-chat__dialog__controls-button str-chat__dialog__controls-button--cancel', onClick: close }, t('Cancel')),
|
|
75
|
+
React.createElement("button", { className: 'str-chat__dialog__controls-button str-chat__dialog__controls-button--submit', disabled: Object.keys(fieldErrors).length > 0 || shouldDisableSubmitButton?.(value), type: 'submit' }, t('Send')))))));
|
|
72
76
|
};
|
|
@@ -15,13 +15,15 @@ export const PollHeader = () => {
|
|
|
15
15
|
const selectionInstructions = useMemo(() => {
|
|
16
16
|
if (is_closed)
|
|
17
17
|
return t('Vote ended');
|
|
18
|
-
if (enforce_unique_vote)
|
|
18
|
+
if (enforce_unique_vote || options.length === 1)
|
|
19
19
|
return t('Select one');
|
|
20
20
|
if (max_votes_allowed)
|
|
21
21
|
return t('Select up to {{count}}', {
|
|
22
22
|
count: max_votes_allowed > options.length ? options.length : max_votes_allowed,
|
|
23
23
|
});
|
|
24
|
-
|
|
24
|
+
if (options.length > 1)
|
|
25
|
+
return t('Select one or more');
|
|
26
|
+
return '';
|
|
25
27
|
}, [is_closed, enforce_unique_vote, max_votes_allowed, options.length, t]);
|
|
26
28
|
if (!name)
|
|
27
29
|
return;
|