mirror of
https://github.com/hanzo-io/team.git
synced 2026-10-30 18:56:23 +00:00
27 lines
484 B
React
27 lines
484 B
React
import * as React from "react";
|
|
import { App } from "./App";
|
|
import { createRoot } from "react-dom/client";
|
|
|
|
|
|
class RavenChat {
|
|
constructor({ wrapper }) {
|
|
this.$wrapper = $(wrapper);
|
|
|
|
this.init();
|
|
}
|
|
|
|
init() {
|
|
this.setup_app();
|
|
}
|
|
|
|
setup_app() {
|
|
// create and mount the react app
|
|
const root = createRoot(this.$wrapper.get(0));
|
|
root.render(<App />);
|
|
this.$raven_chat = root;
|
|
}
|
|
}
|
|
|
|
frappe.provide("frappe.ui");
|
|
frappe.ui.RavenChat = RavenChat;
|
|
export default RavenChat; |