Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Mar 21, 2023
1 parent 46c6a06 commit 9a42f22
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 25 deletions.
15 changes: 4 additions & 11 deletions userfiles/modules/microweber/api/live-edit-app/app.tsx
@@ -1,22 +1,15 @@

import React, { useEffect, useRef , useContext} from 'react';
import React, { useEffect, useRef , useContext, createContext} from 'react';
import { createRoot } from 'react-dom/client'
import Game from './test'
import ServiceContainer from './components/ServiceContainer'
import LiveEditorFrame from './components/LiveEditorFrame'
import Test from './components/Test'

import './style.css'
import LiveEditor from "./components/LiveEditorFrame";
import './style.css'

export default function LiveEditApp(){

return(
<>
<LiveEditor />

<Test />
<Test />
</>

);
}

Expand Down
@@ -1,9 +1,8 @@
import React, { useEffect, useRef,useState,createContext,useContext} from 'react';

import LiveEdit from '../../liveedit2/@live.js'
import LiveEdit from '../../liveedit2/@live.js'


function LiveEditor() {
function LiveEditorFrame() {
const frameRef = useRef(null);
const frameUrl = useRef(null);
const frameHolderRef = useRef(null);
Expand Down Expand Up @@ -37,17 +36,11 @@ function LiveEditor() {
liveEdit.moduleHandle.on('targetChange', function (target) {

});
const LiveEditContext = createContext(liveEdit);


// const theme = useContext(LiveEditContext);

liveEdit.name = 'liveEdit';
mw.spinner({
element: frameHolder
}).remove();

//window.liveEditApp.register(liveEdit);
mw.trigger('LiveEdit::ready', liveEdit);
});

Expand All @@ -66,4 +59,4 @@ function LiveEditor() {
);
}

export default LiveEditor;
export default LiveEditorFrame;
@@ -1,20 +1,22 @@
import React, { useEffect, useRef,useState,createContext,useContext} from 'react';

const LiveEditContext = createContext();
import {LiveEditContext} from "./contexts/live-edit-context";

function Test() {
const frameRef = useRef(null);
const frameUrl = useRef(null);
const frameHolderRef = useRef(null);
const [frameSrc, setFrameSrc] = useState(null);
const theme = useContext(LiveEditContext);
const ebasi = LiveEditContext;

useEffect(() => {

mw.log(ebasi);

},[]);

return (
<div>
aaaa
wow!
</div>
);
}
Expand Down
@@ -0,0 +1,5 @@
import React, { createContext} from 'react';

export const LiveEditContext = {
bojkata:123,
};

0 comments on commit 9a42f22

Please sign in to comment.