@selfcommunity/react-ui 0.10.1-alpha.1 → 0.10.1-alpha.3

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.
@@ -69,6 +69,9 @@ function CommentObjectReply(inProps) {
69
69
  const scUserContext = (0, react_core_1.useSCUser)();
70
70
  // RETRIEVE OBJECTS
71
71
  const [html, setHtml] = (0, react_1.useState)(text);
72
+ // HOOKS
73
+ const theme = (0, material_1.useTheme)();
74
+ const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
72
75
  // REFS
73
76
  let editor = (0, react_1.useRef)();
74
77
  /**
@@ -82,7 +85,7 @@ function CommentObjectReply(inProps) {
82
85
  * Focus on editor
83
86
  */
84
87
  const handleEditorFocus = () => {
85
- if (editor.current) {
88
+ if (!isMobile && editor.current) {
86
89
  editor.current.focus();
87
90
  }
88
91
  };
@@ -116,7 +116,7 @@ function Share(props) {
116
116
  if (shareMedias.length) {
117
117
  sharedObjectId = shareMedias[0].embed.metadata.id;
118
118
  }
119
- const isMediaEvent = obj.medias.some((media) => media.embed.embed_type === Media_1.MEDIA_EMBED_SC_SHARED_EVENT);
119
+ const isMediaEvent = obj.medias.some((media) => { var _a; return ((_a = media.embed) === null || _a === void 0 ? void 0 : _a.embed_type) === Media_1.MEDIA_EMBED_SC_SHARED_EVENT; });
120
120
  return api_services_1.http
121
121
  .request({
122
122
  url: api_services_1.Endpoints.ComposerMediaCreate.url(),
@@ -4,7 +4,7 @@ import { useEffect, useMemo, useRef, useState } from 'react';
4
4
  import { styled } from '@mui/material/styles';
5
5
  import Widget from '../Widget';
6
6
  import { FormattedMessage } from 'react-intl';
7
- import { Avatar, Stack } from '@mui/material';
7
+ import { Avatar, Stack, useMediaQuery, useTheme } from '@mui/material';
8
8
  import { useSCUser } from '@selfcommunity/react-core';
9
9
  import Editor from '../Editor';
10
10
  import classNames from 'classnames';
@@ -67,6 +67,9 @@ export default function CommentObjectReply(inProps) {
67
67
  const scUserContext = useSCUser();
68
68
  // RETRIEVE OBJECTS
69
69
  const [html, setHtml] = useState(text);
70
+ // HOOKS
71
+ const theme = useTheme();
72
+ const isMobile = useMediaQuery(theme.breakpoints.down('md'));
70
73
  // REFS
71
74
  let editor = useRef();
72
75
  /**
@@ -80,7 +83,7 @@ export default function CommentObjectReply(inProps) {
80
83
  * Focus on editor
81
84
  */
82
85
  const handleEditorFocus = () => {
83
- if (editor.current) {
86
+ if (!isMobile && editor.current) {
84
87
  editor.current.focus();
85
88
  }
86
89
  };
@@ -114,7 +114,7 @@ export default function Share(props) {
114
114
  if (shareMedias.length) {
115
115
  sharedObjectId = shareMedias[0].embed.metadata.id;
116
116
  }
117
- const isMediaEvent = obj.medias.some((media) => media.embed.embed_type === MEDIA_EMBED_SC_SHARED_EVENT);
117
+ const isMediaEvent = obj.medias.some((media) => { var _a; return ((_a = media.embed) === null || _a === void 0 ? void 0 : _a.embed_type) === MEDIA_EMBED_SC_SHARED_EVENT; });
118
118
  return http
119
119
  .request({
120
120
  url: Endpoints.ComposerMediaCreate.url(),