diff --git a/Desktop/DesktopApp.js b/Desktop/DesktopApp.js index 3a8cc7c6f..13795715d 100644 --- a/Desktop/DesktopApp.js +++ b/Desktop/DesktopApp.js @@ -70,8 +70,12 @@ exports.newDesktopApp = function newDesktopApp() { thisObject.webSocketsInterface.initialize() console.log('Desktop Client Web Sockets Interface ......................................... Listening at port ' + JSON.parse(DK.desktopApp.p2pNetworkClient.node.config).webSocketsPort) - thisObject.httpInterface = DK.projects.socialTrading.modules.httpInterface.newDesktopModulesHttpInterface() - thisObject.httpInterface.initialize() + + /* TODO refactor this into something better */ + let react = require('./scripts/start'); + react.start(JSON.parse(DK.desktopApp.p2pNetworkClient.node.config).webPort); +/* thisObject.httpInterface = DK.projects.socialTrading.modules.httpInterface.newDesktopModulesHttpInterface() + thisObject.httpInterface.initialize()*/ console.log('Desktop Client Http Interface ................................................ Listening at port ' + JSON.parse(DK.desktopApp.p2pNetworkClient.node.config).webPort) } } diff --git a/Desktop/UI/WebApp.js b/Desktop/UI/WebApp.js index cb4b4da43..f0d6afd9d 100644 --- a/Desktop/UI/WebApp.js +++ b/Desktop/UI/WebApp.js @@ -1,3 +1,12 @@ +const reactReqs = { + + a: REQUIREJS([], () => {}), + React: require('react'), + ReactDOM: require('react-dom'), + ReactBase: require("../components/ReactBase") +} + + function newWebApp() { /* In it's current state of development, the Web App only has one module. @@ -5,7 +14,7 @@ function newWebApp() { Everything is being coded here until some structure emerges. */ let thisObject = { - messageReceived: messageReceived, + messageReceived: messageReceived, initialize: initialize, finalize: finalize } @@ -21,9 +30,10 @@ function newWebApp() { setupRootObject(UI, 'UI') setupRootObject(SA, 'SA') await UI.projects.socialTrading.modules.webSocketsWebAppClient.initialize() - loadWUserProfileTimeline() - loadWhoToFollow() - setupEventHandlers() + loadReactDom(); + // loadWUserProfileTimeline() + // loadWhoToFollow() + // setupEventHandlers() } catch (err) { console.log('[ERROR] initialize -> err.stack = ' + err.stack) } @@ -100,6 +110,15 @@ function newWebApp() { } } + async function loadReactDom() { + + reactReqs.ReactDOM.render( + reactReqs.ReactBase, + document.getElementById('root') + ); + + } + async function loadWUserProfileTimeline() { let queryMessage = { queryType: SA.projects.socialTrading.globals.queryTypes.EVENTS, @@ -163,8 +182,7 @@ function newWebApp() { postDiv.appendChild(textNode) contentDiv.appendChild(postDiv) } - } - catch (err) { + } catch (err) { console.log('[ERROR] err.stack = ' + err.stack) } } @@ -285,6 +303,7 @@ function newWebApp() { function updateTextArea() { textArea.value = "" } + break } case 'Follow Profile': { @@ -302,6 +321,7 @@ function newWebApp() { button.setAttribute("class", "profile-to-unfollow-button") button.name = 'Unfollow Profile' } + break } case 'Unfollow Profile': { @@ -319,6 +339,7 @@ function newWebApp() { button.setAttribute("class", "profile-to-follow-button") button.name = 'Follow Profile' } + break } } diff --git a/Desktop/WebServer/index.html b/Desktop/WebServer/index.html index 9b57e56e0..ab04c6658 100644 --- a/Desktop/WebServer/index.html +++ b/Desktop/WebServer/index.html @@ -4,8 +4,8 @@
-
|
-
-
|
-
-
|
-
| Profile Pic | -
-
|
-