diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 91ad003..0000000 --- a/.babelrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "presets": [ - "react" - ] -} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 698d5d9..6efebe2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ .sync-config.cson .electron-gyp .npmrc +.idea .DS_Store @@ -14,4 +15,4 @@ npm-debug.log Jitsi Meet* -build/ \ No newline at end of file +build/ diff --git a/app/features/app/components/App.js b/app/features/app/components/App.js new file mode 100644 index 0000000..2afd502 --- /dev/null +++ b/app/features/app/components/App.js @@ -0,0 +1,32 @@ +import React, { Component } from 'react'; + +import { Conference } from '../../conference'; +import config from '../../config'; + +/** + * Main component encapsulating the entire application. + */ +export default class App extends Component { + /** + * Initializes a new {@code App} instance. + * + * @inheritdoc + */ + constructor() { + super(); + + document.title = config.appName; + } + + /** + * Implements React's {@link Component#render()}. + * + * @inheritdoc + * @returns {ReactElement} + */ + render() { + return ( + + ); + } +} diff --git a/app/features/app/components/index.js b/app/features/app/components/index.js new file mode 100644 index 0000000..c866729 --- /dev/null +++ b/app/features/app/components/index.js @@ -0,0 +1 @@ +export { default as App } from './App'; diff --git a/app/features/app/index.js b/app/features/app/index.js new file mode 100644 index 0000000..07635cb --- /dev/null +++ b/app/features/app/index.js @@ -0,0 +1 @@ +export * from './components'; diff --git a/windows/jitsi-meet/src/index.js b/app/features/conference/components/Conference.js similarity index 68% rename from windows/jitsi-meet/src/index.js rename to app/features/conference/components/Conference.js index b7d7e36..e77ece9 100644 --- a/windows/jitsi-meet/src/index.js +++ b/app/features/conference/components/Conference.js @@ -1,5 +1,4 @@ -import React from 'react'; -import { render } from 'react-dom'; +import { Component } from 'react'; import { RemoteControl, @@ -8,43 +7,43 @@ import { setupWiFiStats } from 'jitsi-meet-electron-utils'; -import { jitsiMeetDomain } from '../../../config.js'; +import config from '../../config'; /** * Jitsi Meet Window Component */ -class JitsiMeetWindow extends React.Component { - - /** - * Render function of component - * @return {ScriptElement} - */ - render() { - return null; - } - +export default class Conference extends Component { /** * Attach the script */ componentDidMount() { - const script = document.createElement('script'); script.async = true; script.onload = this._onScriptLoad; script.onerror = console.error; - script.src = `https://${jitsiMeetDomain}/external_api.js`; + script.src = `https://${config.defaultDomain}/external_api.js`; document.head.appendChild(script); } + + /** + * Render function of component. + * + * @return {ReactElement} + */ + render() { + return null; + } + /** * When the script is loaded attach utils from jitsi-meet-electron-utils */ _onScriptLoad() { const JitsiMeetExternalAPI = window.JitsiMeetExternalAPI; - const api = new JitsiMeetExternalAPI(jitsiMeetDomain); + const api = new JitsiMeetExternalAPI(config.defaultDomain); const iframe = api.getIFrame(); setupScreenSharingForWindow(iframe); @@ -53,5 +52,3 @@ class JitsiMeetWindow extends React.Component { setupWiFiStats(iframe); } } - -render(, document.getElementById('app')); diff --git a/app/features/conference/components/index.js b/app/features/conference/components/index.js new file mode 100644 index 0000000..7ee56f5 --- /dev/null +++ b/app/features/conference/components/index.js @@ -0,0 +1 @@ +export { default as Conference } from './Conference'; diff --git a/app/features/conference/index.js b/app/features/conference/index.js new file mode 100644 index 0000000..07635cb --- /dev/null +++ b/app/features/conference/index.js @@ -0,0 +1 @@ +export * from './components'; diff --git a/app/features/config/index.js b/app/features/config/index.js new file mode 100644 index 0000000..22d3806 --- /dev/null +++ b/app/features/config/index.js @@ -0,0 +1,12 @@ + +export default { + /** + * Application name. + */ + appName: 'Jitsi Meet', + + /** + * The domain of the Jitsi Meet deployment that will be used. + */ + defaultDomain: 'meet.jit.si' +}; diff --git a/templates/index.html b/app/index.html similarity index 82% rename from templates/index.html rename to app/index.html index 48f1288..befc6f9 100644 --- a/templates/index.html +++ b/app/index.html @@ -1,7 +1,6 @@ - <%= htmlWebpackPlugin.options.title %>