Skip to content

Commit

Permalink
get to display elements in the preview window
Browse files Browse the repository at this point in the history
  • Loading branch information
christabusho committed Jul 30, 2024
1 parent 0a6f725 commit 755d9f5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
13 changes: 12 additions & 1 deletion @empirica-mocks/core/mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export function usePlayers() {
// Mock implementation of useGlobal
export function useGlobal() {
// This is a mock function that returns a mock global object
//console.log("useGlobal")
const global = {
isMock: true,
recruitingBatchConfig: {
Expand All @@ -87,9 +88,19 @@ export function useGlobal() {
resourceLookup: {
cdn: 'local',
},
get: (varName) => {
cdnList: {
test: "http://localhost:9091",
local: "http://localhost:9090",
prod: "https://s3.amazonaws.com/assets.deliberation-lab.org",
},
get: function (varName) {
return this[varName];
}
};
return global;
}

// Mock implementation of Loading
export function Loading() {
return "Loading...";
}
2 changes: 1 addition & 1 deletion @empirica-mocks/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"require": "./dist/player.cjs"
},
"./player/react": {
"import": "./react-mocks.js"
"import": "./mocks.js"
},
"./player/classic": {
"types": "./dist/player-classic.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/app/editor/components/CodeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default function CodeEditor() {
localStorage.setItem("code", code);
window.location.reload(); //refresh page to make elements appear on screen
} catch (YAMLParseError) {
console.log("Parse Error on Save", YAMLParseError )
//TODO also display a little something went wrong pop up
}
}
Expand Down

0 comments on commit 755d9f5

Please sign in to comment.