From 3afa4c7dd8ab2c671743488c0441fa7d04f362e9 Mon Sep 17 00:00:00 2001 From: Jiku Godwill Date: Mon, 24 Jun 2024 07:05:46 +0100 Subject: [PATCH 1/4] Added styles to handle fullscreen on near.social and properly display on near.org as well --- apps/new/widget/Index.jsx | 23 +++++++++++++++++++--- apps/new/widget/page/project/QuickView.jsx | 7 +++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/apps/new/widget/Index.jsx b/apps/new/widget/Index.jsx index a03e7e8d..3cb537fe 100644 --- a/apps/new/widget/Index.jsx +++ b/apps/new/widget/Index.jsx @@ -6,6 +6,21 @@ const { Footer } = VM.require("${config_account}/widget/components.Footer") || { Footer: () => <>, }; +const data = fetch(`https://httpbin.org/headers`); +const gatewayURL = data?.body?.headers?.Origin ?? ""; + +const Container = gatewayURL.includes("near.org") + ? styled.div` + width: 100%; + ` + : styled.div` + position: fixed; + inset: 73px 0px 0px; + width: 100%; + overflow-y: scroll; + height: 100%; + `; + const config = { theme: {}, layout: { @@ -111,7 +126,9 @@ const config = { }; return ( - - - + + + + + ); diff --git a/apps/new/widget/page/project/QuickView.jsx b/apps/new/widget/page/project/QuickView.jsx index ac4574d4..96235816 100644 --- a/apps/new/widget/page/project/QuickView.jsx +++ b/apps/new/widget/page/project/QuickView.jsx @@ -6,6 +6,11 @@ const { href } = VM.require("${alias_old}/widget/lib.url") || { href: () => {}, }; +const data = fetch(`https://httpbin.org/headers`); +const gatewayURL = data?.body?.headers?.Origin ?? ""; + +const isNearDiscovery = gatewayURL.includes("near.org"); + const showCanvas = props.showCanvas; const onClose = props.onClose; const project = props.project; @@ -22,6 +27,7 @@ const profile = { const Container = styled.div` .offcanvas.offcanvas-end { width: 60% !important; + top: 73px; } .close { @@ -86,6 +92,7 @@ return ( tabIndex="-1" data-bs-scroll="false" data-bs-backdrop="true" + style={{ top: isNearDiscovery ? "" : "73px" }} >
From 803bd13d542be7723ab522ec021f508f65088e03 Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> Date: Mon, 24 Jun 2024 14:46:21 +0530 Subject: [PATCH 2/4] fix tests --- playwright-tests/tests/projects.spec.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/playwright-tests/tests/projects.spec.js b/playwright-tests/tests/projects.spec.js index f2d09978..a9c73fa8 100644 --- a/playwright-tests/tests/projects.spec.js +++ b/playwright-tests/tests/projects.spec.js @@ -143,7 +143,7 @@ test.describe("?page=projects", () => { test.beforeEach(async ({ page }) => { const editBtn = page.getByTestId("edit-btn"); - await expect(editBtn).toBeVisible(); + await expect(editBtn).toBeVisible({ timeout: 10000 }); await editBtn.click(); expect(page.url()).toContain("?page=projects&tab=editor"); }); @@ -155,20 +155,10 @@ test.describe("?page=projects", () => { "meghagoel.testnet": { project: { "testing-project-on-builddao": { - "": '{"title":"New project title","description":"New Project description","profileImage":{"ipfs_cid":"bafkreifk42ibqsg5sfky5tlhkfty6rkup5leqite5koenhesnuwq55kufi"},"backgroundImage":{"ipfs_cid":"bafkreidbfu7uxtr4is7wxileg3mrbajve6cgkfmrqemc6pxsr6nnczz7ly"},"tags":{"test":""},"linktree":{"twitter":"https://test.nearbuilders.org/","github":"https://test.nearbuilders.org/","telegram":"https://test.nearbuilders.org/","website":"https://test.nearbuilders.org/"},"contributors":["megha19.testnet"],"tabs":["overview","activity","tasks"],"projectAccountId":"meghagoel.testnet","teamSize":"1-10","location":"New Location"}', + "": '{"title":"New project title","description":"New Project description","profileImage":{"ipfs_cid":"bafkreifk42ibqsg5sfky5tlhkfty6rkup5leqite5koenhesnuwq55kufi"},"backgroundImage":{"ipfs_cid":"bafkreidbfu7uxtr4is7wxileg3mrbajve6cgkfmrqemc6pxsr6nnczz7ly"},"tags":{"test":""},"linktree":{"twitter":"https://test.nearbuilders.org/","github":"https://test.nearbuilders.org/","telegram":"https://test.nearbuilders.org/","website":"https://test.nearbuilders.org/"},"contributors":["meghagoel.testnet"],"tabs":["overview","activity","tasks","updatesfeed","feedbackfeed"],"projectAccountId":"meghagoel.testnet","teamSize":"1-10","location":"New Location"}', metadata: { name: "New project title", description: "New Project description", - - tags: { - test: "", - }, - linktree: { - twitter: - "https://twitter.com/https://test.nearbuilders.org/", - github: "https://github.com/https://test.nearbuilders.org/", - telegram: "https://t.me/https://test.nearbuilders.org/", - }, }, }, }, From 43f413c794245ec43e1e117bd18f2ac408419904 Mon Sep 17 00:00:00 2001 From: Jiku Godwill Date: Mon, 24 Jun 2024 10:39:19 +0100 Subject: [PATCH 3/4] Added fix for everthing gateway as well --- apps/new/widget/Index.jsx | 23 +++++++++++----------- apps/new/widget/page/project/QuickView.jsx | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/apps/new/widget/Index.jsx b/apps/new/widget/Index.jsx index 3cb537fe..9f7f66b2 100644 --- a/apps/new/widget/Index.jsx +++ b/apps/new/widget/Index.jsx @@ -9,17 +9,18 @@ const { Footer } = VM.require("${config_account}/widget/components.Footer") || { const data = fetch(`https://httpbin.org/headers`); const gatewayURL = data?.body?.headers?.Origin ?? ""; -const Container = gatewayURL.includes("near.org") - ? styled.div` - width: 100%; - ` - : styled.div` - position: fixed; - inset: 73px 0px 0px; - width: 100%; - overflow-y: scroll; - height: 100%; - `; +const Container = + gatewayURL.includes("near.org") || gatewayURL.includes("everything.dev") + ? styled.div` + width: 100%; + ` + : styled.div` + position: fixed; + inset: 73px 0px 0px; + width: 100%; + overflow-y: scroll; + height: 100%; + `; const config = { theme: {}, diff --git a/apps/new/widget/page/project/QuickView.jsx b/apps/new/widget/page/project/QuickView.jsx index 96235816..dee9e31c 100644 --- a/apps/new/widget/page/project/QuickView.jsx +++ b/apps/new/widget/page/project/QuickView.jsx @@ -9,7 +9,7 @@ const { href } = VM.require("${alias_old}/widget/lib.url") || { const data = fetch(`https://httpbin.org/headers`); const gatewayURL = data?.body?.headers?.Origin ?? ""; -const isNearDiscovery = gatewayURL.includes("near.org"); +const isNearDiscovery = gatewayURL.includes("near.org") || gatewayURL.includes("everything.dev"); const showCanvas = props.showCanvas; const onClose = props.onClose; From 8c8b883039dd2fd5bda92ed79aef11b92d2c5072 Mon Sep 17 00:00:00 2001 From: Jiku Godwill Date: Mon, 24 Jun 2024 10:40:57 +0100 Subject: [PATCH 4/4] fmt --- apps/new/widget/page/project/QuickView.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/new/widget/page/project/QuickView.jsx b/apps/new/widget/page/project/QuickView.jsx index dee9e31c..8bb034e7 100644 --- a/apps/new/widget/page/project/QuickView.jsx +++ b/apps/new/widget/page/project/QuickView.jsx @@ -9,7 +9,8 @@ const { href } = VM.require("${alias_old}/widget/lib.url") || { const data = fetch(`https://httpbin.org/headers`); const gatewayURL = data?.body?.headers?.Origin ?? ""; -const isNearDiscovery = gatewayURL.includes("near.org") || gatewayURL.includes("everything.dev"); +const isNearDiscovery = + gatewayURL.includes("near.org") || gatewayURL.includes("everything.dev"); const showCanvas = props.showCanvas; const onClose = props.onClose;