Explorar o código

delete container ReplayComments.jsx

ryoji-s %!s(int64=3) %!d(string=hai) anos
pai
achega
45474cd903
Modificáronse 1 ficheiros con 10 adicións e 14 borrados
  1. 10 14
      packages/app/src/components/PageComment/ReplayComments.jsx

+ 10 - 14
packages/app/src/components/PageComment/ReplayComments.jsx

@@ -3,13 +3,10 @@ import PropTypes from 'prop-types';
 
 
 import { Collapse } from 'reactstrap';
 import { Collapse } from 'reactstrap';
 
 
-import AppContainer from '~/client/services/AppContainer';
-import PageContainer from '~/client/services/PageContainer';
+import { useGrowiRendererConfig } from '~/stores/context';
 
 
 import Comment from './Comment';
 import Comment from './Comment';
 
 
-import { withUnstatedContainers } from '../UnstatedUtils';
-
 class ReplayComments extends React.PureComponent {
 class ReplayComments extends React.PureComponent {
 
 
   constructor() {
   constructor() {
@@ -40,8 +37,9 @@ class ReplayComments extends React.PureComponent {
   }
   }
 
 
   render() {
   render() {
+    const { config } = this.props
 
 
-    const isAllReplyShown = this.props.appContainer.getConfig().isAllReplyShown || false;
+    const isAllReplyShown = config.isAllReplyShown || false;
     const replyList = this.props.replyList;
     const replyList = this.props.replyList;
 
 
     if (isAllReplyShown) {
     if (isAllReplyShown) {
@@ -98,19 +96,17 @@ class ReplayComments extends React.PureComponent {
 
 
 }
 }
 
 
-/**
- * Wrapper component for using unstated
- */
-const ReplayCommentsWrapper = withUnstatedContainers(ReplayComments, [AppContainer, PageContainer]);
-
 ReplayComments.propTypes = {
 ReplayComments.propTypes = {
-  appContainer: PropTypes.instanceOf(AppContainer).isRequired,
-  pageContainer: PropTypes.instanceOf(PageContainer).isRequired,
-
   growiRenderer: PropTypes.object.isRequired,
   growiRenderer: PropTypes.object.isRequired,
   deleteBtnClicked: PropTypes.func.isRequired,
   deleteBtnClicked: PropTypes.func.isRequired,
   isReadOnly: PropTypes.bool.isRequired,
   isReadOnly: PropTypes.bool.isRequired,
   replyList: PropTypes.array,
   replyList: PropTypes.array,
 };
 };
 
 
-export default ReplayCommentsWrapper;
+const ReplayCommentsWrapperFC = (props) => {
+  const { data: config } = useGrowiRendererConfig();
+
+  return <ReplayComments config={config} {...props} />;
+};
+
+export default ReplayCommentsWrapperFC;