diff --git a/changelog.md b/changelog.md index 5c8e26a..e1c0932 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +3.4.1 +============================================ +- Added chat Components + 3.4.0 ============================================ - Improved performance diff --git a/package.json b/package.json index 05ff017..112656b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prisma-cms/boilerplate", - "version": "3.4.0", + "version": "3.4.1", "description": "Opensource framework CMS powered by GraphQL, Prisma, MySQL, React & Apollo GraphQL", "private": false, "scripts": { diff --git a/src/components/Renderer/pages/Root/components/pages/ChatRooms/ChatRoom/index.js b/src/components/Renderer/pages/Root/components/pages/ChatRooms/ChatRoom/index.js new file mode 100644 index 0000000..422e6c3 --- /dev/null +++ b/src/components/Renderer/pages/Root/components/pages/ChatRooms/ChatRoom/index.js @@ -0,0 +1,88 @@ +import React from 'react'; + +import EditorComponent from '@prisma-cms/front-editor/lib/components/App/components/'; +import { ObjectContext } from '@prisma-cms/front-editor/lib/components/App/components/public/Connectors/Connector/ListView/'; +import ChatRoomView from '@prisma-cms/webrtc/lib/components/pages/society/ChatRooms/ChatRoom/View'; +import { EditableObjectContext } from '@prisma-cms/front-editor/lib/components/App/context'; + +export class ChatRoom extends EditorComponent { + + static Name = 'ChatRoom'; + + static defaultProps = { + ...EditorComponent.defaultProps, + } + + + renderPanelView(content) { + + const { + classes, + } = this.getEditorContext(); + + return super.renderPanelView( + content || +
+ ChatRoom +
+ ); + } + + + getRootElement() { + + return super.getRootElement(); + } + + + canBeParent(parent) { + + return super.canBeParent(parent); + } + + + canBeChild(child) { + + return super.canBeChild(child); + } + + + renderChildren() { + + const { + } = this.context; + + const { + } = this.getEditorContext(); + + const { + ...other + } = this.getComponentProps(this); + + return + {objectContext => { + + const { + object, + ...otherContext + } = objectContext; + + + return + + }} + + + return `super.renderChildren()`; + } + +} + +export default ChatRoom; \ No newline at end of file diff --git a/src/components/Renderer/pages/Root/components/pages/ChatRooms/index.js b/src/components/Renderer/pages/Root/components/pages/ChatRooms/index.js new file mode 100644 index 0000000..88443d1 --- /dev/null +++ b/src/components/Renderer/pages/Root/components/pages/ChatRooms/index.js @@ -0,0 +1,72 @@ +import React from 'react'; + +import EditorComponent from '@prisma-cms/front-editor/lib/components/App/components/'; +import ChatRoomsPage from '../../../../society/ChatRooms'; + +export class ChatRooms extends EditorComponent { + + static Name = 'ChatRooms'; + + static defaultProps = { + ...EditorComponent.defaultProps, + } + + + renderPanelView(content) { + + const { + classes, + } = this.getEditorContext(); + + return super.renderPanelView( + content || +
+ ChatRooms +
+ ); + } + + + getRootElement() { + + return super.getRootElement(); + } + + + canBeParent(parent) { + + return super.canBeParent(parent); + } + + + canBeChild(child) { + + // return super.canBeChild(child); + return false; + } + + + renderChildren() { + + const { + } = this.context; + + const { + } = this.getEditorContext(); + + const { + ...other + } = this.getComponentProps(this); + + // return super.renderChildren(); + + return + } + +} + +export default ChatRooms; \ No newline at end of file diff --git a/src/components/Renderer/pages/Root/components/society/NoticesMenu/index.js b/src/components/Renderer/pages/Root/components/society/NoticesMenu/index.js new file mode 100644 index 0000000..b8f11ef --- /dev/null +++ b/src/components/Renderer/pages/Root/components/society/NoticesMenu/index.js @@ -0,0 +1,81 @@ +import React from 'react'; + +import EditorComponent from '@prisma-cms/front-editor/lib/components/App/components/'; + +import { Notices } from '@prisma-cms/society'; + +export class NoticesMenu extends EditorComponent { + + static Name = 'NoticesMenu'; + + static defaultProps = { + ...EditorComponent.defaultProps, + } + + + renderPanelView(content) { + + const { + classes, + } = this.getEditorContext(); + + return super.renderPanelView( + content || +
+ NoticesMenu +
+ ); + } + + + getRootElement() { + + return super.getRootElement(); + } + + + canBeParent(parent) { + + return super.canBeParent(parent); + } + + + canBeChild(child) { + + return false; + } + + + renderChildren() { + + const { + user: currentUser, + } = this.context; + + const { + } = this.getEditorContext(); + + const { + ...other + } = this.getComponentProps(this); + + if (!currentUser) { + return null; + } + + const { + id: currentUserId, + } = currentUser; + + return + } + +} + +export default NoticesMenu; \ No newline at end of file diff --git a/src/components/Renderer/pages/Root/index.js b/src/components/Renderer/pages/Root/index.js index b5f149a..30a75ad 100644 --- a/src/components/Renderer/pages/Root/index.js +++ b/src/components/Renderer/pages/Root/index.js @@ -6,6 +6,9 @@ import RootConnector from '@prisma-cms/front-editor/lib/components/Root'; import UserPage from './components/pages/Users/User'; // import PdfView from './components/PdfView'; import CreateUserPage from './components/pages/Users/User/Create'; +import ChatRooms from './components/pages/ChatRooms'; +import NoticesMenu from './components/society/NoticesMenu'; +import ChatRoom from './components/pages/ChatRooms/ChatRoom'; @@ -20,8 +23,11 @@ class RootPage extends PrismaCmsComponent { return