+ }
+ src="${alias_mob}/widget/Notification.Item"
+ key={i}
+ props={item}
+ />
+
+ );
+};
+
+return (
+
+);
From 286617f54532c6961b0b76d3566271119334a8c6 Mon Sep 17 00:00:00 2001
From: Zeeshan Ahmad
Date: Mon, 13 May 2024 14:05:02 -0700
Subject: [PATCH 16/18] Add gateway routing (#287)
---
apps/builddao/widget/app.jsx | 19 +-
apps/builddao/widget/app/view.jsx | 2 -
apps/builddao/widget/components/Navbar.jsx | 165 ++++++++++--------
.../widget/components/buttons/Connect.jsx | 20 ++-
.../components/buttons/UserDropdown.jsx | 18 +-
.../widget/components/modals/propose/Text.jsx | 1 -
.../widget/components/project/Card.jsx | 22 ++-
apps/builddao/widget/home/Footer.jsx | 5 +-
apps/builddao/widget/home/Hero.jsx | 20 ++-
apps/builddao/widget/page/feed.jsx | 2 +
apps/builddao/widget/page/home.jsx | 6 +-
apps/builddao/widget/page/projects.jsx | 6 +-
apps/builddao/widget/page/resources.jsx | 2 +
.../widget/template/ProjectLayout.jsx | 37 ++--
.../widget/template/SidebarLayout.jsx | 33 +++-
src/App.js | 54 ++++--
src/pages/Viewer.js | 51 ++++--
17 files changed, 292 insertions(+), 171 deletions(-)
diff --git a/apps/builddao/widget/app.jsx b/apps/builddao/widget/app.jsx
index 8cccc8df..259cb849 100644
--- a/apps/builddao/widget/app.jsx
+++ b/apps/builddao/widget/app.jsx
@@ -23,19 +23,28 @@ const config = {
// customize your header
),
Footer: () => <>>, // customize your footer
},
router: {
param: "page",
+ commonInit: {
+ fromGateway: props.fromGateway,
+ },
routes: {
home: {
path: "${config_account}/widget/page.home",
blockHeight: "final",
init: {
name: "Home",
+ ...commonInit,
},
default: true,
},
@@ -44,6 +53,7 @@ const config = {
blockHeight: "final",
init: {
name: "Activity",
+ ...commonInit,
},
},
projects: {
@@ -51,6 +61,7 @@ const config = {
blockHeight: "final",
init: {
name: "Projects",
+ ...commonInit,
},
hide: true,
},
@@ -59,6 +70,7 @@ const config = {
blockHeight: "final",
init: {
name: "Proposals",
+ ...commonInit,
},
hide: true,
},
@@ -67,6 +79,7 @@ const config = {
blockHeight: "final",
init: {
name: "Resources",
+ ...commonInit,
},
},
library: {
@@ -74,6 +87,7 @@ const config = {
blockHeight: "final",
init: {
name: "Library",
+ ...commonInit,
},
},
profile: {
@@ -81,6 +95,7 @@ const config = {
blockHeight: "final",
init: {
name: "Profile",
+ ...commonInit,
},
hide: true,
},
@@ -89,6 +104,7 @@ const config = {
blockHeight: "final",
init: {
name: "Inspect",
+ ...commonInit,
},
hide: true,
},
@@ -97,6 +113,7 @@ const config = {
blockHeight: "final",
init: {
name: "Project Page",
+ ...commonInit,
},
hide: true,
},
diff --git a/apps/builddao/widget/app/view.jsx b/apps/builddao/widget/app/view.jsx
index ef0262c3..fc08e048 100644
--- a/apps/builddao/widget/app/view.jsx
+++ b/apps/builddao/widget/app/view.jsx
@@ -32,8 +32,6 @@ if (!config) {
}
}
-console.log("config", config);
-
if (!config) {
return (
diff --git a/apps/builddao/widget/components/Navbar.jsx b/apps/builddao/widget/components/Navbar.jsx
index 69b5d4b8..665be728 100644
--- a/apps/builddao/widget/components/Navbar.jsx
+++ b/apps/builddao/widget/components/Navbar.jsx
@@ -239,6 +239,7 @@ const unreadNotifications = getNotificationCount();
function Navbar(props) {
const { page, routes } = props;
const [dropdown, setDropdown] = useState(false);
+ const fromGateway = props.fromGateway ?? false;
const toggleDropdown = () => {
setDropdown((prev) => !prev);
@@ -263,12 +264,16 @@ function Navbar(props) {
{route.init.icon && }
@@ -309,12 +320,16 @@ function Navbar(props) {
{unreadNotifications > 0 && (
@@ -345,56 +360,52 @@ function Navbar(props) {
gap: "0.5rem",
}}
>
-
-
-
-
-
-
-
- View source
-
-
-
-
-
- Edit code
-
-
-
-
+
+
+
+
+
+
+ View source
+
+
+
+
+
+ Edit code
+
+
+
{context.accountId ? (
View source
diff --git a/apps/builddao/widget/components/buttons/Connect.jsx b/apps/builddao/widget/components/buttons/Connect.jsx
index f36a0ea2..3fbbb7cd 100644
--- a/apps/builddao/widget/components/buttons/Connect.jsx
+++ b/apps/builddao/widget/components/buttons/Connect.jsx
@@ -128,7 +128,7 @@ const { href: linkHref } = VM.require("${config_account}/widget/lib.url") || {
href: () => {},
};
-const Component = () => {
+const Component = (props) => {
if (!context.accountId) {
return (
{
View Activity{" "}
{
return (
-
+
);
diff --git a/apps/builddao/widget/components/buttons/UserDropdown.jsx b/apps/builddao/widget/components/buttons/UserDropdown.jsx
index 7066b3c4..fa0863ef 100644
--- a/apps/builddao/widget/components/buttons/UserDropdown.jsx
+++ b/apps/builddao/widget/components/buttons/UserDropdown.jsx
@@ -178,13 +178,17 @@ return (
My Profile
diff --git a/apps/builddao/widget/components/modals/propose/Text.jsx b/apps/builddao/widget/components/modals/propose/Text.jsx
index 6db3c364..6077114f 100644
--- a/apps/builddao/widget/components/modals/propose/Text.jsx
+++ b/apps/builddao/widget/components/modals/propose/Text.jsx
@@ -183,7 +183,6 @@ return (
proposalType: "Add Member",
}}
/>
- {/* {console.log(notificationsData)} */}
{
+const ProjectCard = ({ project, type, fromGateway }) => {
const {
accountId,
projectAccountId,
@@ -118,14 +118,18 @@ const ProjectCard = ({ project, type }) => {
diff --git a/apps/builddao/widget/home/Footer.jsx b/apps/builddao/widget/home/Footer.jsx
index f0f093f5..8166cfdb 100644
--- a/apps/builddao/widget/home/Footer.jsx
+++ b/apps/builddao/widget/home/Footer.jsx
@@ -116,10 +116,10 @@ const XIcon = () => (
);
-const Footer = ({ noBanner }) => {
+const Footer = (props) => {
return (
- {!noBanner && (
+ {!props.noBanner && (
@@ -133,6 +133,7 @@ const Footer = ({ noBanner }) => {
joinBtnChildren: "Join Now",
showActivity: true,
className: "custom-button",
+ fromGateway: props.fromGateway,
}}
/>
diff --git a/apps/builddao/widget/home/Hero.jsx b/apps/builddao/widget/home/Hero.jsx
index bed0a3eb..92810496 100644
--- a/apps/builddao/widget/home/Hero.jsx
+++ b/apps/builddao/widget/home/Hero.jsx
@@ -229,14 +229,14 @@ const Hero = (props) => {
{currentGateway && !signedIn ? (
<>
-
Create Trial Account
-
+
Try out the Builders Gateway with a trial account.
@@ -246,12 +246,16 @@ const Hero = (props) => {
) : (
<>
See Activity
diff --git a/apps/builddao/widget/page/feed.jsx b/apps/builddao/widget/page/feed.jsx
index 07d12fa8..4cd471e7 100644
--- a/apps/builddao/widget/page/feed.jsx
+++ b/apps/builddao/widget/page/feed.jsx
@@ -154,8 +154,10 @@ return (
{/* */}
{/* */}
-
+
{/* */}
-
-
+
+
);
diff --git a/apps/builddao/widget/page/projects.jsx b/apps/builddao/widget/page/projects.jsx
index 9762a656..d5993b41 100644
--- a/apps/builddao/widget/page/projects.jsx
+++ b/apps/builddao/widget/page/projects.jsx
@@ -272,7 +272,11 @@ return (
No Projects Found
)}
{filteredProjects.map((project) => (
-
+
))}
diff --git a/apps/builddao/widget/page/resources.jsx b/apps/builddao/widget/page/resources.jsx
index 019469ec..570359ed 100644
--- a/apps/builddao/widget/page/resources.jsx
+++ b/apps/builddao/widget/page/resources.jsx
@@ -53,8 +53,10 @@ return (
{
const { title } = project;
@@ -120,12 +121,16 @@ const ProjectLayout = ({
Back to Projects
@@ -184,14 +189,18 @@ const ProjectLayout = ({
Object.keys(routes).map((it) => (
diff --git a/apps/builddao/widget/template/SidebarLayout.jsx b/apps/builddao/widget/template/SidebarLayout.jsx
index 54f7ecce..401ce3ad 100644
--- a/apps/builddao/widget/template/SidebarLayout.jsx
+++ b/apps/builddao/widget/template/SidebarLayout.jsx
@@ -39,7 +39,7 @@ const ContentContainer = styled.div`
grid-column: span 4 / span 4;
`;
-const Sidebar = ({ currentPath, page, routes }) => (
+const Sidebar = ({ currentPath, currentPage, page, routes, fromGateway }) => (
<>
{routes &&
(Object.keys(routes) || []).map((k) => {
@@ -47,11 +47,21 @@ const Sidebar = ({ currentPath, page, routes }) => (
if (route.hide) {
return null;
}
+ let defaultSelection = "";
+ if (!page) {
+ defaultSelection = Object.keys(routes)[0];
+ }
return (
(
);
// Define the new component that follows the SidebarLayout pattern
-function SidebarLayout({ currentPath, routes, page, children }) {
+function SidebarLayout({
+ currentPath,
+ currentPage,
+ routes,
+ page,
+ children,
+ fromGateway,
+}) {
return (
-
+
{children}
diff --git a/src/App.js b/src/App.js
index 04b11443..d3f90560 100644
--- a/src/App.js
+++ b/src/App.js
@@ -25,13 +25,7 @@ import {
import React, { useCallback, useEffect, useState } from "react";
import "react-bootstrap-typeahead/css/Typeahead.bs5.css";
import "react-bootstrap-typeahead/css/Typeahead.css";
-import {
- Link,
- Redirect,
- Route,
- BrowserRouter as Router,
- Switch,
-} from "react-router-dom";
+import { Link, Route, BrowserRouter as Router, Switch } from "react-router-dom";
import { BosLoaderBanner } from "./components/BosLoaderBanner";
import { useEthersProviderContext } from "./data/web3";
import { NetworkId, Widgets } from "./data/widgets";
@@ -206,8 +200,6 @@ function App() {
currentGateway,
};
- const index = Widgets.default;
-
return (
@@ -225,20 +217,44 @@ function App() {
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
diff --git a/src/pages/Viewer.js b/src/pages/Viewer.js
index 9479c13a..7db4ca34 100644
--- a/src/pages/Viewer.js
+++ b/src/pages/Viewer.js
@@ -4,25 +4,12 @@ import { useLocation, useParams } from "react-router-dom";
const SESSION_STORAGE_REDIRECT_MAP_KEY = "nearSocialVMredirectMap";
-function Viewer({ code, widgets }) {
- const { path } = useParams(); // get path from url, could be socialdb path or relative to "core"
+function Viewer({ code, page, tab, widgets }) {
+ // get path from url, could be socialdb path or relative to "core"
+ const { path, feedTab, widgetSrc, projectId } = useParams();
const location = useLocation(); // get query params from url
const searchParams = new URLSearchParams(location.search);
- // create props from params
- const passProps = useMemo(() => {
- return Array.from(searchParams.entries()).reduce((props, [key, value]) => {
- props[key] = value;
- return props;
- }, {});
- }, [location]);
-
- const src = useMemo(() => {
- const defaultSrc = widgets.default; // default widget to load
- const pathSrc = path || defaultSrc; // if no path, load default widget
- return pathSrc;
- }, [path]);
-
const [redirectMap, setRedirectMap] = useState(null);
useEffect(() => {
@@ -50,12 +37,44 @@ function Viewer({ code, widgets }) {
fetchRedirectMap();
}, []);
+ // create props from params
+ const passProps = useMemo(() => {
+ return Array.from(searchParams.entries()).reduce((props, [key, value]) => {
+ props[key] = value;
+ return props;
+ }, {});
+ }, [location]);
+
+ if (page) {
+ return (
+
+ );
+ }
+
+ const src = useMemo(() => {
+ const defaultSrc = widgets.default; // default widget to load
+ const pathSrc = path || defaultSrc; // if no path, load default widget
+ return pathSrc;
+ }, [path]);
+
return (
Date: Tue, 14 May 2024 00:48:20 -0400
Subject: [PATCH 17/18] Revert "Add gateway routing (#287)" (#295)
This reverts commit a5c75288a74e80d8a303a6910885d589ce9050c7.
---
apps/builddao/widget/app.jsx | 19 +-
apps/builddao/widget/app/view.jsx | 2 +
apps/builddao/widget/components/Navbar.jsx | 165 ++++++++----------
.../widget/components/buttons/Connect.jsx | 20 +--
.../components/buttons/UserDropdown.jsx | 18 +-
.../widget/components/modals/propose/Text.jsx | 1 +
.../widget/components/project/Card.jsx | 22 +--
apps/builddao/widget/home/Footer.jsx | 5 +-
apps/builddao/widget/home/Hero.jsx | 20 +--
apps/builddao/widget/page/feed.jsx | 2 -
apps/builddao/widget/page/home.jsx | 6 +-
apps/builddao/widget/page/projects.jsx | 6 +-
apps/builddao/widget/page/resources.jsx | 2 -
.../widget/template/ProjectLayout.jsx | 37 ++--
.../widget/template/SidebarLayout.jsx | 33 +---
src/App.js | 54 ++----
src/pages/Viewer.js | 51 ++----
17 files changed, 171 insertions(+), 292 deletions(-)
diff --git a/apps/builddao/widget/app.jsx b/apps/builddao/widget/app.jsx
index 259cb849..8cccc8df 100644
--- a/apps/builddao/widget/app.jsx
+++ b/apps/builddao/widget/app.jsx
@@ -23,28 +23,19 @@ const config = {
// customize your header
),
Footer: () => <>>, // customize your footer
},
router: {
param: "page",
- commonInit: {
- fromGateway: props.fromGateway,
- },
routes: {
home: {
path: "${config_account}/widget/page.home",
blockHeight: "final",
init: {
name: "Home",
- ...commonInit,
},
default: true,
},
@@ -53,7 +44,6 @@ const config = {
blockHeight: "final",
init: {
name: "Activity",
- ...commonInit,
},
},
projects: {
@@ -61,7 +51,6 @@ const config = {
blockHeight: "final",
init: {
name: "Projects",
- ...commonInit,
},
hide: true,
},
@@ -70,7 +59,6 @@ const config = {
blockHeight: "final",
init: {
name: "Proposals",
- ...commonInit,
},
hide: true,
},
@@ -79,7 +67,6 @@ const config = {
blockHeight: "final",
init: {
name: "Resources",
- ...commonInit,
},
},
library: {
@@ -87,7 +74,6 @@ const config = {
blockHeight: "final",
init: {
name: "Library",
- ...commonInit,
},
},
profile: {
@@ -95,7 +81,6 @@ const config = {
blockHeight: "final",
init: {
name: "Profile",
- ...commonInit,
},
hide: true,
},
@@ -104,7 +89,6 @@ const config = {
blockHeight: "final",
init: {
name: "Inspect",
- ...commonInit,
},
hide: true,
},
@@ -113,7 +97,6 @@ const config = {
blockHeight: "final",
init: {
name: "Project Page",
- ...commonInit,
},
hide: true,
},
diff --git a/apps/builddao/widget/app/view.jsx b/apps/builddao/widget/app/view.jsx
index fc08e048..ef0262c3 100644
--- a/apps/builddao/widget/app/view.jsx
+++ b/apps/builddao/widget/app/view.jsx
@@ -32,6 +32,8 @@ if (!config) {
}
}
+console.log("config", config);
+
if (!config) {
return (
diff --git a/apps/builddao/widget/components/Navbar.jsx b/apps/builddao/widget/components/Navbar.jsx
index 665be728..69b5d4b8 100644
--- a/apps/builddao/widget/components/Navbar.jsx
+++ b/apps/builddao/widget/components/Navbar.jsx
@@ -239,7 +239,6 @@ const unreadNotifications = getNotificationCount();
function Navbar(props) {
const { page, routes } = props;
const [dropdown, setDropdown] = useState(false);
- const fromGateway = props.fromGateway ?? false;
const toggleDropdown = () => {
setDropdown((prev) => !prev);
@@ -264,16 +263,12 @@ function Navbar(props) {
{route.init.icon && }
@@ -320,16 +309,12 @@ function Navbar(props) {
{unreadNotifications > 0 && (
@@ -360,52 +345,56 @@ function Navbar(props) {
gap: "0.5rem",
}}
>
-
-
-
-
-
-
- View source
-
-
-
-
-
- Edit code
-
-
-
+
+
+
+
+
+
+
+ View source
+
+
+
+
+
+ Edit code
+
+
+
+
{context.accountId ? (
View source
diff --git a/apps/builddao/widget/components/buttons/Connect.jsx b/apps/builddao/widget/components/buttons/Connect.jsx
index 3fbbb7cd..f36a0ea2 100644
--- a/apps/builddao/widget/components/buttons/Connect.jsx
+++ b/apps/builddao/widget/components/buttons/Connect.jsx
@@ -128,7 +128,7 @@ const { href: linkHref } = VM.require("${config_account}/widget/lib.url") || {
href: () => {},
};
-const Component = (props) => {
+const Component = () => {
if (!context.accountId) {
return (
{
View Activity{" "}
{
return (
-
+
);
diff --git a/apps/builddao/widget/components/buttons/UserDropdown.jsx b/apps/builddao/widget/components/buttons/UserDropdown.jsx
index fa0863ef..7066b3c4 100644
--- a/apps/builddao/widget/components/buttons/UserDropdown.jsx
+++ b/apps/builddao/widget/components/buttons/UserDropdown.jsx
@@ -178,17 +178,13 @@ return (
My Profile
diff --git a/apps/builddao/widget/components/modals/propose/Text.jsx b/apps/builddao/widget/components/modals/propose/Text.jsx
index 6077114f..6db3c364 100644
--- a/apps/builddao/widget/components/modals/propose/Text.jsx
+++ b/apps/builddao/widget/components/modals/propose/Text.jsx
@@ -183,6 +183,7 @@ return (
proposalType: "Add Member",
}}
/>
+ {/* {console.log(notificationsData)} */}
{
+const ProjectCard = ({ project, type }) => {
const {
accountId,
projectAccountId,
@@ -118,18 +118,14 @@ const ProjectCard = ({ project, type, fromGateway }) => {
diff --git a/apps/builddao/widget/home/Footer.jsx b/apps/builddao/widget/home/Footer.jsx
index 8166cfdb..f0f093f5 100644
--- a/apps/builddao/widget/home/Footer.jsx
+++ b/apps/builddao/widget/home/Footer.jsx
@@ -116,10 +116,10 @@ const XIcon = () => (
);
-const Footer = (props) => {
+const Footer = ({ noBanner }) => {
return (
- {!props.noBanner && (
+ {!noBanner && (
@@ -133,7 +133,6 @@ const Footer = (props) => {
joinBtnChildren: "Join Now",
showActivity: true,
className: "custom-button",
- fromGateway: props.fromGateway,
}}
/>
diff --git a/apps/builddao/widget/home/Hero.jsx b/apps/builddao/widget/home/Hero.jsx
index 92810496..bed0a3eb 100644
--- a/apps/builddao/widget/home/Hero.jsx
+++ b/apps/builddao/widget/home/Hero.jsx
@@ -229,14 +229,14 @@ const Hero = (props) => {
{currentGateway && !signedIn ? (
<>
-
Create Trial Account
-
+
Try out the Builders Gateway with a trial account.
@@ -246,16 +246,12 @@ const Hero = (props) => {
) : (
<>
See Activity
diff --git a/apps/builddao/widget/page/feed.jsx b/apps/builddao/widget/page/feed.jsx
index 4cd471e7..07d12fa8 100644
--- a/apps/builddao/widget/page/feed.jsx
+++ b/apps/builddao/widget/page/feed.jsx
@@ -154,10 +154,8 @@ return (
{/* */}
{/* */}
-
+
{/* */}
-
-
+
+
);
diff --git a/apps/builddao/widget/page/projects.jsx b/apps/builddao/widget/page/projects.jsx
index d5993b41..9762a656 100644
--- a/apps/builddao/widget/page/projects.jsx
+++ b/apps/builddao/widget/page/projects.jsx
@@ -272,11 +272,7 @@ return (
No Projects Found
)}
{filteredProjects.map((project) => (
-
+
))}
diff --git a/apps/builddao/widget/page/resources.jsx b/apps/builddao/widget/page/resources.jsx
index 570359ed..019469ec 100644
--- a/apps/builddao/widget/page/resources.jsx
+++ b/apps/builddao/widget/page/resources.jsx
@@ -53,10 +53,8 @@ return (
{
const { title } = project;
@@ -121,16 +120,12 @@ const ProjectLayout = ({
Back to Projects
@@ -189,18 +184,14 @@ const ProjectLayout = ({
Object.keys(routes).map((it) => (
diff --git a/apps/builddao/widget/template/SidebarLayout.jsx b/apps/builddao/widget/template/SidebarLayout.jsx
index 401ce3ad..54f7ecce 100644
--- a/apps/builddao/widget/template/SidebarLayout.jsx
+++ b/apps/builddao/widget/template/SidebarLayout.jsx
@@ -39,7 +39,7 @@ const ContentContainer = styled.div`
grid-column: span 4 / span 4;
`;
-const Sidebar = ({ currentPath, currentPage, page, routes, fromGateway }) => (
+const Sidebar = ({ currentPath, page, routes }) => (
<>
{routes &&
(Object.keys(routes) || []).map((k) => {
@@ -47,21 +47,11 @@ const Sidebar = ({ currentPath, currentPage, page, routes, fromGateway }) => (
if (route.hide) {
return null;
}
- let defaultSelection = "";
- if (!page) {
- defaultSelection = Object.keys(routes)[0];
- }
return (
(
);
// Define the new component that follows the SidebarLayout pattern
-function SidebarLayout({
- currentPath,
- currentPage,
- routes,
- page,
- children,
- fromGateway,
-}) {
+function SidebarLayout({ currentPath, routes, page, children }) {
return (
-
+
{children}
diff --git a/src/App.js b/src/App.js
index d3f90560..04b11443 100644
--- a/src/App.js
+++ b/src/App.js
@@ -25,7 +25,13 @@ import {
import React, { useCallback, useEffect, useState } from "react";
import "react-bootstrap-typeahead/css/Typeahead.bs5.css";
import "react-bootstrap-typeahead/css/Typeahead.css";
-import { Link, Route, BrowserRouter as Router, Switch } from "react-router-dom";
+import {
+ Link,
+ Redirect,
+ Route,
+ BrowserRouter as Router,
+ Switch,
+} from "react-router-dom";
import { BosLoaderBanner } from "./components/BosLoaderBanner";
import { useEthersProviderContext } from "./data/web3";
import { NetworkId, Widgets } from "./data/widgets";
@@ -200,6 +206,8 @@ function App() {
currentGateway,
};
+ const index = Widgets.default;
+
return (
@@ -217,44 +225,20 @@ function App() {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
diff --git a/src/pages/Viewer.js b/src/pages/Viewer.js
index 7db4ca34..9479c13a 100644
--- a/src/pages/Viewer.js
+++ b/src/pages/Viewer.js
@@ -4,12 +4,25 @@ import { useLocation, useParams } from "react-router-dom";
const SESSION_STORAGE_REDIRECT_MAP_KEY = "nearSocialVMredirectMap";
-function Viewer({ code, page, tab, widgets }) {
- // get path from url, could be socialdb path or relative to "core"
- const { path, feedTab, widgetSrc, projectId } = useParams();
+function Viewer({ code, widgets }) {
+ const { path } = useParams(); // get path from url, could be socialdb path or relative to "core"
const location = useLocation(); // get query params from url
const searchParams = new URLSearchParams(location.search);
+ // create props from params
+ const passProps = useMemo(() => {
+ return Array.from(searchParams.entries()).reduce((props, [key, value]) => {
+ props[key] = value;
+ return props;
+ }, {});
+ }, [location]);
+
+ const src = useMemo(() => {
+ const defaultSrc = widgets.default; // default widget to load
+ const pathSrc = path || defaultSrc; // if no path, load default widget
+ return pathSrc;
+ }, [path]);
+
const [redirectMap, setRedirectMap] = useState(null);
useEffect(() => {
@@ -37,44 +50,12 @@ function Viewer({ code, page, tab, widgets }) {
fetchRedirectMap();
}, []);
- // create props from params
- const passProps = useMemo(() => {
- return Array.from(searchParams.entries()).reduce((props, [key, value]) => {
- props[key] = value;
- return props;
- }, {});
- }, [location]);
-
- if (page) {
- return (
-
- );
- }
-
- const src = useMemo(() => {
- const defaultSrc = widgets.default; // default widget to load
- const pathSrc = path || defaultSrc; // if no path, load default widget
- return pathSrc;
- }, [path]);
-
return (
Date: Tue, 14 May 2024 12:42:21 +0530
Subject: [PATCH 18/18] added changelog file and updated version in
package.json
---
CHANGELOG.md | 20 ++++++++++++++++++++
package.json | 4 ++--
2 files changed, 22 insertions(+), 2 deletions(-)
create mode 100644 CHANGELOG.md
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 00000000..52ca4a32
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,20 @@
+# Change Log
+
+## Version v1.0.0 - 2024-05-14
+
+### Features
+
+- Mintbase wallet added to selector. #275
+- Integrated google calendar for events. #285
+- Import projects from Poltock. #262
+- Test button in navbar #289
+- Notifications page #282
+
+### Bug Fixes
+
+- Notification component error.
+
+### Refactor and chores
+
+- Code cleanup #276 #279
+- Added playwright tests setup #277
diff --git a/package.json b/package.json
index 0ac1fe6b..a6cd85d5 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
- "name": "frontend",
- "version": "0.18.1",
+ "name": "builddao",
+ "version": "1.0.0",
"homepage": "/",
"private": true,
"dependencies": {