[add-more-info-template] added locales and a react boilerplate to start developing
This commit is contained in:
@@ -2,5 +2,5 @@
|
||||
"requiredSdkVersion": "~0.0.73",
|
||||
"name": "<plugin-name>",
|
||||
"javascriptEntrypointUrl": "<plugin-name>.js",
|
||||
"localesBaseUrl": "https://cdn.dominio.com/pluginabc/"
|
||||
"localesBaseUrl": "locales"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import * as React from 'react';
|
||||
import * as ReactDOM from 'react-dom/client';
|
||||
import MainComponent from './main/component';
|
||||
|
||||
const uuid = document.currentScript?.getAttribute('uuid') || 'root';
|
||||
|
||||
const pluginName = document.currentScript?.getAttribute('pluginName') || 'plugin';
|
||||
|
||||
const root = ReactDOM.createRoot(document.getElementById(uuid));
|
||||
root.render(
|
||||
<MainComponent {...{
|
||||
pluginUuid: uuid,
|
||||
pluginName,
|
||||
}}
|
||||
/>,
|
||||
);
|
||||
|
||||
20
src/main/component.tsx
Normal file
20
src/main/component.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import * as React from 'react';
|
||||
|
||||
import { BbbPluginSdk, PluginApi } from 'bigbluebutton-html-plugin-sdk';
|
||||
|
||||
interface MainComponentProps {
|
||||
pluginUuid: string;
|
||||
}
|
||||
|
||||
function MainComponent(
|
||||
{ pluginUuid: uuid }: MainComponentProps,
|
||||
): React.ReactElement<MainComponentProps> {
|
||||
BbbPluginSdk.initialize(uuid);
|
||||
const pluginApi: PluginApi = BbbPluginSdk.getPluginApi(uuid);
|
||||
|
||||
console.log('hello world', pluginApi);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
export default MainComponent;
|
||||
Reference in New Issue
Block a user