Skip to content

Commit

Permalink
updates nested app
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotBraem committed Jan 16, 2024
1 parent 1097328 commit 73ffb5f
Show file tree
Hide file tree
Showing 5 changed files with 448 additions and 183 deletions.
4 changes: 3 additions & 1 deletion apps/main/widget/app.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/**
* Every app is structured the same
*/
const { page, layout, loading, routes, ...passProps } = props;
const { page, layout, loading, ...passProps } = props;

const { routes } = props.data

// const { AppLayout } =
// VM.require("devhub.near/widget/devhub.components.templates.AppLayout") ||
Expand Down
162 changes: 5 additions & 157 deletions apps/main/widget/core.jsx
Original file line number Diff line number Diff line change
@@ -1,162 +1,10 @@
const routes = {
home: {
// project Id
path: "hack.near/widget/dev.social",
blockHeight: "final",
init: {
name: "Home",
description: "Home",
icon: "bi bi-house",
},
},
discover: {
path: "efiz.near/widget/Things.index",
blockHeight: "final",
init: {
icon: "bi bi-globe",
},
},
tree: {
path: "efiz.near/widget/Tree",
blockHeight: "final",
init: {
icon: "bi bi-tree",
},
},
search: {
path: "chaotictempest.near/widget/Search",
blockHeight: "final",
init: {
icon: "bi bi-search",
},
},
create: {
path: "create.near/widget/home",
blockHeight: "final",
init: {
icon: "bi bi-plus-circle",
},
},
events: {
path: "itexpert120-contra.near/widget/Events",
blockHeight: "final",
init: {
icon: "bi bi-calendar",
},
},
editor: {
path: "every.near/widget/editor",
blockHeight: "final",
init: {
icon: "bi bi-pencil",
},
},
hashtag: {
path: "efiz.near/widget/every.hashtag",
blockHeight: "final",
init: {
icon: "bi bi-hash",
},
},
social: {
path: "mob.near/widget/N",
blockHeight: "final",
init: {
icon: "bi bi-people",
},
},
map: {
path: "hack.near/widget/Map.tutorial",
blockHeight: "final",
init: {
icon: "bi bi-map",
},
},
marketplace: {
path: "mintbase.near/widget/nft-marketplace",
blockHeight: "final",
init: {
icon: "bi bi-cart",
},
},
blocks: {
path: "devs.near/widget/Module.Feed.demo",
blockHeight: "final",
init: {
icon: "bi bi-boxes",
},
},
voyager: {
path: "efiz.near/widget/voyager.index",
blockHeight: "final",
init: {
icon: "bi bi-rocket",
},
},
video: {
path: "efiz.near/widget/App.index",
blockHeight: "final",
init: {
icon: "bi bi-camera-video",
},
},
files: {
path: "hyperfiles.near/widget/app",
blockHeight: "final",
init: {
icon: "bi bi-files",
},
},
graph: {
path: "efiz.near/widget/SocialGraph",
blockHeight: "final",
init: {
icon: "bi bi-stars",
},
},
plugins: {
path: "embeds.near/widget/Plugin.Index",
blockHeight: "final",
init: {
icon: "bi bi-plug",
},
},
build: {
path: "buildhub.near/widget/Feed",
blockHeight: "final",
init: {
icon: "bi bi-hammer",
},
},
music: {
path: "jaswinder.near/widget/MusicPlayer-Harmonic",
blockHeight: "final",
init: {
icon: "bi bi-music-note",
},
},
core: {
path: "efiz.near/thing/core",
blockHeight: "final",
init: {
icon: "bi bi-dot",
},
},
inspect: {
path: "mob.near/widget/WidgetSource",
blockHeight: "final",
hide: true,
},
notifications: {
path: "mob.near/widget/NotificationFeed",
blockHeight: "final",
hide: true,
},
};
const data = JSON.parse(
Social.get("efiz.near/thing/routes", "final") || "null"
);

return (
<Widget
src={"every.near/widget/app"}
props={{ routes, path: "", ...props }}
props={{ data, path: "", ...props }}
/>
);
);
12 changes: 6 additions & 6 deletions apps/main/widget/thing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,11 @@ function Thing() {
console.log(
`edge case: thing ${path} had an invalid type: ${thingType}`
);
// typeObj = {
// widgets: {
// view: "every.near/widget/app", // this is temp cuz I know it's the app type
// },
// };
typeObj = {
widgets: {
view: "every.near/widget/app", // this is temp cuz I know it's the app type
},
};
}
// const { get } = VM.require(thing.adapter || (() => {}));

Expand Down Expand Up @@ -293,7 +293,7 @@ function Thing() {
return (
<Widget
src={widgetSrc}
props={{ data: thing.data, path, blockHeight }}
props={{ data: thing, path, blockHeight }}
/>
);
}
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"bn.js": "^5.1.1",
"bootstrap": "^5.2.1",
"bootstrap-icons": "^1.9.0",
"bos-workspace": "^0.0.1-alpha.4",
"collections": "^5.1.12",
"dompurify": "^3.0.6",
"error-polyfill": "^0.1.2",
Expand All @@ -46,6 +47,7 @@
"serve": "webpack serve",
"webpack": "webpack",
"dev": "npm run serve -- --env mode=development",
"dev:bos": "bos-workspace dev",
"prod": "npm run webpack -- --env mode=production",
"prod:analyze": "npm run prod -- --env presets=analyze",
"build": "npm run prod",
Expand Down
Loading

1 comment on commit 73ffb5f

@vercel
Copy link

@vercel vercel bot commented on 73ffb5f Jan 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.