From 201686d8612bbe8725245a4a48c2993300340a43 Mon Sep 17 00:00:00 2001 From: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> Date: Sun, 28 Apr 2024 01:06:32 -0400 Subject: [PATCH 01/18] replaces gateway_url per environment --- apps/builddao/data.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/builddao/data.json b/apps/builddao/data.json index e4396395..06c23617 100644 --- a/apps/builddao/data.json +++ b/apps/builddao/data.json @@ -1,3 +1,3 @@ { - "buildhub.near": {} + "builddao.testnet": {} } From baa596f7934e889736bc3e864e8960444825f2d7 Mon Sep 17 00:00:00 2001 From: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> Date: Wed, 1 May 2024 20:40:38 -0400 Subject: [PATCH 02/18] add weekly promotion --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index dffd3435..afcb2db1 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1 @@ -* @Megha-Dev-19 @itexpert120 @Jikugodwill @elliotBraem @saadiqbal-dev +- @Megha-Dev-19 @itexpert120 @Jikugodwill @elliotBraem @saadiqbal-dev From 3d69a995308228e451ab7cf5eec3dbb4c0d8be25 Mon Sep 17 00:00:00 2001 From: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> Date: Thu, 2 May 2024 22:45:59 -0400 Subject: [PATCH 03/18] init new --- .gitignore | 1 + .../aliases.mainnet.json => aliases.mainnet.json | 0 .../aliases.testnet.json => aliases.testnet.json | 0 apps/builddao/bos.config.json | 4 ++-- apps/builddao/data.json | 3 --- apps/new/bos.config.json | 10 ++++++++++ apps/new/widget/Index.jsx | 1 + 7 files changed, 14 insertions(+), 5 deletions(-) rename apps/builddao/aliases.mainnet.json => aliases.mainnet.json (100%) rename apps/builddao/aliases.testnet.json => aliases.testnet.json (100%) delete mode 100644 apps/builddao/data.json create mode 100644 apps/new/bos.config.json create mode 100644 apps/new/widget/Index.jsx diff --git a/.gitignore b/.gitignore index 758fca2a..bb8d4523 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ yarn-error.log* target neardev +data.json diff --git a/apps/builddao/aliases.mainnet.json b/aliases.mainnet.json similarity index 100% rename from apps/builddao/aliases.mainnet.json rename to aliases.mainnet.json diff --git a/apps/builddao/aliases.testnet.json b/aliases.testnet.json similarity index 100% rename from apps/builddao/aliases.testnet.json rename to aliases.testnet.json diff --git a/apps/builddao/bos.config.json b/apps/builddao/bos.config.json index 79887374..699b30dc 100644 --- a/apps/builddao/bos.config.json +++ b/apps/builddao/bos.config.json @@ -1,10 +1,10 @@ { "account": "buildhub.near", - "aliases": ["./aliases.mainnet.json"], + "aliases": ["../../aliases.mainnet.json"], "overrides": { "testnet": { "account": "builddao.testnet", - "aliases": ["./aliases.testnet.json"] + "aliases": ["../../aliases.testnet.json"] } } } diff --git a/apps/builddao/data.json b/apps/builddao/data.json deleted file mode 100644 index 06c23617..00000000 --- a/apps/builddao/data.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "builddao.testnet": {} -} diff --git a/apps/new/bos.config.json b/apps/new/bos.config.json new file mode 100644 index 00000000..1fd40c67 --- /dev/null +++ b/apps/new/bos.config.json @@ -0,0 +1,10 @@ +{ + "account": "new", + "aliases": ["../../aliases.mainnet.json"], + "overrides": { + "testnet": { + "account": "builddao.testnet", + "aliases": ["../../aliases.testnet.json"] + } + } +} diff --git a/apps/new/widget/Index.jsx b/apps/new/widget/Index.jsx new file mode 100644 index 00000000..ab80c8fc --- /dev/null +++ b/apps/new/widget/Index.jsx @@ -0,0 +1 @@ +return

hello builder

\ No newline at end of file From d77a12c03518eca4b245d7ae4e8ea06557d9699c Mon Sep 17 00:00:00 2001 From: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> Date: Wed, 1 May 2024 20:40:38 -0400 Subject: [PATCH 04/18] add weekly promotion --- apps/builddao/data.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 apps/builddao/data.json diff --git a/apps/builddao/data.json b/apps/builddao/data.json new file mode 100644 index 00000000..e4396395 --- /dev/null +++ b/apps/builddao/data.json @@ -0,0 +1,3 @@ +{ + "buildhub.near": {} +} From d260dffd4d111fb408f5773e393e1ee036fa1690 Mon Sep 17 00:00:00 2001 From: Zeeshan Ahmad Date: Fri, 3 May 2024 07:19:49 -0700 Subject: [PATCH 05/18] Cleanup code (#276) * Update dependencies * Fix flashes * Fix daosdk fallback * Remove unused files and comments * Formatting fix --- .../NotificationRolesSelector.jsx | 9 +- apps/builddao/widget/OnboardingFlow.jsx | 10 +- apps/builddao/widget/Proposals.jsx | 10 +- apps/builddao/widget/TrialAccountBanner.jsx | 21 -- apps/builddao/widget/app/view.jsx | 6 +- apps/builddao/widget/components/Post.jsx | 4 - apps/builddao/widget/components/Text/H1.jsx | 14 - apps/builddao/widget/components/Text/H2.jsx | 14 - apps/builddao/widget/components/Text/H3.jsx | 14 - apps/builddao/widget/components/Text/H4.jsx | 14 - apps/builddao/widget/components/Text/P.jsx | 52 ---- .../widget/components/modals/event/Form.jsx | 8 - .../components/modals/propose/AddMember.jsx | 10 +- .../modals/propose/FunctionCall.jsx | 7 +- .../modals/propose/RemoveMember.jsx | 10 +- .../widget/components/modals/propose/Text.jsx | 5 +- .../components/modals/propose/Transfer.jsx | 7 +- .../widget/components/project/page/Task.jsx | 1 - apps/builddao/widget/home/Purposes.jsx | 34 --- apps/builddao/widget/page/projects.jsx | 1 - apps/builddao/widget/template/AppLayout.jsx | 1 - apps/new/widget/Index.jsx | 2 +- config/webpack.production.js | 7 - package.json | 39 ++- src/pages/EditorPage.js | 37 +-- src/pages/Flags.js | 10 - src/pages/Viewer.js | 4 - yarn.lock | 264 +++++++++++++----- 28 files changed, 267 insertions(+), 348 deletions(-) delete mode 100644 apps/builddao/widget/components/Text/H1.jsx delete mode 100644 apps/builddao/widget/components/Text/H2.jsx delete mode 100644 apps/builddao/widget/components/Text/H3.jsx delete mode 100644 apps/builddao/widget/components/Text/H4.jsx delete mode 100644 apps/builddao/widget/components/Text/P.jsx diff --git a/apps/builddao/widget/Notification/NotificationRolesSelector.jsx b/apps/builddao/widget/Notification/NotificationRolesSelector.jsx index f68e2436..888d2f18 100644 --- a/apps/builddao/widget/Notification/NotificationRolesSelector.jsx +++ b/apps/builddao/widget/Notification/NotificationRolesSelector.jsx @@ -1,11 +1,9 @@ -const DaoSDK = VM.require("sdks.near/widget/SDKs.Sputnik.DaoSDK"); +const DaoSDK = VM.require("sdks.near/widget/SDKs.Sputnik.DaoSDK") || (() => {}); + const { InputField } = VM.require("${config_account}/widget/components") || { InputField: <>, }; -if (!DaoSDK) { - return <>; -} const [groupsAndMembers, setGroupsAndMembers] = useState([]); const [selectedRoles, setSelectedRoles] = useState({}); // { role:boolean } const daoId = props.daoId || "build.sputnik-dao.near"; @@ -18,6 +16,9 @@ const [message, setMessage] = useState( const bootstrapTheme = props.bootstrapTheme || "dark"; const sdk = DaoSDK(daoId); +if (!sdk) { + return <>; +} const group = sdk.getGroupsAndMembers(); if (group === null || !group.length) { diff --git a/apps/builddao/widget/OnboardingFlow.jsx b/apps/builddao/widget/OnboardingFlow.jsx index f2ca9085..48e570ef 100644 --- a/apps/builddao/widget/OnboardingFlow.jsx +++ b/apps/builddao/widget/OnboardingFlow.jsx @@ -6,16 +6,18 @@ const { Modal, Button, ProgressState } = VM.require( ProgressState: () => <>, }; -const DaoSDK = VM.require("sdks.near/widget/SDKs.Sputnik.DaoSDK"); +const DaoSDK = + VM.require("sdks.near/widget/SDKs.Sputnik.DaoSDK") || (() => <>); const stepsArray = [1, 2, 3]; -if (!DaoSDK) { - return <>; -} const daoID = "build.sputnik-dao.near"; const sdk = DaoSDK(daoID); +if (!sdk) { + return <>; +} + const groupMembers = sdk.getMembersByGroupId({ groupId: "community" }) ?? []; const StorageKey = { diff --git a/apps/builddao/widget/Proposals.jsx b/apps/builddao/widget/Proposals.jsx index 80bfe4c9..c414c2d9 100644 --- a/apps/builddao/widget/Proposals.jsx +++ b/apps/builddao/widget/Proposals.jsx @@ -8,10 +8,6 @@ const { Header } = VM.require("${config_account}/widget/components.Header") || { }; const DaoSDK = VM.require("sdks.near/widget/SDKs.Sputnik.DaoSDK") || (() => {}); -if (!DaoSDK) { - return <>; -} - const NotificationModalContainer = styled.div` .pb-4 { padding-bottom: 0px !important; @@ -25,6 +21,10 @@ const sdk = DaoSDK(daoId); const [currentPage, setCurrentPage] = useState(0); const accountId = context.accountId; +if (!sdk) { + return <>; +} + const [showProposalModal, setShowModal] = useState(false); const [showNotificationModal, setNotificationModal] = useState(false); const [voteDetails, setVoteDetails] = useState(null); @@ -341,7 +341,7 @@ return ( }} />
-
+

Proposals

- {/* -
-

- Your project & Everything.dev & Create together. -

-
-

- Use a toolkit + workspaces using the app structure from{" "} - - Everything.dev - - , with{" "} - - flexible, customizable type system to support development of any - & all open web things. - -

-

- Including SDKs, libraries, apps, docs, groups, etc. -

-
-
-
- -
- -
*/} ); }; diff --git a/apps/builddao/widget/page/projects.jsx b/apps/builddao/widget/page/projects.jsx index f6272e20..d98bc5f5 100644 --- a/apps/builddao/widget/page/projects.jsx +++ b/apps/builddao/widget/page/projects.jsx @@ -29,7 +29,6 @@ const flattenObject = (obj) => { return paths; }; -// ${alias_devs}/project/name-of-the-project const fetchProjects = () => { const keys = Social.keys(`*/${app}/${type}/*`, "final", { order: "desc", diff --git a/apps/builddao/widget/template/AppLayout.jsx b/apps/builddao/widget/template/AppLayout.jsx index ce342c48..5e002952 100644 --- a/apps/builddao/widget/template/AppLayout.jsx +++ b/apps/builddao/widget/template/AppLayout.jsx @@ -11,7 +11,6 @@ const Container = styled.div` flex-direction: column; width: 100%; height: 100%; - // margin-top: calc(-1 * var(--body-top-padding)); background-color: var(--bg-1, #000000); `; diff --git a/apps/new/widget/Index.jsx b/apps/new/widget/Index.jsx index ab80c8fc..43ce2376 100644 --- a/apps/new/widget/Index.jsx +++ b/apps/new/widget/Index.jsx @@ -1 +1 @@ -return

hello builder

\ No newline at end of file +return

hello builder

; diff --git a/config/webpack.production.js b/config/webpack.production.js index 91976315..f20b07de 100644 --- a/config/webpack.production.js +++ b/config/webpack.production.js @@ -12,13 +12,6 @@ module.exports = () => { devtool: false, module: { rules: [ - // { - // test: /\.(css)$/, - // use: [MiniCssExtractPlugin.loader, "css-loader"], - // // options: { - // // sourceMap: false, - // // }, - // }, { test: /\.(scss|css)$/, use: [ diff --git a/package.json b/package.json index 3c7a8832..6e700bd2 100644 --- a/package.json +++ b/package.json @@ -6,15 +6,27 @@ "dependencies": { "@keypom/selector": "1.2.3", "@monaco-editor/react": "^4.4.6", - "@near-wallet-selector/core": "^8.5.0", - "@near-wallet-selector/here-wallet": "^8.5.0", - "@near-wallet-selector/meteor-wallet": "^8.5.0", - "@near-wallet-selector/modal-ui": "^8.5.0", - "@near-wallet-selector/my-near-wallet": "^8.5.0", + "@near-js/accounts": "^0.1.3", + "@near-js/crypto": "^0.0.4", + "@near-js/keystores": "^0.0.4", + "@near-js/keystores-browser": "^0.0.4", + "@near-js/keystores-node": "^0.0.4", + "@near-js/transactions": "^0.2.0", + "@near-js/types": "^0.0.4", + "@near-js/utils": "^0.0.4", + "@near-js/wallet-account": "^0.0.6", + "@near-wallet-selector/core": "^8.9.7", + "@near-wallet-selector/here-wallet": "^8.9.7", + "@near-wallet-selector/meteor-wallet": "^8.9.7", + "@near-wallet-selector/modal-ui": "^8.9.7", + "@near-wallet-selector/my-near-wallet": "^8.9.7", "@near-wallet-selector/near-wallet": "^8.5.0", - "@near-wallet-selector/neth": "^8.5.0", - "@near-wallet-selector/nightly": "^8.5.0", - "@near-wallet-selector/sender": "^8.5.0", + "@near-wallet-selector/neth": "^8.9.7", + "@near-wallet-selector/nightly": "^8.9.7", + "@near-wallet-selector/sender": "^8.9.7", + "@near-wallet-selector/wallet-utils": "^8.9.7", + "@popperjs/core": "^2.11.8", + "@types/react": "^18.3.1", "@vercel/analytics": "^1.2.2", "@web3-onboard/core": "^2.20.2", "@web3-onboard/injected-wallets": "^2.10.1", @@ -25,21 +37,28 @@ "bn.js": "^5.1.1", "bootstrap": "^5.3.1", "bootstrap-icons": "^1.9.0", + "borsh": "^0.7.0", "collections": "^5.1.12", "dompurify": "^3.0.6", "error-polyfill": "^0.1.2", + "is-my-json-valid": "^2.20.6", "local-storage": "^2.0.0", - "near-api-js": "^2.1.3", + "monaco-editor": "^0.48.0", + "near-api-js": "2.1.3", "near-social-vm": "git+https://github.com/NearSocial/VM.git#dev", "near-social-vm-types": "^1.0.0", + "postcss": "^8.4.38", "prettier": "^3.2.5", + "prop-types": "^15.8.1", "qrcode.react": "^3.1.0", "react": "^18.2.0", "react-bootstrap": "^2.5.0", "react-bootstrap-typeahead": "^6.1.2", - "react-dom": "^18.2.0", + "react-dom": "18.2.0", "react-draggable": "^4.4.6", + "react-is": "^18.3.1", "react-router-dom": "^5.2.0", + "rollup": "^1.20.0", "styled-components": "^5.3.6", "vm-browserify": "^1.1.2", "zustand": "^4.4.6" diff --git a/src/pages/EditorPage.js b/src/pages/EditorPage.js index 5a1f4dac..087e181e 100644 --- a/src/pages/EditorPage.js +++ b/src/pages/EditorPage.js @@ -117,7 +117,7 @@ export default function EditorPage(props) { const [showRenameModal, setShowRenameModal] = useState(false); const [showOpenModal, setShowOpenModal] = useState(false); const [allSaved, setAllSaved] = useState({}); - const [uncommittedPreviews, setUncommittedPreviews] = useState( + const [uncommittedPreviews] = useState( ls.get(EditorUncommittedPreviewsKey) ?? false, ); const [widgetConfig, setWidgetConfig] = useState(undefined); @@ -284,7 +284,6 @@ export default function EditorPage(props) { c, ); if (code) { - // const name = widgetSrc.split("/").slice(2).join("/"); openFile(toPath(Filetype.Widget, widgetSrc), code); } }; @@ -670,7 +669,6 @@ export default function EditorPage(props) {
- {/* {path && accountId && ( - - Open Component in a new tab - - )} */} - {/* */}
diff --git a/src/pages/Flags.js b/src/pages/Flags.js index d7d554ae..736355ac 100644 --- a/src/pages/Flags.js +++ b/src/pages/Flags.js @@ -58,13 +58,3 @@ export default function Flags() { ); } - -{ - /* */ -} diff --git a/src/pages/Viewer.js b/src/pages/Viewer.js index c2c5486c..9479c13a 100644 --- a/src/pages/Viewer.js +++ b/src/pages/Viewer.js @@ -21,10 +21,6 @@ function Viewer({ code, widgets }) { const defaultSrc = widgets.default; // default widget to load const pathSrc = path || defaultSrc; // if no path, load default widget return pathSrc; - // const lastSlashIndex = pathSrc.lastIndexOf("/", pathSrc.indexOf(".near")); - // return lastSlashIndex !== -1 - // ? pathSrc.substring(lastSlashIndex + 1) - // : defaultSrc; }, [path]); const [redirectMap, setRedirectMap] = useState(null); diff --git a/yarn.lock b/yarn.lock index 7a3fe30d..3ab4bd66 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2225,15 +2225,15 @@ "@motionone/dom" "^10.16.4" tslib "^2.3.1" -"@near-js/accounts@0.1.4": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@near-js/accounts/-/accounts-0.1.4.tgz#ff557dc65c5064ee4ac2dbfdd39aa3e35ae4d222" - integrity sha512-zHFmL4OUZ4qHXOE+dDBkYgTNHLWC5RmYUVp9LiuGciO5zFPp7WlxmowJL0QjgXqV1w+dNXq3mgmkfAgYVS8Xjw== +"@near-js/accounts@0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@near-js/accounts/-/accounts-0.1.3.tgz#273f5ea7c05b0251011abb05485c6557b27e8e48" + integrity sha512-rmS1/WwIAWlfSMxHlDN3Q0YLOAscfrU+fkg9PsNI0sdzvdJ+bmiFqAoXi6L3D3KWZemteIudVEXMcegjreHnMg== dependencies: - "@near-js/crypto" "0.0.5" - "@near-js/providers" "0.0.7" - "@near-js/signers" "0.0.5" - "@near-js/transactions" "0.2.1" + "@near-js/crypto" "0.0.4" + "@near-js/providers" "0.0.6" + "@near-js/signers" "0.0.4" + "@near-js/transactions" "0.2.0" "@near-js/types" "0.0.4" "@near-js/utils" "0.0.4" ajv "^8.11.2" @@ -2262,6 +2262,34 @@ lru_map "0.4.1" near-abi "0.1.1" +"@near-js/accounts@^0.1.3": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@near-js/accounts/-/accounts-0.1.4.tgz#ff557dc65c5064ee4ac2dbfdd39aa3e35ae4d222" + integrity sha512-zHFmL4OUZ4qHXOE+dDBkYgTNHLWC5RmYUVp9LiuGciO5zFPp7WlxmowJL0QjgXqV1w+dNXq3mgmkfAgYVS8Xjw== + dependencies: + "@near-js/crypto" "0.0.5" + "@near-js/providers" "0.0.7" + "@near-js/signers" "0.0.5" + "@near-js/transactions" "0.2.1" + "@near-js/types" "0.0.4" + "@near-js/utils" "0.0.4" + ajv "^8.11.2" + ajv-formats "^2.1.1" + bn.js "5.2.1" + borsh "^0.7.0" + depd "^2.0.0" + near-abi "0.1.1" + +"@near-js/crypto@0.0.4", "@near-js/crypto@^0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@near-js/crypto/-/crypto-0.0.4.tgz#7bb991da25f06096de51466c6331cb185314fad8" + integrity sha512-2mSIVv6mZway1rQvmkktrXAFoUvy7POjrHNH3LekKZCMCs7qMM/23Hz2+APgxZPqoV2kjarSNOEYJjxO7zQ/rQ== + dependencies: + "@near-js/types" "0.0.4" + bn.js "5.2.1" + borsh "^0.7.0" + tweetnacl "^1.0.1" + "@near-js/crypto@0.0.5": version "0.0.5" resolved "https://registry.yarnpkg.com/@near-js/crypto/-/crypto-0.0.5.tgz#3191cdc8dcdba572bdead482b5d38f364bdcc2a0" @@ -2295,13 +2323,13 @@ borsh "1.0.0" randombytes "2.1.0" -"@near-js/keystores-browser@0.0.5": - version "0.0.5" - resolved "https://registry.yarnpkg.com/@near-js/keystores-browser/-/keystores-browser-0.0.5.tgz#7e94181ca5c4fbad8b8e67cda16888b4ccafae61" - integrity sha512-mHF3Vcvsr7xnkaM/reOyxtykbE3OWKV6vQzqyTH2tZYT2OTEnj0KhRT9BCFC0Ra67K1zQLbg49Yc/kDCc5qupA== +"@near-js/keystores-browser@0.0.4", "@near-js/keystores-browser@^0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@near-js/keystores-browser/-/keystores-browser-0.0.4.tgz#9c1130e2c0becf6bb9cfaaa7594ad38ed25585bd" + integrity sha512-bzwClm3jNlWJrb8wqMunP3rrcG1hS3rD58KKhDvHXy8Dtg9VVUgrfr3Csu9oTnjG+rAPZGOynunaoOQVqju/Aw== dependencies: - "@near-js/crypto" "0.0.5" - "@near-js/keystores" "0.0.5" + "@near-js/crypto" "0.0.4" + "@near-js/keystores" "0.0.4" "@near-js/keystores-browser@0.0.9": version "0.0.9" @@ -2311,13 +2339,13 @@ "@near-js/crypto" "1.2.1" "@near-js/keystores" "0.0.9" -"@near-js/keystores-node@0.0.5": - version "0.0.5" - resolved "https://registry.yarnpkg.com/@near-js/keystores-node/-/keystores-node-0.0.5.tgz#f474dabbb84590896dd8861bb33a7304580e0d99" - integrity sha512-BYmWyGNydfAqi7eYA1Jo8zULL13cxejD2VBr0BBIXx5bJ+BO4TLecsY1xdTBEq06jyWXHa7kV4h8BJzAjvpTLg== +"@near-js/keystores-node@0.0.4", "@near-js/keystores-node@^0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@near-js/keystores-node/-/keystores-node-0.0.4.tgz#00187deef2d43afeb20c01a0e63ec50af77cfc85" + integrity sha512-vOdVhAuQ8BVefEluj+TSNzjXHA/1xjEgK7pwBUA1kgpcY8/hZ0Jj4PcvPD17wQNSyP+NJF5H9ed3pP2h2VH+1A== dependencies: - "@near-js/crypto" "0.0.5" - "@near-js/keystores" "0.0.5" + "@near-js/crypto" "0.0.4" + "@near-js/keystores" "0.0.4" "@near-js/keystores-node@0.0.9": version "0.0.9" @@ -2335,6 +2363,14 @@ "@near-js/crypto" "1.2.3" "@near-js/types" "0.2.0" +"@near-js/keystores@0.0.4", "@near-js/keystores@^0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@near-js/keystores/-/keystores-0.0.4.tgz#da03069497bb14741a4d97f7ad4746baf9a09ea7" + integrity sha512-+vKafmDpQGrz5py1liot2hYSjPGXwihveeN+BL11aJlLqZnWBgYJUWCXG+uyGjGXZORuy2hzkKK6Hi+lbKOfVA== + dependencies: + "@near-js/crypto" "0.0.4" + "@near-js/types" "0.0.4" + "@near-js/keystores@0.0.5": version "0.0.5" resolved "https://registry.yarnpkg.com/@near-js/keystores/-/keystores-0.0.5.tgz#44ec009b23c552809b6f9bc9a83632f79de4112b" @@ -2351,6 +2387,20 @@ "@near-js/crypto" "1.2.1" "@near-js/types" "0.0.4" +"@near-js/providers@0.0.6": + version "0.0.6" + resolved "https://registry.yarnpkg.com/@near-js/providers/-/providers-0.0.6.tgz#47b9632be2ad5c5a5295840eea8fb508d90735ba" + integrity sha512-PgWCcgDgCAgnyxq2IPZD2vbpQzXt4XK4cN2SbUZsDwJkBaDQEozXMnyShG/Ie2eRoz5aD9dRHpdLDpTieAw5kA== + dependencies: + "@near-js/transactions" "0.2.0" + "@near-js/types" "0.0.4" + "@near-js/utils" "0.0.4" + bn.js "5.2.1" + borsh "^0.7.0" + http-errors "^1.7.2" + optionalDependencies: + node-fetch "^2.6.1" + "@near-js/providers@0.0.7": version "0.0.7" resolved "https://registry.yarnpkg.com/@near-js/providers/-/providers-0.0.7.tgz#b2189e5d14d1afb1798c91c59e6dfb9bb476f46b" @@ -2392,6 +2442,15 @@ optionalDependencies: node-fetch "2.6.7" +"@near-js/signers@0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@near-js/signers/-/signers-0.0.4.tgz#a1904ccc718d6f87b05cd2e168f33bde0cfb269a" + integrity sha512-xCglo3U/WIGsz/izPGFMegS5Q3PxOHYB8a1E7RtVhNm5QdqTlQldLCm/BuMg2G/u1l1ZZ0wdvkqRTG9joauf3Q== + dependencies: + "@near-js/crypto" "0.0.4" + "@near-js/keystores" "0.0.4" + js-sha256 "^0.9.0" + "@near-js/signers@0.0.5": version "0.0.5" resolved "https://registry.yarnpkg.com/@near-js/signers/-/signers-0.0.5.tgz#f3f946440314bf039dd32154928163ceaec8bedb" @@ -2419,7 +2478,20 @@ "@near-js/keystores" "0.0.11" "@noble/hashes" "1.3.3" -"@near-js/transactions@0.2.1": +"@near-js/transactions@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@near-js/transactions/-/transactions-0.2.0.tgz#c23b73d94ebcf8b4cd1b5d2176f620e499a143ca" + integrity sha512-ejcYkDz0tdQ40i/7ETV23fL5hp/pIiNXYmh4bNuZ9FjeowBODtlXGLqjG3wZbCygHCirJKilmVi5BtM+rh4ovQ== + dependencies: + "@near-js/crypto" "0.0.4" + "@near-js/signers" "0.0.4" + "@near-js/types" "0.0.4" + "@near-js/utils" "0.0.4" + bn.js "5.2.1" + borsh "^0.7.0" + js-sha256 "^0.9.0" + +"@near-js/transactions@0.2.1", "@near-js/transactions@^0.2.0": version "0.2.1" resolved "https://registry.yarnpkg.com/@near-js/transactions/-/transactions-0.2.1.tgz#ab6d246e94e6f64b4e5a651fe6e9de03dd573521" integrity sha512-V9tXzkICDPruSxihKXkBhUgsI4uvW7TwXlnZS2GZpPsFFiIUeGrso0wo4uiQwB6miFA5q6fKaAtQa4F2v1s+zg== @@ -2457,7 +2529,7 @@ "@noble/hashes" "1.3.3" borsh "1.0.0" -"@near-js/types@0.0.4": +"@near-js/types@0.0.4", "@near-js/types@^0.0.4": version "0.0.4" resolved "https://registry.yarnpkg.com/@near-js/types/-/types-0.0.4.tgz#d941689df41c850aeeeaeb9d498418acec515404" integrity sha512-8TTMbLMnmyG06R5YKWuS/qFG1tOA3/9lX4NgBqQPsvaWmDsa+D+QwOkrEHDegped0ZHQwcjAXjKML1S1TyGYKg== @@ -2469,7 +2541,7 @@ resolved "https://registry.yarnpkg.com/@near-js/types/-/types-0.2.0.tgz#5370c3e9230103222b2827dbd6370f03c4e996d1" integrity sha512-pTahjni0+PzStseFtnnI9nqmh+ZrHqBqeERo3B3OCXUC/qEie0ZSBMSMt80SgqnaGAy5/CqkCLO9zOx1gA8Cwg== -"@near-js/utils@0.0.4": +"@near-js/utils@0.0.4", "@near-js/utils@^0.0.4": version "0.0.4" resolved "https://registry.yarnpkg.com/@near-js/utils/-/utils-0.0.4.tgz#1a387f81974ebbfa4521c92590232be97e3335dd" integrity sha512-mPUEPJbTCMicGitjEGvQqOe8AS7O4KkRCxqd0xuE/X6gXF1jz1pYMZn4lNUeUz2C84YnVSGLAM0o9zcN6Y4hiA== @@ -2500,16 +2572,16 @@ depd "2.0.0" mustache "4.0.0" -"@near-js/wallet-account@0.0.7": - version "0.0.7" - resolved "https://registry.yarnpkg.com/@near-js/wallet-account/-/wallet-account-0.0.7.tgz#efa6738114171b2a6e40e8b35a8194b7cf86c11e" - integrity sha512-tmRyieG/wHmuNkg/WGFyKD6iH6atHPbY0rZ5OjOIiteuhZEPgp+z8OBpiQ4qumTa63q46aj/QVSQL0J3+JmBfw== - dependencies: - "@near-js/accounts" "0.1.4" - "@near-js/crypto" "0.0.5" - "@near-js/keystores" "0.0.5" - "@near-js/signers" "0.0.5" - "@near-js/transactions" "0.2.1" +"@near-js/wallet-account@0.0.6", "@near-js/wallet-account@^0.0.6": + version "0.0.6" + resolved "https://registry.yarnpkg.com/@near-js/wallet-account/-/wallet-account-0.0.6.tgz#478ba16340a55ca2d28f4bf8e2566ee9842e36f1" + integrity sha512-oyxQM6tf2WG4it+8IMu0ZQ6pa4OQhF1o+Q33Rb2+4Mb1Fm+L7MO7PJoCPcveCIFYVPOjSVk0oyoz1KbE3y62gA== + dependencies: + "@near-js/accounts" "0.1.3" + "@near-js/crypto" "0.0.4" + "@near-js/keystores" "0.0.4" + "@near-js/signers" "0.0.4" + "@near-js/transactions" "0.2.0" "@near-js/types" "0.0.4" "@near-js/utils" "0.0.4" bn.js "5.2.1" @@ -2540,7 +2612,7 @@ js-sha256 "0.9.0" rxjs "7.8.1" -"@near-wallet-selector/core@8.9.7", "@near-wallet-selector/core@^8.0.3", "@near-wallet-selector/core@^8.5.0": +"@near-wallet-selector/core@8.9.7", "@near-wallet-selector/core@^8.0.3", "@near-wallet-selector/core@^8.9.7": version "8.9.7" resolved "https://registry.yarnpkg.com/@near-wallet-selector/core/-/core-8.9.7.tgz#d55cb97b8d4932f1bd786805c3365205cd084b61" integrity sha512-WFAtNrA/w7gnobKmHGEqV4r/RtDM1QTf33TF0Kaf/1nK5jBNNyoYldyAPnbP08t1S+IbbVJ9NcWW3P7hdXe4Lg== @@ -2550,7 +2622,7 @@ js-sha256 "0.9.0" rxjs "7.8.1" -"@near-wallet-selector/here-wallet@^8.5.0": +"@near-wallet-selector/here-wallet@^8.9.7": version "8.9.7" resolved "https://registry.yarnpkg.com/@near-wallet-selector/here-wallet/-/here-wallet-8.9.7.tgz#d29129a70c581fb5ed321170fc9b760fa825088b" integrity sha512-4SoyQ84314Rzu/jspUnKR/C8JnjphMxSnxiXCiw2OLRs2AuGaQ3xEu9yABBCZ1NPQwaMYOqDMvTi9HgvqkLClQ== @@ -2559,7 +2631,7 @@ "@near-wallet-selector/core" "8.9.7" bn.js "5.2.1" -"@near-wallet-selector/meteor-wallet@^8.5.0": +"@near-wallet-selector/meteor-wallet@^8.9.7": version "8.9.7" resolved "https://registry.yarnpkg.com/@near-wallet-selector/meteor-wallet/-/meteor-wallet-8.9.7.tgz#ff3266e40cff5db3ef1df5860182a06ff1167149" integrity sha512-8jWhUZAj1YTMeHYUnDkB00BdF7x+awDbb4bFSMcOFsqGuhp6qvAIp/Uo57kF11bntrb3Xrj8NNpsEhvC+Tx1EA== @@ -2567,7 +2639,7 @@ "@meteorwallet/sdk" "1.0.9" "@near-wallet-selector/core" "8.9.7" -"@near-wallet-selector/modal-ui@^8.5.0": +"@near-wallet-selector/modal-ui@^8.9.7": version "8.9.7" resolved "https://registry.yarnpkg.com/@near-wallet-selector/modal-ui/-/modal-ui-8.9.7.tgz#543009d606b02d4c16502a5f7dc1b09955e27884" integrity sha512-mE5jbJFxR2qbGRPP6Ca3ifdvmSlEKCPMDeU5H8SpofqMpKmiBXZPwJbGrpziuBbtdSfpBOfQ+8a+RMQf1nz+nA== @@ -2586,7 +2658,7 @@ "@near-wallet-selector/core" "8.9.3" "@near-wallet-selector/wallet-utils" "8.9.3" -"@near-wallet-selector/my-near-wallet@^8.5.0": +"@near-wallet-selector/my-near-wallet@^8.9.7": version "8.9.7" resolved "https://registry.yarnpkg.com/@near-wallet-selector/my-near-wallet/-/my-near-wallet-8.9.7.tgz#0107e51010339a1bf0f6e6b5b1a8844f1b3140db" integrity sha512-bAoVTWxRyU1km8v7e6yjUgnPVZ9QpcM+lAl9oQWc1mEh0Jz+97PCymgBJH5NamGopmFfcaE1yGIri5ra9SWuyA== @@ -2602,7 +2674,7 @@ "@near-wallet-selector/core" "8.9.3" "@near-wallet-selector/my-near-wallet" "8.9.3" -"@near-wallet-selector/neth@^8.5.0": +"@near-wallet-selector/neth@^8.9.7": version "8.9.7" resolved "https://registry.yarnpkg.com/@near-wallet-selector/neth/-/neth-8.9.7.tgz#f1b164a909e4f0141b15727b2a4ebd8f874dbb87" integrity sha512-NEcjX/5M6tb3h9P4hr/dnQjyBjp+xUjyVJyuqBDcXYx6tJWeV+/UDVuph0rCTlhLeah/DEHlyyAVrb9MO9eyYQ== @@ -2614,7 +2686,7 @@ is-mobile "4.0.0" near-seed-phrase "0.2.0" -"@near-wallet-selector/nightly@^8.5.0": +"@near-wallet-selector/nightly@^8.9.7": version "8.9.7" resolved "https://registry.yarnpkg.com/@near-wallet-selector/nightly/-/nightly-8.9.7.tgz#3f9a761a6eabd4599409aace93d1112f72e1959a" integrity sha512-Kbd6bpvOpHla2ctYzsOZ+Uj9IrkbumCAxz3RSXtemSPToAe9Vv0tGUDLTi3p76IAI1RkXBwhfRcPaoNKWbvuYg== @@ -2623,7 +2695,7 @@ "@near-wallet-selector/wallet-utils" "8.9.7" is-mobile "4.0.0" -"@near-wallet-selector/sender@^8.5.0": +"@near-wallet-selector/sender@^8.9.7": version "8.9.7" resolved "https://registry.yarnpkg.com/@near-wallet-selector/sender/-/sender-8.9.7.tgz#871f418204b9584595307fb627a90f964954ddba" integrity sha512-n2xEr99UjzDRdfRKsX20F8JiSd8BYyjly4OUCQaaq9POBH8b/wIpdRz35xl8LC7td0xii4mYuL2QyphFPcqPHA== @@ -2639,7 +2711,7 @@ "@near-wallet-selector/core" "8.9.3" bn.js "5.2.1" -"@near-wallet-selector/wallet-utils@8.9.7": +"@near-wallet-selector/wallet-utils@8.9.7", "@near-wallet-selector/wallet-utils@^8.9.7": version "8.9.7" resolved "https://registry.yarnpkg.com/@near-wallet-selector/wallet-utils/-/wallet-utils-8.9.7.tgz#8a0d8f611820301a758ebb5321ba83b4812f42e9" integrity sha512-hVNF8z2EK8FPMaH2V2RIpJRT3CSIo8Epq6ysRRHVPFCXnqDjHfTWe39WYi4uAZldeCMCLQeRm5y8YL5QiAL3ig== @@ -2792,7 +2864,7 @@ resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.25.tgz#f077fdc0b5d0078d30893396ff4827a13f99e817" integrity sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ== -"@popperjs/core@^2.10.2", "@popperjs/core@^2.11.6": +"@popperjs/core@^2.10.2", "@popperjs/core@^2.11.6", "@popperjs/core@^2.11.8": version "2.11.8" resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A== @@ -3914,7 +3986,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@>=16.9.11": +"@types/react@*", "@types/react@>=16.9.11", "@types/react@^18.3.1": version "18.3.1" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.1.tgz#fed43985caa834a2084d002e4771e15dfcbdbe8e" integrity sha512-V0kuGBX3+prX+DQ/7r2qsv1NsdfnCLnTgnRJ1pYnxykBhGMz+qj+box5lq7XsO5mtZsBqpjwwTu/7wszPfMBcw== @@ -4742,6 +4814,11 @@ acorn-walk@^8.0.0: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa" integrity sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A== +acorn@^7.1.0: + version "7.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" + integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== + acorn@^8.0.4, acorn@^8.11.3, acorn@^8.7.1, acorn@^8.8.0, acorn@^8.8.2, acorn@^8.9.0: version "8.11.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" @@ -7425,6 +7502,20 @@ gaze@^1.1.3: dependencies: globule "^1.0.0" +generate-function@^2.0.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.3.1.tgz#f069617690c10c868e73b8465746764f97c3479f" + integrity sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ== + dependencies: + is-property "^1.0.2" + +generate-object-property@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" + integrity sha512-TuOwZWgJ2VAMEGJvAyPWvpqxSANF0LDpmyHauMjFYzaACvn+QTT/AZomvPCzVBV7yDN3OmwHQ5OvHaeLKre3JQ== + dependencies: + is-property "^1.0.0" + gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" @@ -8236,6 +8327,22 @@ is-mobile@4.0.0: resolved "https://registry.yarnpkg.com/is-mobile/-/is-mobile-4.0.0.tgz#bba396eb9656e2739afde3053d7191da310fc758" integrity sha512-mlcHZA84t1qLSuWkt2v0I2l61PYdyQDt4aG1mLIXF5FDMm4+haBCxCPYSr/uwqQNRk1MiTizn0ypEuRAOLRAew== +is-my-ip-valid@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.1.tgz#f7220d1146257c98672e6fba097a9f3f2d348442" + integrity sha512-jxc8cBcOWbNK2i2aTkCZP6i7wkHF1bqKFrwEHuN5Jtg5BSaZHUZQ/JTOJwoV41YvHnOaRyWWh72T/KvfNz9DJg== + +is-my-json-valid@^2.20.6: + version "2.20.6" + resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.20.6.tgz#a9d89e56a36493c77bda1440d69ae0dc46a08387" + integrity sha512-1JQwulVNjx8UqkPE/bqDaxtH4PXCe/2VRh/y3p99heOV87HG4Id5/VfDswd+YiAfHcRTfDlWgISycnHuhZq1aw== + dependencies: + generate-function "^2.0.0" + generate-object-property "^1.1.0" + is-my-ip-valid "^1.0.0" + jsonpointer "^5.0.0" + xtend "^4.0.0" + is-nan@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.3.2.tgz#043a54adea31748b55b6cd4e09aadafa69bd9e1d" @@ -8307,6 +8414,11 @@ is-promise@^2.2.2: resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== +is-property@^1.0.0, is-property@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" + integrity sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g== + is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -8564,6 +8676,11 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" +jsonpointer@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-5.0.1.tgz#2110e0af0900fd37467b5907ecd13a7884a1b559" + integrity sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ== + "jsx-ast-utils@^2.4.1 || ^3.0.0": version "3.3.5" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz#4766bd05a8e2a11af222becd19e15575e52a853a" @@ -9469,6 +9586,11 @@ mlly@^1.6.1: pkg-types "^1.1.0" ufo "^1.5.3" +monaco-editor@^0.48.0: + version "0.48.0" + resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.48.0.tgz#9e54541bbe0ba3f2bb238477d5b981a282205ea0" + integrity sha512-goSDElNqFfw7iDHMg8WDATkfcyeLTNpBHQpO8incK6p5qZt5G/1j41X0xdGzpIkGojGXM+QiRQyLjnfDVvrpwA== + motion@10.16.2: version "10.16.2" resolved "https://registry.yarnpkg.com/motion/-/motion-10.16.2.tgz#7dc173c6ad62210a7e9916caeeaf22c51e598d21" @@ -9585,22 +9707,22 @@ near-abi@0.1.1: dependencies: "@types/json-schema" "^7.0.11" -near-api-js@^2.1.3: - version "2.1.4" - resolved "https://registry.yarnpkg.com/near-api-js/-/near-api-js-2.1.4.tgz#562bb7047bf3699fbdf78f9a6620366069ad7cd9" - integrity sha512-e1XicyvJvQMtu7qrG8oWyAdjHJJCoy+cvbW6h2Dky4yj7vC85omQz/x7IgKl71VhzDj2/TGUwjTVESp6NSe75A== - dependencies: - "@near-js/accounts" "0.1.4" - "@near-js/crypto" "0.0.5" - "@near-js/keystores" "0.0.5" - "@near-js/keystores-browser" "0.0.5" - "@near-js/keystores-node" "0.0.5" - "@near-js/providers" "0.0.7" - "@near-js/signers" "0.0.5" - "@near-js/transactions" "0.2.1" +near-api-js@2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/near-api-js/-/near-api-js-2.1.3.tgz#2e894c90cee33ef0c2101951375d15662753b443" + integrity sha512-ggCQE/oGrrbr9dEtXZ9QU7XAf6RgISs+bfD7Q5I2QsQN45XgV85IA4c8KDLzo66u7FTX39gubKz3Ghieo6D7YA== + dependencies: + "@near-js/accounts" "0.1.3" + "@near-js/crypto" "0.0.4" + "@near-js/keystores" "0.0.4" + "@near-js/keystores-browser" "0.0.4" + "@near-js/keystores-node" "0.0.4" + "@near-js/providers" "0.0.6" + "@near-js/signers" "0.0.4" + "@near-js/transactions" "0.2.0" "@near-js/types" "0.0.4" "@near-js/utils" "0.0.4" - "@near-js/wallet-account" "0.0.7" + "@near-js/wallet-account" "0.0.6" ajv "^8.11.2" ajv-formats "^2.1.1" bn.js "5.2.1" @@ -10506,7 +10628,7 @@ postcss-value-parser@^4.0.2, postcss-value-parser@^4.1.0, postcss-value-parser@^ resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== -postcss@^8.3.5, postcss@^8.4.33: +postcss@^8.3.5, postcss@^8.4.33, postcss@^8.4.38: version "8.4.38" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.38.tgz#b387d533baf2054288e337066d81c6bee9db9e0e" integrity sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A== @@ -10785,14 +10907,6 @@ react-dom@18.2.0: loose-envify "^1.1.0" scheduler "^0.23.0" -react-dom@^18.2.0: - version "18.3.1" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4" - integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw== - dependencies: - loose-envify "^1.1.0" - scheduler "^0.23.2" - react-draggable@^4.4.6: version "4.4.6" resolved "https://registry.yarnpkg.com/react-draggable/-/react-draggable-4.4.6.tgz#63343ee945770881ca1256a5b6fa5c9f5983fe1e" @@ -10835,6 +10949,11 @@ react-is@^17.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== +react-is@^18.3.1: + version "18.3.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" + integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== + react-lifecycles-compat@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" @@ -11253,6 +11372,15 @@ rollup-plugin-dotenv@0.5.0: "@rollup/plugin-replace" "^5.0.1" dotenv "^16.0.3" +rollup@^1.20.0: + version "1.32.1" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.32.1.tgz#4480e52d9d9e2ae4b46ba0d9ddeaf3163940f9c4" + integrity sha512-/2HA0Ec70TvQnXdzynFffkjA6XN+1e2pEv/uKS5Ulca40g2L7KuOE3riasHoNVHOsFD5KKZgDsMk1CP3Tw9s+A== + dependencies: + "@types/estree" "*" + "@types/node" "*" + acorn "^7.1.0" + run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -11336,7 +11464,7 @@ sass@^1.66.1: immutable "^4.0.0" source-map-js ">=0.6.2 <2.0.0" -scheduler@^0.23.0, scheduler@^0.23.2: +scheduler@^0.23.0: version "0.23.2" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.2.tgz#414ba64a3b282892e944cf2108ecc078d115cdc3" integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ== From a08ac7af1a6073a3dcd1007d0fd888b7a0652df1 Mon Sep 17 00:00:00 2001 From: Muhammad Saad Iqbal Date: Fri, 3 May 2024 19:39:01 +0500 Subject: [PATCH 06/18] MintBase Wallet Add (#278) --- package.json | 1 + src/App.js | 7 +++ yarn.lock | 123 +++++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 112 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 6e700bd2..6ad45cc7 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@near-wallet-selector/core": "^8.9.7", "@near-wallet-selector/here-wallet": "^8.9.7", "@near-wallet-selector/meteor-wallet": "^8.9.7", + "@near-wallet-selector/mintbase-wallet": "^8.9.7", "@near-wallet-selector/modal-ui": "^8.9.7", "@near-wallet-selector/my-near-wallet": "^8.9.7", "@near-wallet-selector/near-wallet": "^8.5.0", diff --git a/src/App.js b/src/App.js index d04f88fc..04b11443 100644 --- a/src/App.js +++ b/src/App.js @@ -3,6 +3,7 @@ import { setupWalletSelector } from "@near-wallet-selector/core"; import { setupHereWallet } from "@near-wallet-selector/here-wallet"; import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet"; import { setupModal } from "@near-wallet-selector/modal-ui"; +import { setupMintbaseWallet } from "@near-wallet-selector/mintbase-wallet"; import "@near-wallet-selector/modal-ui/styles.css"; import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet"; import { setupNeth } from "@near-wallet-selector/neth"; @@ -76,6 +77,12 @@ function App() { setupMyNearWallet(), setupSender(), setupHereWallet(), + setupMintbaseWallet({ + networkId: NetworkId, + walletUrl: "https://wallet.mintbase.xyz", + callbackUrl: "https://www.nearbuilders.org", + deprecated: false, + }), setupMeteorWallet(), setupNeth({ gas: "300000000000000", diff --git a/yarn.lock b/yarn.lock index 3ab4bd66..b6bd27c9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2142,6 +2142,16 @@ nanoid "3.3.6" query-string "^7.1.3" +"@mintbase-js/wallet@0.6.0-beta.3": + version "0.6.0-beta.3" + resolved "https://registry.yarnpkg.com/@mintbase-js/wallet/-/wallet-0.6.0-beta.3.tgz#31ee107f2cf888fa120e8ca07f47e5dcd278ca26" + integrity sha512-fzkqS3LDnSHB4YG0ync8JRuv+xQlMOzcu0btpAN8SC1hZNGUak0BTXBiNxKZQTeuH/DL+6ghh+t9VzJknOorhA== + dependencies: + "@near-wallet-selector/core" "8.9.5" + "@near-wallet-selector/wallet-utils" "^8.9.5" + bn.js "^5.2.1" + near-api-js "^2.1.3" + "@monaco-editor/loader@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@monaco-editor/loader/-/loader-1.4.0.tgz#f08227057331ec890fa1e903912a5b711a2ad558" @@ -2243,6 +2253,24 @@ depd "^2.0.0" near-abi "0.1.1" +"@near-js/accounts@0.1.4", "@near-js/accounts@^0.1.3": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@near-js/accounts/-/accounts-0.1.4.tgz#ff557dc65c5064ee4ac2dbfdd39aa3e35ae4d222" + integrity sha512-zHFmL4OUZ4qHXOE+dDBkYgTNHLWC5RmYUVp9LiuGciO5zFPp7WlxmowJL0QjgXqV1w+dNXq3mgmkfAgYVS8Xjw== + dependencies: + "@near-js/crypto" "0.0.5" + "@near-js/providers" "0.0.7" + "@near-js/signers" "0.0.5" + "@near-js/transactions" "0.2.1" + "@near-js/types" "0.0.4" + "@near-js/utils" "0.0.4" + ajv "^8.11.2" + ajv-formats "^2.1.1" + bn.js "5.2.1" + borsh "^0.7.0" + depd "^2.0.0" + near-abi "0.1.1" + "@near-js/accounts@1.0.4": version "1.0.4" resolved "https://registry.yarnpkg.com/@near-js/accounts/-/accounts-1.0.4.tgz#b699dc1c63ffccc1598481b4260dfaf2507f0a69" @@ -2262,24 +2290,6 @@ lru_map "0.4.1" near-abi "0.1.1" -"@near-js/accounts@^0.1.3": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@near-js/accounts/-/accounts-0.1.4.tgz#ff557dc65c5064ee4ac2dbfdd39aa3e35ae4d222" - integrity sha512-zHFmL4OUZ4qHXOE+dDBkYgTNHLWC5RmYUVp9LiuGciO5zFPp7WlxmowJL0QjgXqV1w+dNXq3mgmkfAgYVS8Xjw== - dependencies: - "@near-js/crypto" "0.0.5" - "@near-js/providers" "0.0.7" - "@near-js/signers" "0.0.5" - "@near-js/transactions" "0.2.1" - "@near-js/types" "0.0.4" - "@near-js/utils" "0.0.4" - ajv "^8.11.2" - ajv-formats "^2.1.1" - bn.js "5.2.1" - borsh "^0.7.0" - depd "^2.0.0" - near-abi "0.1.1" - "@near-js/crypto@0.0.4", "@near-js/crypto@^0.0.4": version "0.0.4" resolved "https://registry.yarnpkg.com/@near-js/crypto/-/crypto-0.0.4.tgz#7bb991da25f06096de51466c6331cb185314fad8" @@ -2331,6 +2341,14 @@ "@near-js/crypto" "0.0.4" "@near-js/keystores" "0.0.4" +"@near-js/keystores-browser@0.0.5": + version "0.0.5" + resolved "https://registry.yarnpkg.com/@near-js/keystores-browser/-/keystores-browser-0.0.5.tgz#7e94181ca5c4fbad8b8e67cda16888b4ccafae61" + integrity sha512-mHF3Vcvsr7xnkaM/reOyxtykbE3OWKV6vQzqyTH2tZYT2OTEnj0KhRT9BCFC0Ra67K1zQLbg49Yc/kDCc5qupA== + dependencies: + "@near-js/crypto" "0.0.5" + "@near-js/keystores" "0.0.5" + "@near-js/keystores-browser@0.0.9": version "0.0.9" resolved "https://registry.yarnpkg.com/@near-js/keystores-browser/-/keystores-browser-0.0.9.tgz#4d6211ad617613124aeee78ede5771b153e3bcdd" @@ -2347,6 +2365,14 @@ "@near-js/crypto" "0.0.4" "@near-js/keystores" "0.0.4" +"@near-js/keystores-node@0.0.5": + version "0.0.5" + resolved "https://registry.yarnpkg.com/@near-js/keystores-node/-/keystores-node-0.0.5.tgz#f474dabbb84590896dd8861bb33a7304580e0d99" + integrity sha512-BYmWyGNydfAqi7eYA1Jo8zULL13cxejD2VBr0BBIXx5bJ+BO4TLecsY1xdTBEq06jyWXHa7kV4h8BJzAjvpTLg== + dependencies: + "@near-js/crypto" "0.0.5" + "@near-js/keystores" "0.0.5" + "@near-js/keystores-node@0.0.9": version "0.0.9" resolved "https://registry.yarnpkg.com/@near-js/keystores-node/-/keystores-node-0.0.9.tgz#c2fd2f5bfbca1c75699dd7324e300cfd12e790ed" @@ -2587,6 +2613,21 @@ bn.js "5.2.1" borsh "^0.7.0" +"@near-js/wallet-account@0.0.7": + version "0.0.7" + resolved "https://registry.yarnpkg.com/@near-js/wallet-account/-/wallet-account-0.0.7.tgz#efa6738114171b2a6e40e8b35a8194b7cf86c11e" + integrity sha512-tmRyieG/wHmuNkg/WGFyKD6iH6atHPbY0rZ5OjOIiteuhZEPgp+z8OBpiQ4qumTa63q46aj/QVSQL0J3+JmBfw== + dependencies: + "@near-js/accounts" "0.1.4" + "@near-js/crypto" "0.0.5" + "@near-js/keystores" "0.0.5" + "@near-js/signers" "0.0.5" + "@near-js/transactions" "0.2.1" + "@near-js/types" "0.0.4" + "@near-js/utils" "0.0.4" + bn.js "5.2.1" + borsh "^0.7.0" + "@near-js/wallet-account@1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@near-js/wallet-account/-/wallet-account-1.1.1.tgz#e66e8d10fb51f71f7cb722bdff63fb98e2b0d486" @@ -2612,6 +2653,16 @@ js-sha256 "0.9.0" rxjs "7.8.1" +"@near-wallet-selector/core@8.9.5": + version "8.9.5" + resolved "https://registry.yarnpkg.com/@near-wallet-selector/core/-/core-8.9.5.tgz#15e49f17252ee4e54a1c9719b8c2b98fd71aae74" + integrity sha512-wJiCL8M7z6tkNMY5H4n63/SZCmlW0Z15H6R1biWgpRuMDlVjhQOzxrmQggb1jbK4nYkzXyARNKyPh2gcRUuS+w== + dependencies: + borsh "0.7.0" + events "3.3.0" + js-sha256 "0.9.0" + rxjs "7.8.1" + "@near-wallet-selector/core@8.9.7", "@near-wallet-selector/core@^8.0.3", "@near-wallet-selector/core@^8.9.7": version "8.9.7" resolved "https://registry.yarnpkg.com/@near-wallet-selector/core/-/core-8.9.7.tgz#d55cb97b8d4932f1bd786805c3365205cd084b61" @@ -2639,6 +2690,13 @@ "@meteorwallet/sdk" "1.0.9" "@near-wallet-selector/core" "8.9.7" +"@near-wallet-selector/mintbase-wallet@^8.9.7": + version "8.9.7" + resolved "https://registry.yarnpkg.com/@near-wallet-selector/mintbase-wallet/-/mintbase-wallet-8.9.7.tgz#4db309713144774d8f061675620797870b488a79" + integrity sha512-j6+8kLxSSVIUAEbn3cnoiWFam6jWPZZNUdJ6eksvVoKRERznM/nlSa/Z+3lj6qVRoSZr5U4QeeLoSVDPNnUSGg== + dependencies: + "@mintbase-js/wallet" "0.6.0-beta.3" + "@near-wallet-selector/modal-ui@^8.9.7": version "8.9.7" resolved "https://registry.yarnpkg.com/@near-wallet-selector/modal-ui/-/modal-ui-8.9.7.tgz#543009d606b02d4c16502a5f7dc1b09955e27884" @@ -2711,7 +2769,7 @@ "@near-wallet-selector/core" "8.9.3" bn.js "5.2.1" -"@near-wallet-selector/wallet-utils@8.9.7", "@near-wallet-selector/wallet-utils@^8.9.7": +"@near-wallet-selector/wallet-utils@8.9.7", "@near-wallet-selector/wallet-utils@^8.9.5", "@near-wallet-selector/wallet-utils@^8.9.7": version "8.9.7" resolved "https://registry.yarnpkg.com/@near-wallet-selector/wallet-utils/-/wallet-utils-8.9.7.tgz#8a0d8f611820301a758ebb5321ba83b4812f42e9" integrity sha512-hVNF8z2EK8FPMaH2V2RIpJRT3CSIo8Epq6ysRRHVPFCXnqDjHfTWe39WYi4uAZldeCMCLQeRm5y8YL5QiAL3ig== @@ -9734,6 +9792,33 @@ near-api-js@2.1.3: node-fetch "^2.6.1" tweetnacl "^1.0.1" +near-api-js@^2.1.3: + version "2.1.4" + resolved "https://registry.yarnpkg.com/near-api-js/-/near-api-js-2.1.4.tgz#562bb7047bf3699fbdf78f9a6620366069ad7cd9" + integrity sha512-e1XicyvJvQMtu7qrG8oWyAdjHJJCoy+cvbW6h2Dky4yj7vC85omQz/x7IgKl71VhzDj2/TGUwjTVESp6NSe75A== + dependencies: + "@near-js/accounts" "0.1.4" + "@near-js/crypto" "0.0.5" + "@near-js/keystores" "0.0.5" + "@near-js/keystores-browser" "0.0.5" + "@near-js/keystores-node" "0.0.5" + "@near-js/providers" "0.0.7" + "@near-js/signers" "0.0.5" + "@near-js/transactions" "0.2.1" + "@near-js/types" "0.0.4" + "@near-js/utils" "0.0.4" + "@near-js/wallet-account" "0.0.7" + ajv "^8.11.2" + ajv-formats "^2.1.1" + bn.js "5.2.1" + borsh "^0.7.0" + depd "^2.0.0" + error-polyfill "^0.1.3" + http-errors "^1.7.2" + near-abi "0.1.1" + node-fetch "^2.6.1" + tweetnacl "^1.0.1" + near-api-js@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/near-api-js/-/near-api-js-3.0.4.tgz#5ee094ce53e30239cc817ca942ec3e9739296dbb" From be29cfc7aca2118b8fae41df3839e0e629a5aee4 Mon Sep 17 00:00:00 2001 From: Zeeshan Ahmad Date: Fri, 3 May 2024 07:41:02 -0700 Subject: [PATCH 07/18] Fix background --- apps/builddao/widget/components/Library.jsx | 1 + apps/builddao/widget/home/Footer.jsx | 1 + apps/builddao/widget/template/SidebarLayout.jsx | 1 + 3 files changed, 3 insertions(+) diff --git a/apps/builddao/widget/components/Library.jsx b/apps/builddao/widget/components/Library.jsx index b309bda1..547e5b9a 100644 --- a/apps/builddao/widget/components/Library.jsx +++ b/apps/builddao/widget/components/Library.jsx @@ -709,6 +709,7 @@ const renderMenuItem = (c, i) => { const Grid = styled.div` display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); + background: var(--bg-1, #000000); gap: 1rem; .main { diff --git a/apps/builddao/widget/home/Footer.jsx b/apps/builddao/widget/home/Footer.jsx index 217b8231..f0f093f5 100644 --- a/apps/builddao/widget/home/Footer.jsx +++ b/apps/builddao/widget/home/Footer.jsx @@ -3,6 +3,7 @@ const Container = styled.div` display: flex; flex-direction: column; gap: 80px; + background: var(--bg-1, #000000); @media screen and (max-width: 768px) { padding: 32px 20px; diff --git a/apps/builddao/widget/template/SidebarLayout.jsx b/apps/builddao/widget/template/SidebarLayout.jsx index 70ff1752..54f7ecce 100644 --- a/apps/builddao/widget/template/SidebarLayout.jsx +++ b/apps/builddao/widget/template/SidebarLayout.jsx @@ -5,6 +5,7 @@ const { Button } = VM.require("${config_account}/widget/components") || { const Container = styled.div` display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); + background: var(--bg-1, #000000); gap: 1rem; @media screen and (max-width: 768px) { From 39cadcc740a7a9e98bf68376d34714bbaa546ab0 Mon Sep 17 00:00:00 2001 From: Zeeshan Ahmad Date: Fri, 3 May 2024 08:18:33 -0700 Subject: [PATCH 08/18] Legacy app Cleanup (#279) * Cleanup * Add back daos fetch --- apps/builddao/widget/app.jsx | 210 +----------------------- apps/builddao/widget/components/CSS.jsx | 203 +++++++++++++++++++++++ apps/builddao/widget/config/app.jsx | 72 -------- apps/builddao/widget/config/feed.jsx | 159 ------------------ apps/builddao/widget/feed/templates.jsx | 48 ++++++ apps/builddao/widget/page/feed.jsx | 59 +------ apps/builddao/widget/page/inspect.jsx | 2 +- 7 files changed, 267 insertions(+), 486 deletions(-) create mode 100644 apps/builddao/widget/components/CSS.jsx delete mode 100644 apps/builddao/widget/config/app.jsx delete mode 100644 apps/builddao/widget/config/feed.jsx create mode 100644 apps/builddao/widget/feed/templates.jsx diff --git a/apps/builddao/widget/app.jsx b/apps/builddao/widget/app.jsx index 25bd991e..770c3d92 100644 --- a/apps/builddao/widget/app.jsx +++ b/apps/builddao/widget/app.jsx @@ -1,3 +1,7 @@ +const { CSS } = VM.require("${config_account}/widget/components.CSS") || { + CSS: () => <>, +}; + const config = { theme: { // add key values to define colors @@ -100,213 +104,11 @@ const config = { }, }; -const Root = styled.div` - --stroke-color: rgba(255, 255, 255, 0.2); - --bg-1: #000; - --bg-1-hover: #010002; - --bg-1-hover-transparent: rgba(13, 2, 15, 0); - --bg-2: #23242b; - --label-color: #fff; - --font-color: #fff; - --font-muted-color: #cdd0d5; - --black: #000; - --system-red: #fd2a5c; - --yellow: #eca227; - - --compose-bg: #23242b; - - --post-bg: #23242b; - --post-bg-hover: #1d1f25; - --post-bg-transparent: rgba(23, 24, 28, 0); - - --button-primary-bg: #eca227; - --button-outline-bg: transparent; - --button-default-bg: #23242b; - - --button-primary-color: #000; - --button-outline-color: #fff; - --button-default-color: #fff; - - --button-primary-hover-bg: #e49b48; - --button-outline-hover-bg: rgba(255, 255, 255, 0.2); - --button-default-hover-bg: #17181c; - - /* Poppins Font */ - @font-face { - font-family: "Poppins"; - font-weight: 100; - font-style: normal; - src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Thin.eot"); - src: - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Thin.eot?#iefix") - format("embedded-opentype"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Thin.woff2") - format("woff2"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Thin.woff") - format("woff"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Thin.ttf") - format("truetype"); - font-display: swap; - } - @font-face { - font-family: "Poppins"; - font-weight: 200; - font-style: normal; - src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraLight.eot"); - src: - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraLight.eot?#iefix") - format("embedded-opentype"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraLight.woff2") - format("woff2"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraLight.woff") - format("woff"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraLight.ttf") - format("truetype"); - font-display: swap; - } - @font-face { - font-family: "Poppins"; - font-weight: 300; - font-style: normal; - src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Light.eot"); - src: - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Light.eot?#iefix") - format("embedded-opentype"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Light.woff2") - format("woff2"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Light.woff") - format("woff"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Light.ttf") - format("truetype"); - font-display: swap; - } - @font-face { - font-family: "Poppins"; - font-weight: 400; - font-style: normal; - src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Regular.eot"); - src: - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Regular.eot?#iefix") - format("embedded-opentype"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Regular.woff2") - format("woff2"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Regular.woff") - format("woff"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Regular.ttf") - format("truetype"); - font-display: swap; - } - @font-face { - font-family: "Poppins"; - font-weight: 500; - font-style: normal; - src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Medium.eot"); - src: - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Medium.eot?#iefix") - format("embedded-opentype"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Medium.woff2") - format("woff2"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Medium.woff") - format("woff"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Medium.ttf") - format("truetype"); - font-display: swap; - } - @font-face { - font-family: "Poppins"; - font-weight: 600; - font-style: normal; - src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-SemiBold.eot"); - src: - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-SemiBold.eot?#iefix") - format("embedded-opentype"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-SemiBold.woff2") - format("woff2"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-SemiBold.woff") - format("woff"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-SemiBold.ttf") - format("truetype"); - font-display: swap; - } - @font-face { - font-family: "Poppins"; - font-weight: 700; - font-style: normal; - src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Bold.eot"); - src: - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Bold.eot?#iefix") - format("embedded-opentype"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Bold.woff2") - format("woff2"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Bold.woff") - format("woff"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Bold.ttf") - format("truetype"); - font-display: swap; - } - @font-face { - font-family: "Poppins"; - font-weight: 800; - font-style: normal; - src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraBold.eot"); - src: - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraBold.eot?#iefix") - format("embedded-opentype"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraBold.woff2") - format("woff2"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraBold.woff") - format("woff"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraBold.ttf") - format("truetype"); - font-display: swap; - } - @font-face { - font-family: "Poppins"; - font-weight: 900; - font-style: normal; - src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Black.eot"); - src: - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Black.eot?#iefix") - format("embedded-opentype"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Black.woff2") - format("woff2"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Black.woff") - format("woff"), - url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Black.ttf") - format("truetype"); - font-display: swap; - } - - /* Inter Font */ - @font-face { - font-family: InterVariable; - font-style: normal; - font-weight: 100 900; - font-display: swap; - src: url("https://rsms.me/inter/font-files/InterVariable.woff2?v=4.0") - format("woff2"); - } - @font-face { - font-family: InterVariable; - font-style: italic; - font-weight: 100 900; - font-display: swap; - src: url("https://rsms.me/inter/font-files/InterVariable-Italic.woff2?v=4.0") - format("woff2"); - } - - /* Typeahead Fix */ - .rbt-token-removeable { - background: #007bff; - color: #fff; - } -`; - return ( - + - + ); diff --git a/apps/builddao/widget/components/CSS.jsx b/apps/builddao/widget/components/CSS.jsx new file mode 100644 index 00000000..881a3f32 --- /dev/null +++ b/apps/builddao/widget/components/CSS.jsx @@ -0,0 +1,203 @@ +const CSS = styled.div` + --stroke-color: rgba(255, 255, 255, 0.2); + --bg-1: #000; + --bg-1-hover: #010002; + --bg-1-hover-transparent: rgba(13, 2, 15, 0); + --bg-2: #23242b; + --label-color: #fff; + --font-color: #fff; + --font-muted-color: #cdd0d5; + --black: #000; + --system-red: #fd2a5c; + --yellow: #eca227; + + --compose-bg: #23242b; + + --post-bg: #23242b; + --post-bg-hover: #1d1f25; + --post-bg-transparent: rgba(23, 24, 28, 0); + + --button-primary-bg: #eca227; + --button-outline-bg: transparent; + --button-default-bg: #23242b; + + --button-primary-color: #000; + --button-outline-color: #fff; + --button-default-color: #fff; + + --button-primary-hover-bg: #e49b48; + --button-outline-hover-bg: rgba(255, 255, 255, 0.2); + --button-default-hover-bg: #17181c; + + /* Poppins Font */ + @font-face { + font-family: "Poppins"; + font-weight: 100; + font-style: normal; + src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Thin.eot"); + src: + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Thin.eot?#iefix") + format("embedded-opentype"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Thin.woff2") + format("woff2"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Thin.woff") + format("woff"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Thin.ttf") + format("truetype"); + font-display: swap; + } + @font-face { + font-family: "Poppins"; + font-weight: 200; + font-style: normal; + src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraLight.eot"); + src: + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraLight.eot?#iefix") + format("embedded-opentype"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraLight.woff2") + format("woff2"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraLight.woff") + format("woff"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraLight.ttf") + format("truetype"); + font-display: swap; + } + @font-face { + font-family: "Poppins"; + font-weight: 300; + font-style: normal; + src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Light.eot"); + src: + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Light.eot?#iefix") + format("embedded-opentype"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Light.woff2") + format("woff2"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Light.woff") + format("woff"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Light.ttf") + format("truetype"); + font-display: swap; + } + @font-face { + font-family: "Poppins"; + font-weight: 400; + font-style: normal; + src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Regular.eot"); + src: + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Regular.eot?#iefix") + format("embedded-opentype"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Regular.woff2") + format("woff2"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Regular.woff") + format("woff"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Regular.ttf") + format("truetype"); + font-display: swap; + } + @font-face { + font-family: "Poppins"; + font-weight: 500; + font-style: normal; + src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Medium.eot"); + src: + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Medium.eot?#iefix") + format("embedded-opentype"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Medium.woff2") + format("woff2"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Medium.woff") + format("woff"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Medium.ttf") + format("truetype"); + font-display: swap; + } + @font-face { + font-family: "Poppins"; + font-weight: 600; + font-style: normal; + src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-SemiBold.eot"); + src: + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-SemiBold.eot?#iefix") + format("embedded-opentype"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-SemiBold.woff2") + format("woff2"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-SemiBold.woff") + format("woff"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-SemiBold.ttf") + format("truetype"); + font-display: swap; + } + @font-face { + font-family: "Poppins"; + font-weight: 700; + font-style: normal; + src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Bold.eot"); + src: + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Bold.eot?#iefix") + format("embedded-opentype"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Bold.woff2") + format("woff2"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Bold.woff") + format("woff"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Bold.ttf") + format("truetype"); + font-display: swap; + } + @font-face { + font-family: "Poppins"; + font-weight: 800; + font-style: normal; + src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraBold.eot"); + src: + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraBold.eot?#iefix") + format("embedded-opentype"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraBold.woff2") + format("woff2"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraBold.woff") + format("woff"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-ExtraBold.ttf") + format("truetype"); + font-display: swap; + } + @font-face { + font-family: "Poppins"; + font-weight: 900; + font-style: normal; + src: url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Black.eot"); + src: + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Black.eot?#iefix") + format("embedded-opentype"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Black.woff2") + format("woff2"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Black.woff") + format("woff"), + url("https://cdn.jsdelivr.net/gh/webfontworld/Poppins/Poppins-Black.ttf") + format("truetype"); + font-display: swap; + } + + /* Inter Font */ + @font-face { + font-family: InterVariable; + font-style: normal; + font-weight: 100 900; + font-display: swap; + src: url("https://rsms.me/inter/font-files/InterVariable.woff2?v=4.0") + format("woff2"); + } + @font-face { + font-family: InterVariable; + font-style: italic; + font-weight: 100 900; + font-display: swap; + src: url("https://rsms.me/inter/font-files/InterVariable-Italic.woff2?v=4.0") + format("woff2"); + } + + /* Typeahead Fix */ + .rbt-token-removeable { + background: #007bff; + color: #fff; + } +`; + +return { CSS }; diff --git a/apps/builddao/widget/config/app.jsx b/apps/builddao/widget/config/app.jsx deleted file mode 100644 index 80061284..00000000 --- a/apps/builddao/widget/config/app.jsx +++ /dev/null @@ -1,72 +0,0 @@ -return { - type: "app", - routes: { - home: { - path: "${config_account}/widget/page.home", - blockHeight: "final", - init: { - name: "Home", - }, - }, - feed: { - path: "${config_account}/widget/page.feed", - blockHeight: "final", - init: { - name: "Activity", - }, - }, - projects: { - path: "${config_account}/widget/page.projects", - blockHeight: "final", - init: { - name: "Projects", - }, - hide: true, - }, - proposal: { - path: "buildhub.near/widget/Proposals", - blockHeight: "final", - init: { - name: "Proposals", - }, - }, - resources: { - path: "${config_account}/widget/page.resources", - blockHeight: "final", - init: { - name: "Resources", - }, - }, - library: { - path: "${config_account}/widget/page.library", - blockHeight: "final", - init: { - name: "Library", - }, - }, - profile: { - path: "${config_account}/widget/page.profile", - blockHeight: "final", - init: { - name: "Profile", - }, - hide: true, - }, - inspect: { - path: "${config_account}/widget/page.inspect", - blockHeight: "final", - init: { - name: "Inspect", - }, - hide: true, - }, - project: { - path: "${config_account}/widget/page.project", - blockHeight: "final", - init: { - name: "Project Page", - }, - hide: true, - }, - }, -}; diff --git a/apps/builddao/widget/config/feed.jsx b/apps/builddao/widget/config/feed.jsx deleted file mode 100644 index c422b9d2..00000000 --- a/apps/builddao/widget/config/feed.jsx +++ /dev/null @@ -1,159 +0,0 @@ -const { Post } = VM.require("${config_account}/widget/components") || { - Post: () => <>, -}; - -function formatDate(date) { - const options = { year: "numeric", month: "short", day: "numeric" }; - return date.toLocaleDateString("en-US", options); -} - -const daoName = "Build DAO"; -const feedLink = "${alias_gateway_url}/feed"; - -return { - type: "app", // every.near/type/app - routes: { - all: { - path: "${config_account}/widget/Feed", - blockHeight: "final", - init: { - name: "All", // maybe these should be moved to navbar specific - icon: "bi-list", - requiredHashtags: ["build"], - }, - }, - updates: { - path: "${config_account}/widget/Feed", - blockHeight: "final", - init: { - name: "Updates", - icon: "bi-bell", - requiredHashtags: ["build", "update"], - template: `### BUILDER UPDATE: ${formatDate(new Date())} -(posted via [${daoName} Gateway](${feedLink}?tab=update)) - -**✅ DONE** -- [what'd you do] -- [link proof] - -**⏩ NEXT** -- [what's next?] -- [what are you thinking about?] - -**🛑 BLOCKERS** -- [what's blocking you?] -- [how can someone help?] -`, - }, - }, - question: { - path: "${config_account}/widget/Feed", - blockHeight: "final", - init: { - name: "Question", - icon: "bi-question-lg", - requiredHashtags: ["build", "question"], - template: `## what is your question? -(posted via [${daoName} Gateway](${feedLink}?tab=question)) - -[what are you thinking about?] -[why are you asking?] -`, - }, - }, - idea: { - path: "${config_account}/widget/Feed", - blockHeight: "final", - init: { - name: "Idea", - icon: "bi-lightbulb", - requiredHashtags: ["build", "idea"], - template: `## IDEA TITLE -(posted via [${daoName} Gateway](${feedLink}?tab=idea)) - -**What idea are you proposing?** -- [Describe the idea] - -**Context or additional information:** -- [Provide any context or details] -`, - }, - }, - feedback: { - path: "${config_account}/widget/Feed", - blockHeight: "final", - init: { - name: "Feedback", - icon: "bi-chat-left-text", - requiredHashtags: ["build", "feedback"], - }, - }, - events: { - path: "${config_account}/widget/events.Calendar", - blockHeight: "final", - init: { - name: "Events", - icon: "bi-calendar", - app: "every", - thing: "event", - }, - }, - bookmarks: { - path: "${config_account}/widget/OrderedGraphFeed", - blockHeight: "final", - init: { - name: "Bookmarks", - icon: "bi-bookmark", - itemType: "bookmark", - renderItem: (item) => { - return ( - - ); - }, - }, - }, - request: { - path: "${config_account}/widget/Feed", - blockHeight: "final", - init: { - name: "Request", - icon: "bi-file-earmark-text", - requiredHashtags: ["build", "request"], - customActions: [ - { - type: "modal", - icon: "bi-file-earmark-text", - label: "Propose", - onClick: (modalToggles) => { - const toggle = modalToggles.propose; - toggle(); - }, - }, - ], - template: `## REQUEST TITLE -(posted via [${daoName} Gateway](${feedLink}?tab=request)) - -#### Description -[Detailed description of what the proposal is about.] - -#### Why This Proposal? -[Explanation of why this proposal is necessary or beneficial.] -`, - }, - }, - proposals: { - path: "${config_account}/widget/Proposals", - blockHeight: "final", - init: { - name: "Proposals", - icon: "bi-file-earmark-text", - daoId: "build.sputnik-dao.near", - }, - }, - }, -}; diff --git a/apps/builddao/widget/feed/templates.jsx b/apps/builddao/widget/feed/templates.jsx new file mode 100644 index 00000000..a58bbc17 --- /dev/null +++ b/apps/builddao/widget/feed/templates.jsx @@ -0,0 +1,48 @@ +function formatDate(date) { + const options = { year: "numeric", month: "short", day: "numeric" }; + return date.toLocaleDateString("en-US", options); +} + +const daoName = "Build DAO"; +const feedLink = "${alias_gateway_url}/feed"; + +const TEMPLATES = { + updates: `### BUILDER UPDATE: ${formatDate(new Date())} +(posted via [${daoName} Gateway](${feedLink}?tab=update)) +**✅ DONE** +- [what'd you do] +- [link proof] +**⏩ NEXT** +- [what's next?] +- [what are you thinking about?] +**🛑 BLOCKERS** +- [what's blocking you?] +- [how can someone help?] +`, + question: `## what is your question? +(posted via [${daoName} Gateway](${feedLink}?tab=question)) + +[what are you thinking about?] +[why are you asking?] +`, + idea: `## IDEA TITLE +(posted via [${daoName} Gateway](${feedLink}?tab=idea)) + +**What idea are you proposing?** +- [Describe the idea] + +**Context or additional information:** +- [Provide any context or details] +`, + request: `## REQUEST TITLE +(posted via [${daoName} Gateway](${feedLink}?tab=request)) + +#### Description +[Detailed description of what the proposal is about.] + +#### Why This Proposal? +[Explanation of why this proposal is necessary or beneficial.] +`, +}; + +return { TEMPLATES }; diff --git a/apps/builddao/widget/page/feed.jsx b/apps/builddao/widget/page/feed.jsx index 2dee250c..07d12fa8 100644 --- a/apps/builddao/widget/page/feed.jsx +++ b/apps/builddao/widget/page/feed.jsx @@ -1,3 +1,7 @@ +const { TEMPLATES } = VM.require("${config_account}/widget/feed.templates") || { + TEMPLATES: {}, +}; + const { SidebarLayout } = VM.require( "${config_account}/widget/template.SidebarLayout", ) || { @@ -8,14 +12,6 @@ const { Post } = VM.require("${config_account}/widget/components") || { Post: () => <>, }; -function formatDate(date) { - const options = { year: "numeric", month: "short", day: "numeric" }; - return date.toLocaleDateString("en-US", options); -} - -const daoName = "Build DAO"; -const feedLink = "${alias_gateway_url}/feed"; - const config = { theme: {}, layout: { @@ -25,9 +21,8 @@ const config = { }, }, blocks: { - // these get passed to the layout and children Header: () => <>, - Footer: () => <>, // customize your footer + Footer: () => <>, }, router: { param: "tab", @@ -51,21 +46,7 @@ const config = { name: "Updates", icon: "bi-bell", requiredHashtags: ["build", "update"], - template: `### BUILDER UPDATE: ${formatDate(new Date())} - (posted via [${daoName} Gateway](${feedLink}?tab=update)) - - **✅ DONE** - - [what'd you do] - - [link proof] - - **⏩ NEXT** - - [what's next?] - - [what are you thinking about?] - - **🛑 BLOCKERS** - - [what's blocking you?] - - [how can someone help?] - `, + template: TEMPLATES.updates, }, }, question: { @@ -76,12 +57,7 @@ const config = { name: "Question", icon: "bi-question-lg", requiredHashtags: ["build", "question"], - template: `## what is your question? - (posted via [${daoName} Gateway](${feedLink}?tab=question)) - - [what are you thinking about?] - [why are you asking?] - `, + template: TEMPLATES.question, }, }, idea: { @@ -92,15 +68,7 @@ const config = { name: "Idea", icon: "bi-lightbulb", requiredHashtags: ["build", "idea"], - template: `## IDEA TITLE - (posted via [${daoName} Gateway](${feedLink}?tab=idea)) - - **What idea are you proposing?** - - [Describe the idea] - - **Context or additional information:** - - [Provide any context or details] - `, + template: TEMPLATES.idea, }, }, feedback: { @@ -163,15 +131,7 @@ const config = { }, }, ], - template: `## REQUEST TITLE -(posted via [${daoName} Gateway](${feedLink}?tab=request)) - -#### Description -[Detailed description of what the proposal is about.] - -#### Why This Proposal? -[Explanation of why this proposal is necessary or beneficial.] -`, + template: TEMPLATES.request, }, }, proposals: { @@ -182,7 +142,6 @@ const config = { name: "Proposals", icon: "bi-file-earmark-text", daoId: "build.sputnik-dao.near", - template: "", }, }, }, diff --git a/apps/builddao/widget/page/inspect.jsx b/apps/builddao/widget/page/inspect.jsx index f66581fb..ff79ac4c 100644 --- a/apps/builddao/widget/page/inspect.jsx +++ b/apps/builddao/widget/page/inspect.jsx @@ -25,7 +25,7 @@ return ( From 3c70ffb0908dda69080255154f56fe598a1292ff Mon Sep 17 00:00:00 2001 From: Jiku Godwill Nsanwi <65053264+Jikugodwill@users.noreply.github.com> Date: Sat, 4 May 2024 15:44:38 +0100 Subject: [PATCH 09/18] Added playwright test suite (#277) * Added playwright test suite * prettier * Removed quality.yml * Removed bos-loader and comments --- .github/workflows/continuous-integration.yml | 38 +++++++ .github/workflows/quality.yml | 26 ----- package.json | 2 + playwright-tests/README.md | 64 +++++++++++ .../storage-states/admin-connected.json | 27 +++++ .../storage-states/wallet-connected.json | 27 +++++ .../storage-states/wallet-not-connected.json | 15 +++ playwright-tests/testUtils.js | 31 ++++++ .../tests/bosloaderenvironment.spec.js | 22 ++++ playwright-tests/util/constants.js | 3 + playwright.config.js | 103 ++++++++++++++++++ yarn.lock | 57 +++++----- 12 files changed, 361 insertions(+), 54 deletions(-) create mode 100644 .github/workflows/continuous-integration.yml delete mode 100644 .github/workflows/quality.yml create mode 100644 playwright-tests/README.md create mode 100644 playwright-tests/storage-states/admin-connected.json create mode 100644 playwright-tests/storage-states/wallet-connected.json create mode 100644 playwright-tests/storage-states/wallet-not-connected.json create mode 100644 playwright-tests/testUtils.js create mode 100644 playwright-tests/tests/bosloaderenvironment.spec.js create mode 100644 playwright-tests/util/constants.js create mode 100644 playwright.config.js diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 00000000..24085eb6 --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,38 @@ +name: CI +on: + pull_request: + push: + branches: + - main + +jobs: + prettier: + name: Prettier + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: "yarn" + - name: Install dependencies + run: yarn install --frozen-lockfile + - name: Run code formatting check + run: yarn run fmt:check + playwright-tests: + name: Playwright tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: "yarn" + - name: Install dependencies + run: | + yarn add bos-workspace + npx playwright install-deps + npx playwright install + - name: Run tests + run: | + npx playwright test \ No newline at end of file diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml deleted file mode 100644 index 68ec467c..00000000 --- a/.github/workflows/quality.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Code Quality Check - -on: - pull_request: - push: - branches: - - main - -jobs: - prettier: - name: Prettier - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - cache: "yarn" - - - name: Install dependencies - run: yarn install - - - name: Run code formatting check - run: yarn run fmt:check diff --git a/package.json b/package.json index 6ad45cc7..0ac1fe6b 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,7 @@ "prod:analyze": "yarn prod -- --env presets=analyze", "build": "yarn prod", "start": "yarn dev", + "test": "npx playwright test", "lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0" }, "eslintConfig": { @@ -103,6 +104,7 @@ "@babel/core": "^7.15.5", "@babel/preset-env": "^7.15.4", "@babel/preset-react": "^7.14.5", + "@playwright/test": "^1.43.1", "assert": "^2.0.0", "babel-loader": "^8.2.2", "bos-workspace": "^1.0.0-alpha", diff --git a/playwright-tests/README.md b/playwright-tests/README.md new file mode 100644 index 00000000..cd123ffa --- /dev/null +++ b/playwright-tests/README.md @@ -0,0 +1,64 @@ +# Testing Guide + +This project uses [playwright](https://playwright.dev/) for end-to-end testing. Please become familiar with this documentation. + +## Writing tests + +Tests should be written for each change or addition to the codebase. +If a new feature is introduced, tests should be written to validate its functionality. If a bug is fixed, tests should be written to prevent regression. Writing tests not only safeguards against future breaks by other developers but also accelerates development by minimizing manual coding and browser interactions. + +When writing tests, remember to: + +- Test user-visible behavior +- Make tests as isolated as possible +- Avoid testing third-party dependencies + +> **[LEARN BEST PRACTICES](https://playwright.dev/docs/best-practices)** + +See the [cookbook](#cookbook) for help in covering scenerios. It is possible to [generate tests](https://playwright.dev/docs/codegen) via the [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright). + +## Running tests + +To run the tests, you may do so through the command line: + +```cmd +npm run test +``` + +Or through VS Code **(recommended)**, see [Getting started - VS Code](https://playwright.dev/docs/getting-started-vscode). + +## Recording video + +You may automatically record video with your tests by setting + +``` +use: { + video: "on" +} +``` + +in the [playwright.config.js](../playwright.config.js). After running tests, you will find the output as a `.webm` in `./test-results`. Then, [convert to MP4](https://video.online-convert.com/convert/webm-to-mp4) and share. + +It is encouraged to include video in pull requests in order to demonstrate functionality and prove thorough testing. + +## Cookbook + +### Capturing the VM Confirmation Popup + +Currently, none of the tests post actual transactions to the smart contracts. Still you should try writing your tests so that they do the actual function call, but just skip the final step of sending the transaction. You can do this by capturing the transaction confirmation popup provided by the NEAR social VM. + +```javascript +// click button that triggers transaction +await page.getByRole("button", { name: "Donate" }).nth(1).click(); + +const transactionObj = JSON.parse(await page.locator("div.modal-body code").innerText()); + +// do something with transactionObj +expect(transactionObj).toMatchObject({ + amount: 100, + message: "", + projectId: DEFAULT_PROJECT_ID, +}); +``` + +See the test called "project with no active pot should donate direct with correct amount" in donate.spec.js for a full example. diff --git a/playwright-tests/storage-states/admin-connected.json b/playwright-tests/storage-states/admin-connected.json new file mode 100644 index 00000000..67e6de5f --- /dev/null +++ b/playwright-tests/storage-states/admin-connected.json @@ -0,0 +1,27 @@ +{ + "cookies": [], + "origins": [ + { + "origin": "http://localhost:8080", + "localStorage": [ + { + "name": "near-wallet-selector:selectedWalletId", + "value": "\"my-near-wallet\"" + }, + { + "name": "near_app_wallet_auth_key", + "value": "{\"accountId\":\"buildhub.near\"}" + }, + { + "name": "near-social-vm:v01::accountId:", + "value": "{\"accountId\":\"buildhub.near\"}" + }, + { + "name": "flags", + "value": "{\"bosLoaderUrl\":\"http://127.0.0.1:3030\"}" + } + ] + } + ], + "sessionStorage": [] +} diff --git a/playwright-tests/storage-states/wallet-connected.json b/playwright-tests/storage-states/wallet-connected.json new file mode 100644 index 00000000..ac54d16a --- /dev/null +++ b/playwright-tests/storage-states/wallet-connected.json @@ -0,0 +1,27 @@ +{ + "cookies": [], + "origins": [ + { + "origin": "http://localhost:8080", + "localStorage": [ + { + "name": "near-wallet-selector:selectedWalletId", + "value": "\"my-near-wallet\"" + }, + { + "name": "near_app_wallet_auth_key", + "value": "{\"accountId\":\"anybody.near\"}" + }, + { + "name": "near-social-vm:v01::accountId:", + "value": "anybody.near" + }, + { + "name": "flags", + "value": "{\"bosLoaderUrl\":\"http://127.0.0.1:3030\"}" + } + ] + } + ], + "sessionStorage": [] +} diff --git a/playwright-tests/storage-states/wallet-not-connected.json b/playwright-tests/storage-states/wallet-not-connected.json new file mode 100644 index 00000000..73acb7e4 --- /dev/null +++ b/playwright-tests/storage-states/wallet-not-connected.json @@ -0,0 +1,15 @@ +{ + "cookies": [], + "origins": [ + { + "origin": "http://localhost:8080", + "localStorage": [ + { + "name": "flags", + "value": "{\"bosLoaderUrl\":\"http://127.0.0.1:3030\"}" + } + ] + } + ], + "sessionStorage": [] +} diff --git a/playwright-tests/testUtils.js b/playwright-tests/testUtils.js new file mode 100644 index 00000000..1421fef6 --- /dev/null +++ b/playwright-tests/testUtils.js @@ -0,0 +1,31 @@ +import { expect } from "@playwright/test"; + +export const pauseIfVideoRecording = async (page) => { + let isVideoRecorded = (await page.video()) ? true : false; + if (isVideoRecorded) { + await page.waitForTimeout(500); + } +}; + +export const setInputAndAssert = async (page, selector, value) => { + await page.fill(selector, value); + const actualValue = await page.inputValue(selector); + expect(actualValue).toBe(value); +}; + +export const selectAndAssert = async (page, selector, value) => { + await page.selectOption(selector, { value: value }); + const selectedValue = await page.$eval(selector, (select) => select.value); + expect(selectedValue).toBe(value); +}; + +export const waitForSelectorToBeVisible = async (page, selector) => { + await page.waitForSelector(selector, { + state: "visible", + }); +}; + +export const clickWhenSelectorIsVisible = async (page, selector) => { + waitForSelectorToBeVisible(page, selector); + await page.click(selector); +}; diff --git a/playwright-tests/tests/bosloaderenvironment.spec.js b/playwright-tests/tests/bosloaderenvironment.spec.js new file mode 100644 index 00000000..50840fc5 --- /dev/null +++ b/playwright-tests/tests/bosloaderenvironment.spec.js @@ -0,0 +1,22 @@ +import { test, expect } from "@playwright/test"; + +test("should find bos loader configuration in localstorage", async ({ + page, +}) => { + await page.goto("/"); + + const localStoreFlags = await page.evaluate(() => + localStorage.getItem("flags"), + ); + expect(localStoreFlags).toEqual( + JSON.stringify({ bosLoaderUrl: "http://127.0.0.1:8080/api/loader" }), + ); +}); + +test("should not get bos loader fetch error", async ({ page }) => { + await page.goto("/buildhub.near/widget/app?page=home"); + const bodyText = await page.textContent("body"); + expect(bodyText).not.toContain( + 'Source code for "buildhub.near/widget/app" is not found', + ); +}); diff --git a/playwright-tests/util/constants.js b/playwright-tests/util/constants.js new file mode 100644 index 00000000..ecc9bb16 --- /dev/null +++ b/playwright-tests/util/constants.js @@ -0,0 +1,3 @@ +/** + * constants + */ diff --git a/playwright.config.js b/playwright.config.js new file mode 100644 index 00000000..033e6117 --- /dev/null +++ b/playwright.config.js @@ -0,0 +1,103 @@ +// @ts-check +import { defineConfig, devices } from "@playwright/test"; + +/** + * @see https://playwright.dev/docs/test-configuration + */ +export default defineConfig({ + testDir: "./playwright-tests/tests", + /* Maximum time one test can run for. */ + timeout: 30 * 1000, + expect: { + /** + * Maximum time expect() should wait for the condition to be met. + * For example in `await expect(locator).toHaveText();` + */ + timeout: 5000, + }, + /* Run tests in files in parallel */ + fullyParallel: true, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? "100%" : undefined, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: "line", + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + video: "off", + /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ + actionTimeout: 0, + /* Base URL to use in actions like `await page.goto('/')`. */ + baseURL: "http://localhost:8080", + + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: "on-first-retry", + storageState: { + cookies: [], + origins: [ + { + origin: "http://localhost:8080", + localStorage: [ + { + name: "flags", + value: JSON.stringify({ + bosLoaderUrl: "http://127.0.0.1:8080/api/loader", + }), + }, + ], + }, + ], + }, + }, + + /* Configure projects for major browsers */ + projects: [ + { + name: "chromium", + use: { ...devices["Desktop Chrome"] }, + }, + + /*{ + name: 'firefox', + use: { ...devices['Desktop Firefox'] }, + }, + + { + name: 'webkit', + use: { ...devices['Desktop Safari'] }, + },*/ + + /* Test against mobile viewports. */ + // { + // name: 'Mobile Chrome', + // use: { ...devices['Pixel 5'] }, + // }, + // { + // name: 'Mobile Safari', + // use: { ...devices['iPhone 12'] }, + // }, + + /* Test against branded browsers. */ + // { + // name: 'Microsoft Edge', + // use: { channel: 'msedge' }, + // }, + // { + // name: 'Google Chrome', + // use: { channel: 'chrome' }, + // }, + ], + + /* Folder for test artifacts such as screenshots, videos, traces, etc. */ + outputDir: "test-results/", + + /* Run your local dev server before starting the tests */ + webServer: { + command: "npm run dev", + port: 8080, + reuseExistingServer: !process.env.CI, + }, +}); diff --git a/yarn.lock b/yarn.lock index b6bd27c9..1432b915 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2917,6 +2917,13 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== +"@playwright/test@^1.43.1": + version "1.43.1" + resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.43.1.tgz#16728a59eb8ce0f60472f98d8886d6cab0fa3e42" + integrity sha512-HgtQzFgNEEo4TE22K/X7sYTYNqEMMTZmFS8kTq6m8hXj+m1D8TgwgIbumHddJa9h4yl4GkKb8/bgAl2+g7eDgA== + dependencies: + playwright "1.43.1" + "@polka/url@^1.0.0-next.24": version "1.0.0-next.25" resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.25.tgz#f077fdc0b5d0078d30893396ff4827a13f99e817" @@ -7528,6 +7535,11 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== +fsevents@2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + fsevents@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" @@ -10456,6 +10468,20 @@ pkg-types@^1.1.0: mlly "^1.6.1" pathe "^1.1.2" +playwright-core@1.43.1: + version "1.43.1" + resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.43.1.tgz#0eafef9994c69c02a1a3825a4343e56c99c03b02" + integrity sha512-EI36Mto2Vrx6VF7rm708qSnesVQKbxEWvPrfA1IPY6HgczBplDx7ENtx+K2n4kJ41sLLkuGfmb0ZLSSXlDhqPg== + +playwright@1.43.1: + version "1.43.1" + resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.43.1.tgz#8ad08984ac66c9ef3d0db035be54dd7ec9f1c7d9" + integrity sha512-V7SoH0ai2kNt1Md9E3Gwas5B9m8KR2GVvwZnAI6Pg0m3sh7UvgiYhRrhsziCmqMJNouPckiOhk8T+9bSAK0VIA== + dependencies: + playwright-core "1.43.1" + optionalDependencies: + fsevents "2.3.2" + pngjs@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-5.0.0.tgz#e79dd2b215767fd9c04561c01236df960bce7fbb" @@ -11992,16 +12018,7 @@ strict-uri-encode@^2.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -12079,14 +12096,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -13099,7 +13109,7 @@ word-wrap@^1.2.5: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -13117,15 +13127,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From 148b2e4f104b0c69f94cd51018bbd026ee656a63 Mon Sep 17 00:00:00 2001 From: Zeeshan Ahmad Date: Thu, 9 May 2024 07:52:45 -0700 Subject: [PATCH 10/18] Add notifications page --- apps/builddao/widget/TrialAccountBanner.jsx | 2 +- apps/builddao/widget/app.jsx | 10 ++- apps/builddao/widget/app/view.jsx | 1 + apps/builddao/widget/components/CSS.jsx | 4 + apps/builddao/widget/components/Navbar.jsx | 98 +++++++++++++++++++-- apps/builddao/widget/login.jsx | 2 +- apps/builddao/widget/logout.jsx | 2 +- apps/builddao/widget/page/notifications.jsx | 63 +++++++++++++ 8 files changed, 170 insertions(+), 12 deletions(-) create mode 100644 apps/builddao/widget/page/notifications.jsx diff --git a/apps/builddao/widget/TrialAccountBanner.jsx b/apps/builddao/widget/TrialAccountBanner.jsx index 92c42502..9d8faaf0 100644 --- a/apps/builddao/widget/TrialAccountBanner.jsx +++ b/apps/builddao/widget/TrialAccountBanner.jsx @@ -20,7 +20,7 @@ const Container = styled.div` img { width: 100%; - max-height: 100vh; + min-height: 100vh; object-fit: cover; object-position: center top; position: absolute; diff --git a/apps/builddao/widget/app.jsx b/apps/builddao/widget/app.jsx index 770c3d92..36f86cc3 100644 --- a/apps/builddao/widget/app.jsx +++ b/apps/builddao/widget/app.jsx @@ -9,7 +9,7 @@ const config = { "--secondary-color": "white", background: "var(--main-color)", color: "var(--secondary-color)", - height: "100vh", + height: "100%", }, layout: { src: "${alias_devs}/widget/Layout", @@ -100,6 +100,14 @@ const config = { }, hide: true, }, + notifications: { + path: "${config_account}/widget/page.notifications", + blockHeight: "final", + init: { + name: "Notifications", + }, + hide: true, + }, }, }, }; diff --git a/apps/builddao/widget/app/view.jsx b/apps/builddao/widget/app/view.jsx index 4f532ee3..4217972c 100644 --- a/apps/builddao/widget/app/view.jsx +++ b/apps/builddao/widget/app/view.jsx @@ -82,6 +82,7 @@ const Container = styled.div` const Content = styled.div` width: 100%; height: 100%; + background: black; `; // const Template = config.Template ?? (({children}) => <>{children}); diff --git a/apps/builddao/widget/components/CSS.jsx b/apps/builddao/widget/components/CSS.jsx index 881a3f32..cfe88922 100644 --- a/apps/builddao/widget/components/CSS.jsx +++ b/apps/builddao/widget/components/CSS.jsx @@ -198,6 +198,10 @@ const CSS = styled.div` background: #007bff; color: #fff; } + + .placeholder-glow { + background: var(--bg-1, black); + } `; return { CSS }; diff --git a/apps/builddao/widget/components/Navbar.jsx b/apps/builddao/widget/components/Navbar.jsx index af9934d8..74165a0c 100644 --- a/apps/builddao/widget/components/Navbar.jsx +++ b/apps/builddao/widget/components/Navbar.jsx @@ -208,6 +208,25 @@ const MobileContent = styled.div` justify-content: space-between; `; +const getNotificationCount = () => { + const notificationFeedSrc = "mob.near/widget/NotificationFeed"; + + const lastBlockHeight = Storage.get("lastBlockHeight", notificationFeedSrc); + if (lastBlockHeight === null) { + return ""; + } + + const notifications = Social.index("notify", context.accountId, { + order: "asc", + from: (lastBlockHeight ?? 0) + 1, + // subscribe: true, + }); + + return notifications.length; +}; + +const unreadNotifications = getNotificationCount(); + function Navbar(props) { const { page, routes } = props; const [dropdown, setDropdown] = useState(false); @@ -263,6 +282,37 @@ function Navbar(props) { + {context.accountId && ( + + )}
- +
+ {context.accountId && ( + + )} + +
diff --git a/apps/builddao/widget/login.jsx b/apps/builddao/widget/login.jsx index 39f55bd1..7490f4bc 100644 --- a/apps/builddao/widget/login.jsx +++ b/apps/builddao/widget/login.jsx @@ -11,7 +11,7 @@ const LoginContainer = styled.div` img { width: 100%; - max-height: 100vh; + min-height: 100vh; object-fit: cover; object-position: center top; position: absolute; diff --git a/apps/builddao/widget/logout.jsx b/apps/builddao/widget/logout.jsx index 06f4beea..4c0117d6 100644 --- a/apps/builddao/widget/logout.jsx +++ b/apps/builddao/widget/logout.jsx @@ -11,7 +11,7 @@ const LogoutContainer = styled.div` img { width: 100%; - max-height: 100vh; + min-height: 100vh; object-fit: cover; object-position: center top; position: absolute; diff --git a/apps/builddao/widget/page/notifications.jsx b/apps/builddao/widget/page/notifications.jsx new file mode 100644 index 00000000..95ae8328 --- /dev/null +++ b/apps/builddao/widget/page/notifications.jsx @@ -0,0 +1,63 @@ +const accountId = context.accountId; + +if (!accountId) { + return "Sign in with NEAR Wallet"; +} + +const index = { + action: "notify", + key: accountId, + options: { + limit: 50, + order: "desc", + subscribe: true, + }, + cacheOptions: { + ignoreCache: true, + }, +}; + +const StyledNotification = styled.div` + .me-2.text-truncate, + .text-muted { + color: white !important; + } + + .btn.rounded-5 { + border-radius: 8px !important; + border: 1px solid rgba(255, 255, 255, 0.2) !important; + font-family: "Poppins", sans-serif !important; + font-weight: 500 !important; + color: white !important; + background: black !important; + } +`; + +const renderItem = (item, i) => { + if (i === 0) { + Storage.set("lastBlockHeight", item.blockHeight); + } + return ( + + +
+
+ } + src="mob.near/widget/Notification.Item" + key={i} + props={item} + /> +
+ ); +}; + +return ( +
+ +
+); From 092abc5b5b796bd6fb42284da3b7ec782a3ba537 Mon Sep 17 00:00:00 2001 From: Zeeshan Ahmad Date: Thu, 9 May 2024 07:53:22 -0700 Subject: [PATCH 11/18] Revert "Add notifications page" This reverts commit 937f03cb3d9bdc5247779c4738c24ea171290d89. --- apps/builddao/widget/TrialAccountBanner.jsx | 2 +- apps/builddao/widget/app.jsx | 10 +-- apps/builddao/widget/app/view.jsx | 1 - apps/builddao/widget/components/CSS.jsx | 4 - apps/builddao/widget/components/Navbar.jsx | 98 ++------------------- apps/builddao/widget/login.jsx | 2 +- apps/builddao/widget/logout.jsx | 2 +- apps/builddao/widget/page/notifications.jsx | 63 ------------- 8 files changed, 12 insertions(+), 170 deletions(-) delete mode 100644 apps/builddao/widget/page/notifications.jsx diff --git a/apps/builddao/widget/TrialAccountBanner.jsx b/apps/builddao/widget/TrialAccountBanner.jsx index 9d8faaf0..92c42502 100644 --- a/apps/builddao/widget/TrialAccountBanner.jsx +++ b/apps/builddao/widget/TrialAccountBanner.jsx @@ -20,7 +20,7 @@ const Container = styled.div` img { width: 100%; - min-height: 100vh; + max-height: 100vh; object-fit: cover; object-position: center top; position: absolute; diff --git a/apps/builddao/widget/app.jsx b/apps/builddao/widget/app.jsx index 36f86cc3..770c3d92 100644 --- a/apps/builddao/widget/app.jsx +++ b/apps/builddao/widget/app.jsx @@ -9,7 +9,7 @@ const config = { "--secondary-color": "white", background: "var(--main-color)", color: "var(--secondary-color)", - height: "100%", + height: "100vh", }, layout: { src: "${alias_devs}/widget/Layout", @@ -100,14 +100,6 @@ const config = { }, hide: true, }, - notifications: { - path: "${config_account}/widget/page.notifications", - blockHeight: "final", - init: { - name: "Notifications", - }, - hide: true, - }, }, }, }; diff --git a/apps/builddao/widget/app/view.jsx b/apps/builddao/widget/app/view.jsx index 4217972c..4f532ee3 100644 --- a/apps/builddao/widget/app/view.jsx +++ b/apps/builddao/widget/app/view.jsx @@ -82,7 +82,6 @@ const Container = styled.div` const Content = styled.div` width: 100%; height: 100%; - background: black; `; // const Template = config.Template ?? (({children}) => <>{children}); diff --git a/apps/builddao/widget/components/CSS.jsx b/apps/builddao/widget/components/CSS.jsx index cfe88922..881a3f32 100644 --- a/apps/builddao/widget/components/CSS.jsx +++ b/apps/builddao/widget/components/CSS.jsx @@ -198,10 +198,6 @@ const CSS = styled.div` background: #007bff; color: #fff; } - - .placeholder-glow { - background: var(--bg-1, black); - } `; return { CSS }; diff --git a/apps/builddao/widget/components/Navbar.jsx b/apps/builddao/widget/components/Navbar.jsx index 74165a0c..af9934d8 100644 --- a/apps/builddao/widget/components/Navbar.jsx +++ b/apps/builddao/widget/components/Navbar.jsx @@ -208,25 +208,6 @@ const MobileContent = styled.div` justify-content: space-between; `; -const getNotificationCount = () => { - const notificationFeedSrc = "mob.near/widget/NotificationFeed"; - - const lastBlockHeight = Storage.get("lastBlockHeight", notificationFeedSrc); - if (lastBlockHeight === null) { - return ""; - } - - const notifications = Social.index("notify", context.accountId, { - order: "asc", - from: (lastBlockHeight ?? 0) + 1, - // subscribe: true, - }); - - return notifications.length; -}; - -const unreadNotifications = getNotificationCount(); - function Navbar(props) { const { page, routes } = props; const [dropdown, setDropdown] = useState(false); @@ -282,37 +263,6 @@ function Navbar(props) { - {context.accountId && ( - - )}
-
- {context.accountId && ( - - )} - -
+ diff --git a/apps/builddao/widget/login.jsx b/apps/builddao/widget/login.jsx index 7490f4bc..39f55bd1 100644 --- a/apps/builddao/widget/login.jsx +++ b/apps/builddao/widget/login.jsx @@ -11,7 +11,7 @@ const LoginContainer = styled.div` img { width: 100%; - min-height: 100vh; + max-height: 100vh; object-fit: cover; object-position: center top; position: absolute; diff --git a/apps/builddao/widget/logout.jsx b/apps/builddao/widget/logout.jsx index 4c0117d6..06f4beea 100644 --- a/apps/builddao/widget/logout.jsx +++ b/apps/builddao/widget/logout.jsx @@ -11,7 +11,7 @@ const LogoutContainer = styled.div` img { width: 100%; - min-height: 100vh; + max-height: 100vh; object-fit: cover; object-position: center top; position: absolute; diff --git a/apps/builddao/widget/page/notifications.jsx b/apps/builddao/widget/page/notifications.jsx deleted file mode 100644 index 95ae8328..00000000 --- a/apps/builddao/widget/page/notifications.jsx +++ /dev/null @@ -1,63 +0,0 @@ -const accountId = context.accountId; - -if (!accountId) { - return "Sign in with NEAR Wallet"; -} - -const index = { - action: "notify", - key: accountId, - options: { - limit: 50, - order: "desc", - subscribe: true, - }, - cacheOptions: { - ignoreCache: true, - }, -}; - -const StyledNotification = styled.div` - .me-2.text-truncate, - .text-muted { - color: white !important; - } - - .btn.rounded-5 { - border-radius: 8px !important; - border: 1px solid rgba(255, 255, 255, 0.2) !important; - font-family: "Poppins", sans-serif !important; - font-weight: 500 !important; - color: white !important; - background: black !important; - } -`; - -const renderItem = (item, i) => { - if (i === 0) { - Storage.set("lastBlockHeight", item.blockHeight); - } - return ( - - -
-
- } - src="mob.near/widget/Notification.Item" - key={i} - props={item} - /> -
- ); -}; - -return ( -
- -
-); From 9406b9965215d04c1870d5d48f4a675d6520599c Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> Date: Fri, 10 May 2024 08:29:08 +0530 Subject: [PATCH 12/18] Integrated google calendar for events (#285) * integrated google calendar for events * change btn variant --- .../widget/events/GoogleCalendarJoin.jsx | 22 +++++++++++++++++++ apps/builddao/widget/events/ListView.jsx | 7 ++++++ apps/builddao/widget/events/MonthView.jsx | 7 ++++++ 3 files changed, 36 insertions(+) create mode 100644 apps/builddao/widget/events/GoogleCalendarJoin.jsx diff --git a/apps/builddao/widget/events/GoogleCalendarJoin.jsx b/apps/builddao/widget/events/GoogleCalendarJoin.jsx new file mode 100644 index 00000000..f807f21f --- /dev/null +++ b/apps/builddao/widget/events/GoogleCalendarJoin.jsx @@ -0,0 +1,22 @@ +const { Button } = VM.require("${config_account}/widget/components") || { + Button: () => <>, +}; + +const { data } = props; + +function parseDateForGoogleCalendar(date) { + return date ? new Date(date).toISOString().replace(/-|:|\.\d+/g, "") : ""; +} + +const googleEventLink = `https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(data.title)}&details=${encodeURIComponent(data.extendedProps.description ?? data.description)}&location=${encodeURIComponent(data?.url)}&dates=${encodeURIComponent(parseDateForGoogleCalendar(data.start))}/${encodeURIComponent(parseDateForGoogleCalendar(data.end))}`; + +return ( + +); diff --git a/apps/builddao/widget/events/ListView.jsx b/apps/builddao/widget/events/ListView.jsx index 4224aa9e..2ccd7bc1 100644 --- a/apps/builddao/widget/events/ListView.jsx +++ b/apps/builddao/widget/events/ListView.jsx @@ -416,6 +416,13 @@ const EventGroup = ({ date }) => { > Join Now + {eventAuthor === context.accountId && ( + {eventAuthor === context.accountId && ( +
-
- - handleTags(e)} - /> -
-
- - -
-
+ ); diff --git a/apps/builddao/widget/components/modals/projects/ImportAndCreate.jsx b/apps/builddao/widget/components/modals/projects/ImportAndCreate.jsx new file mode 100644 index 00000000..e5e4f882 --- /dev/null +++ b/apps/builddao/widget/components/modals/projects/ImportAndCreate.jsx @@ -0,0 +1,60 @@ +const { Modal, Button } = VM.require("${config_account}/widget/components") || { + Modal: () => <>, + Button: () => <>, +}; + +const showModal = props.showModal; +const toggleModal = props.toggleModal; +const toggle = props.toggle; +const bootstrapTheme = props.bootstrapTheme || "dark"; +const onClickCreate = props.onClickCreate || (() => {}); +const onClickImport = props.onClickImport || (() => {}); + +const Item = ({ title, description, src, onClick }) => { + return ( +
+ +
+
{title}
+
{description}
+
+
+ ); +}; + +const Container = styled.div` + .pointer-cursor { + cursor: pointer; + } + .text-sm { + font-size: 13px; + } +`; +return ( + + + + +
+ +
+
+
+); diff --git a/apps/builddao/widget/components/modals/projects/PotlockImport.jsx b/apps/builddao/widget/components/modals/projects/PotlockImport.jsx new file mode 100644 index 00000000..1d4dc964 --- /dev/null +++ b/apps/builddao/widget/components/modals/projects/PotlockImport.jsx @@ -0,0 +1,181 @@ +const { Modal, Button } = VM.require("${config_account}/widget/components") || { + Modal: () => <>, + Button: () => <>, +}; +const { getTagsFromSocialProfileData, getTeamMembersFromSocialProfileData } = + VM.require("potlock.near/widget/utils") || { + getTagsFromSocialProfileData: () => [], + getTeamMembersFromSocialProfileData: () => [], + }; + +const showModal = props.showModal; +const toggleModal = props.toggleModal; +const toggle = props.toggle; +const bootstrapTheme = props.bootstrapTheme || "dark"; + +let ListsSDK = + VM.require("potlock.near/widget/SDK.lists") || + (() => ({ + getRegistrations: () => {}, + })); +ListsSDK = ListsSDK({ env: "production" }); + +const allRegistrations = ListsSDK.getRegistrations() || []; +const isRegisteredProject = allRegistrations.find( + (registration) => registration.registrant_id === accountId, +); + +const [showCreateModalProjectId, setShowCreateModalProjectId] = useState(null); +const [projects, approvedProjects] = useMemo(() => { + allRegistrations.sort((a, b) => + b.status === "Approved" + ? -1 + : a.status === "Approved" + ? 1 + : a.status.localeCompare(b.status), + ); + allRegistrations.sort((a, b) => b.submitted_ms - a.submitted_ms); + + const approvedProjects = allRegistrations.filter( + (project) => project.status === "Approved", + ); + return [allRegistrations, approvedProjects]; +}, allRegistrations); + +const [filteredProjects, setFilteredProjects] = useState(approvedProjects); + +const searchByWords = (projects, searchTerm) => { + searchTerm = searchTerm.toLowerCase().trim(); + let results = []; + projects.forEach((project) => { + const { registrant_id, status } = project; + const data = Social.getr(`${registrant_id}/profile`); + if ( + registrant_id.includes(searchTerm) || + status.toLowerCase().includes(searchTerm) + ) { + results.push(project); + } else if (data) { + if ( + data.description.toLowerCase().includes(searchTerm) || + data.name.toLowerCase().includes(searchTerm) || + getTagsFromSocialProfileData(data) + .join("") + .toLowerCase() + .includes(searchTerm) || + getTeamMembersFromSocialProfileData(data) + .join("") + .toLowerCase() + .includes(searchTerm) + ) { + results.push(project); + } + } + }); + + setFilteredProjects(results); +}; + +const ProjectList = styled.div` + display: grid; + gap: 31px; + padding-bottom: 3rem; + // For mobile devices (1 column) + @media screen and (max-width: 739px) { + grid-template-columns: repeat(1, 1fr); + } + + // For tablet devices (2 columns) + @media screen and (min-width: 740px) and (max-width: 1023px) { + grid-template-columns: repeat(2, 1fr); + } + + // For desktop devices (3 columns) + @media screen and (min-width: 1024px) { + grid-template-columns: repeat(3, 1fr); + } +`; + +const Search = useMemo(() => { + return ( + { + searchByWords(projects, value); + }, + }} + /> + ); +}, []); + +function shuffleArray(array) { + return array.sort(() => Math.random() - 0.5); +} + +const ProjectsComponent = useMemo(() => { + const shuffledProjects = shuffleArray(filteredProjects || []); + return ( + + {(shuffledProjects || []).slice(0, 18).map((project) => { + return ( + + } + props={{ + ...props, + projectId: project.registrant_id, + allowDonate: false, + setShowCreateModalProjectId: setShowCreateModalProjectId, + }} + /> + ); + })} + + ); +}, [filteredProjects]); + +if (showCreateModalProjectId) { + return ( + setShowCreateModalProjectId(v), + togglePotlockImportModal: () => toggleModal(), + poltlockProjectId: showCreateModalProjectId, + }} + /> + ); +} + +return ( + +
+ {Search} + {ProjectsComponent} +
+
+); diff --git a/apps/builddao/widget/components/modals/projects/PotlockProjectCard.jsx b/apps/builddao/widget/components/modals/projects/PotlockProjectCard.jsx new file mode 100644 index 00000000..7228b004 --- /dev/null +++ b/apps/builddao/widget/components/modals/projects/PotlockProjectCard.jsx @@ -0,0 +1,443 @@ +const { potId, potDetail, payoutDetails, projects } = props; +const { nearToUsd, ipfsUrlFromCid, yoctosToNear, yoctosToUsdWithFallback } = + VM.require("potlock.near/widget/utils") || { + ipfsUrlFromCid: () => "", + yoctosToNear: () => "", + yoctosToUsdWithFallback: () => "", + nearToUsd: 1, + }; + +const { _address } = VM.require( + `potlock.near/widget/Components.DonorsUtils`, +) || { + _address: (address) => address, +}; + +const { ownerId, NADA_BOT_URL, SUPPORTED_FTS } = VM.require( + "potlock.near/widget/constants", +) || { + ownerId: "", + NADA_BOT_URL: "", + SUPPORTED_FTS: {}, +}; +const { getTagsFromSocialProfileData } = VM.require( + "potlock.near/widget/utils", +) || { + getTagsFromSocialProfileData: () => [], +}; + +const PotSDK = VM.require("potlock.near/widget/SDK.pot") || { + getDonationsForProject: () => {}, +}; + +let DonateSDK = + VM.require("potlock.near/widget/SDK.donate") || + (() => ({ + getDonationsForRecipient: () => {}, + })); +DonateSDK = DonateSDK({ env: "production" }); + +const Card = styled.div` + display: flex; + flex-direction: column; + max-width: 500px; + width: 100%; + height: 100%; + overflow: hidden; + border-radius: 12px; + background: var(--bg-color, #23242b); + color: var(--text-color, #fff); + margin-left: auto; + margin-right: auto; + transition: all 300ms; + &:hover { + transform: translateY(-0.5rem); + } + cursor: pointer; +`; + +const HeaderContainer = styled.div` + padding-left: 16px; + &:hover { + text-decoration: none; + cursor: pointer; + } + @media screen and (max-width: 768px) { + border-radius: 0; + } +`; + +const backgroundStyleHeightPx = 168; + +const BackgroundImageContainer = styled.div` + svg { + position: absolute; + top: ${backgroundStyleHeightPx / 2}px; + left: 50%; + transform: translate(-50%, -50%); + opacity: 0; // Start with the image invisible + transition: opacity 0.3s; + z-index: 2; // Ensure the image is on top + pointer-events: none; + } +`; + +const ProfileImageContainer = styled.div` + transform: translateY(138px); + width: 40px; + height: 40px; + position: absolute; + + img { + width: 40px; + height: 40px; + } + + &:hover { + cursor: pointer; + + &:after { + background-color: rgba( + 45.9, + 45.9, + 45.9, + 0.4 + ); // Dark overlay with 40% opacity on hover + } + + svg { + opacity: 1; // Make the image visible on hover + } + } +`; + +const Info = styled.div` + display: flex; + flex-direction: column; + margin-top: 176px; + padding: 16px 24px; + gap: 16px; + flex: 1; +`; + +const Title = styled.div` + font-size: 16px; + font-weight: 600; + width: 100%; +`; + +const SubTitle = styled.div` + font-size: 14px; + font-weight: 400; + word-wrap: break-word; +`; + +const DonationsInfoContainer = styled.div` + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + padding: 16px 24px; + width: 100%; + border-top: 1px #f0f0f0 solid; +`; + +const DonationsInfoItem = styled.div` + display: flex; + flex-direction: row; + gap: 8px; + align-items: center; +`; + +const Amount = styled.div` + font-size: 17px; + font-weight: 600; + line-height: 24px; +`; + +const AmountDescriptor = styled.div` + font-size: 11px; + font-weight: 400; + word-wrap: break-word; + text-transform: uppercase; + line-height: 16px; + letter-spacing: 1.1px; +`; + +const Tags = styled.div` + display: flex; + gap: 8px; + flex-wrap: wrap; +`; + +const Tag = styled.span` + box-shadow: 0px -0.699999988079071px 0px rgba(123, 123, 123, 0.36) inset; + padding: 4px 8px; + border-radius: 4px; + border: 1px solid rgba(123, 123, 123, 0.36); +`; + +// Skeleton +const loadingSkeleton = styled.keyframes` + 0% { + opacity: 0.8; + } + 50% { + opacity: 0.3; + } + 100% { + opacity: 0.6; + } +`; + +const CardSkeletonContainer = styled.div` + display: flex; + flex-direction: column; + height: 447px; + width: 100%; + max-width: 400px; + border-radius: 12px; + background: var(--bg-color, #23242b); + color: var(--text-color, #fff); + margin-left: auto; + margin-right: auto; + overflow: hidden; + animation-name: ${loadingSkeleton}; + animation-duration: 1s; + animation-iteration-count: infinite; +`; + +const HeaderSkeleton = styled.div` + display: block; + width: 100%; + height: 168px; + background: #eee; +`; + +const ProfileImageSkeleton = styled.div` + background: #e0e0e0; + margin-left: 32px; + transform: translateY(148px); + width: 40px; + height: 40px; + position: absolute; + border-radius: 999px; +`; + +const TitleSkeleton = styled.div` + width: 120px; + height: 24px; + background: #eee; + margin-left: 24px; + margin-top: 24px; +`; + +const DescriptionSkeleton = styled.div` + width: 83%; + height: 48px; + background: #eee; + margin-left: 24px; + margin-top: 24px; +`; + +const TagSkeleton = styled.div` + background: #eee; + border-radius: 4px; + height: 34px; + width: 110px; + margin: 24px; +`; + +const FooterItemSkeleton = styled.div` + width: 150px; + height: 40px; + background: #eee; + + @media screen and (max-width: 390px) { + width: 100px; + } +`; + +const DonationsInfoContainerSkeleton = styled.div` + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + padding: 16px 24px; + width: 100%; + border-top: 1px #f0f0f0 solid; +`; + +const DonationsInfoItemSkeleton = styled.div` + display: flex; + flex-direction: row; + gap: 8px; + align-items: center; +`; + +const CardSkeleton = () => ( + + + + + + + + + + + + + + + +); + +const projectId = props.project.id || props.projectId; +const profile = Social.getr(`${projectId}/profile`); + +if (profile === null) return ; + +const MAX_DESCRIPTION_LENGTH = 80; + +const { name, description, plCategories } = profile; + +const donationsForProject = potId + ? PotSDK.getDonationsForProject(potId, projectId) + : DonateSDK.getDonationsForRecipient(projectId); + +if (donationsForProject === null) return ; + +const [totalAmountNear, totalDonors] = useMemo(() => { + if (!donationsForProject) return ["0", 0]; + const donors = []; + let totalDonationAmountNear = new Big(0); + for (const donation of donationsForProject) { + if (!donors.includes(donation.donor_id)) { + donors.push(donation.donor_id); + } + if ( + donation.ft_id === "near" || + donation.base_currency === "near" || + potId + ) { + totalDonationAmountNear = totalDonationAmountNear.plus( + new Big(donation.total_amount), + ); + } + } + return [totalDonationAmountNear.toString(), donors.length]; +}, [donationsForProject]); + +const getImageSrc = (image) => { + const defaultImageUrl = + "https://ipfs.near.social/ipfs/bafkreih4i6kftb34wpdzcuvgafozxz6tk6u4f5kcr2gwvtvxikvwriteci"; + if (!image) return defaultImageUrl; + const { url, ipfs_cid } = image; + if (ipfs_cid) { + return ipfsUrlFromCid(ipfs_cid); + } else if (url) { + return url; + } + return defaultImageUrl; +}; + +const backgroundImageStyle = { + objectFit: "cover", + left: 0, + top: 0, + height: "168px", + borderRadius: "6px 6px 0px 0px", + pointerEvents: "none", +}; + +const profileImageStyle = { + width: "40px", + height: "40px", + position: "absolute", + bottom: "-10px", + left: "14px", + pointerEvents: "none", +}; + +const tags = getTagsFromSocialProfileData(profile); + +return ( +
props.setShowCreateModalProjectId(projectId)}> + + + + {profile.backgroundImage?.nft ? ( + + ) : ( + background + )} + + + {profile.image?.nft ? ( + + ) : ( + avatar + )} + + + + {_address(name, 30) || _address(projectId, 30)} + + {description.length > MAX_DESCRIPTION_LENGTH + ? description.slice(0, MAX_DESCRIPTION_LENGTH) + "..." + : description} + + {!tags.length ? ( + "No tags" + ) : ( + + {tags.map((tag, tagIndex) => ( + {tag} + ))} + + )} + + + + + {totalAmountNear + ? yoctosToUsdWithFallback(totalAmountNear, true) + : "-"} + + Raised + + + +
+); diff --git a/apps/builddao/widget/components/modals/projects/SearchBar.jsx b/apps/builddao/widget/components/modals/projects/SearchBar.jsx new file mode 100644 index 00000000..df1e51cb --- /dev/null +++ b/apps/builddao/widget/components/modals/projects/SearchBar.jsx @@ -0,0 +1,158 @@ +const { Button } = VM.require("${config_account}/widget/components") || { + Button: () => <>, +}; + +const Row = styled.div` + display: flex; + position: relative; + flex-direction: row; + align-items: center; + flex: 1; + border-radius: 6px; + border: 0.5px solid #7b7b7b; + padding: 0.5rem; + padding-left: 2.5rem; + font-size: 14px; +`; + +const SearchIcon = styled.div` + display: flex; + position: absolute; + left: 14px; + top: 50%; + transform: translateY(-50%); + width: 18px; + height: 18px; + pointer-events: none; + svg { + height: 100%; + } +`; + +const SearchBarInput = styled.input` + background: none; + width: 100%; + outline: none; + border: none; + &:focus { + outline: none; + border: none; + } +`; + +const FilterButton = styled.div` + font-weight: 500; + font-size: 14px; + display: flex; + align-items: center; + gap: 0.5rem; + cursor: pointer; + width: fit-content; + padding: 0.54rem 1rem; + border-radius: 6px; + border: 1px solid #7b7b7b; + transition: all 200ms ease-in-out; + &.active { + color: #fff; + background: #292929; + } +`; + +const FilterIcon = styled.div` + display: flex; + width: 16px; + height: 16px; + align-items: center; + justify-content: center; +`; + +const FilterMenu = styled.div` + position: absolute; + background: #fff; + font-size: 14px; + top: 110%; + right: 0; + padding: 8px; + display: flex; + flex-direction: column; + gap: 8px; + border-radius: 6px; + border: 1px solid rgba(41, 41, 41, 0.36); + box-shadow: + 0px 12px 20px -4px rgba(123, 123, 123, 0.32), + 0px 4px 8px -3px rgba(123, 123, 123, 0.2), + 0px 0px 2px 0px rgba(123, 123, 123, 0.36); + z-index: 2; + opacity: 0; + visibility: hidden; + transform: translateY(100px); + transition: all 200ms ease-in-out; + &.active { + opacity: 1; + visibility: visible; + transform: translateY(0); + } + @media screen and (max-width: 768px) { + left: 0; + background: #fff; + } +`; + +const FilterItem = styled.div` + cursor: pointer; + padding: 8px; + display: flex; + gap: 12px; + white-space: nowrap; + &:hover { + background: #292929; + color: #fff; + border-radius: 6px; + } +`; + +const { numItems, itemName, onSearch } = props; +const [searchTerm, setSearchTerm] = useState(""); + +const onSearchChange = (value) => { + setSearchTerm(value); +}; + +const handleKeyDown = (event) => { + if (event.key === "Enter") { + event.preventDefault(); + onSearch(searchTerm); + } +}; + +return ( + <> + + + + + + + onSearchChange(e.target.value)} + type="text" + autocomplete="search" + onKeyDown={handleKeyDown} + /> + + + +); diff --git a/apps/builddao/widget/components/project/Card.jsx b/apps/builddao/widget/components/project/Card.jsx index 549fcc2e..616b5b84 100644 --- a/apps/builddao/widget/components/project/Card.jsx +++ b/apps/builddao/widget/components/project/Card.jsx @@ -82,7 +82,7 @@ const ProjectCard = ({ project, type }) => { { setShowFilterModal((prev) => !prev); @@ -128,6 +130,14 @@ const toggleCreateModal = () => { setShowCreateModal((prev) => !prev); }; +const toggleImportModal = () => { + setShowImportModal((prev) => !prev); +}; + +const toggleCreateOptionsModal = () => { + setShowCreateOptionsModal((prev) => !prev); +}; + const filteredProjects = useMemo(() => { let filtered = projects; if (filters.title !== "") { @@ -180,7 +190,7 @@ return ( data-bs-theme="dark" > - { + setShowCreateOptionsModal(false); + setShowImportModal(true); + }, + onClickCreate: () => { + setShowCreateOptionsModal(false); + setShowCreateModal(true); + }, + }} + /> + + +

Projects

{context.accountId && ( - )} diff --git a/apps/builddao/widget/template/ProjectLayout.jsx b/apps/builddao/widget/template/ProjectLayout.jsx index 3c82bfab..dfbf08cc 100644 --- a/apps/builddao/widget/template/ProjectLayout.jsx +++ b/apps/builddao/widget/template/ProjectLayout.jsx @@ -147,7 +147,7 @@ const ProjectLayout = ({ /> )} - +
Date: Tue, 14 May 2024 01:09:29 +0530 Subject: [PATCH 14/18] Added testing btn in navbar (#291) * added testing btn in navbar * update positioning --- apps/builddao/widget/components/Navbar.jsx | 91 ++++++++++++++-------- 1 file changed, 57 insertions(+), 34 deletions(-) diff --git a/apps/builddao/widget/components/Navbar.jsx b/apps/builddao/widget/components/Navbar.jsx index af9934d8..bf4f7135 100644 --- a/apps/builddao/widget/components/Navbar.jsx +++ b/apps/builddao/widget/components/Navbar.jsx @@ -22,6 +22,19 @@ const NavContainer = styled.div` background-color: var(--bg, #000); border-bottom: 1px solid var(--stroke-color, rgba(255, 255, 255, 0.2)); + + .grey-btn { + display: flex; + align-items: center; + justify-content: center; + background-color: #23242b; + color: #fff; + border-radius: 8px; + outline: none; + border: 0; + width: 40px; + height: 40px; + } `; const MainContent = styled.div` @@ -216,6 +229,20 @@ function Navbar(props) { setDropdown((prev) => !prev); }; + const TestBtn = () => { + return ( + + + + ); + }; return ( @@ -263,16 +290,8 @@ function Navbar(props) { -
- + +
+
+ {context.accountId ? ( )} +
- {context.accountId ? ( -
- -
- ) : ( - <> - - - )} +
+ {context.accountId ? ( +
+ +
+ ) : ( + <> + + + )} + +
From 41d2b62c72c78e409e9cb6b82318300b6c5de6cb Mon Sep 17 00:00:00 2001 From: Zeeshan Ahmad Date: Mon, 13 May 2024 13:48:56 -0700 Subject: [PATCH 15/18] Notifications page (#288) * Useless fallback * Add notifications page * Resolve comments * fmt * Prompt for login on notifications page --- apps/builddao/widget/app.jsx | 8 + apps/builddao/widget/app/view.jsx | 1 + apps/builddao/widget/components/CSS.jsx | 4 + apps/builddao/widget/components/Navbar.jsx | 236 ++++++++++++++------ apps/builddao/widget/page/notifications.jsx | 91 ++++++++ 5 files changed, 269 insertions(+), 71 deletions(-) create mode 100644 apps/builddao/widget/page/notifications.jsx diff --git a/apps/builddao/widget/app.jsx b/apps/builddao/widget/app.jsx index 770c3d92..8cccc8df 100644 --- a/apps/builddao/widget/app.jsx +++ b/apps/builddao/widget/app.jsx @@ -100,6 +100,14 @@ const config = { }, hide: true, }, + notifications: { + path: "${config_account}/widget/page.notifications", + blockHeight: "final", + init: { + name: "Notifications", + }, + hide: true, + }, }, }, }; diff --git a/apps/builddao/widget/app/view.jsx b/apps/builddao/widget/app/view.jsx index 4f532ee3..ef0262c3 100644 --- a/apps/builddao/widget/app/view.jsx +++ b/apps/builddao/widget/app/view.jsx @@ -82,6 +82,7 @@ const Container = styled.div` const Content = styled.div` width: 100%; height: 100%; + background: var(--bg-1, #000); `; // const Template = config.Template ?? (({children}) => <>{children}); diff --git a/apps/builddao/widget/components/CSS.jsx b/apps/builddao/widget/components/CSS.jsx index 881a3f32..cfe88922 100644 --- a/apps/builddao/widget/components/CSS.jsx +++ b/apps/builddao/widget/components/CSS.jsx @@ -198,6 +198,10 @@ const CSS = styled.div` background: #007bff; color: #fff; } + + .placeholder-glow { + background: var(--bg-1, black); + } `; return { CSS }; diff --git a/apps/builddao/widget/components/Navbar.jsx b/apps/builddao/widget/components/Navbar.jsx index bf4f7135..69b5d4b8 100644 --- a/apps/builddao/widget/components/Navbar.jsx +++ b/apps/builddao/widget/components/Navbar.jsx @@ -2,10 +2,6 @@ const { Button } = VM.require("${config_account}/widget/components") || { Button: () => <>, }; -if (!Button) { - return ""; -} - const { href } = VM.require("${config_account}/widget/lib.url") || { href: () => {}, }; @@ -221,6 +217,25 @@ const MobileContent = styled.div` justify-content: space-between; `; +const getNotificationCount = () => { + const notificationFeedSrc = "${alias_mob}/widget/NotificationFeed"; + + const lastBlockHeight = Storage.get("lastBlockHeight", notificationFeedSrc); + if (lastBlockHeight === null) { + return ""; + } + + const notifications = Social.index("notify", context.accountId, { + order: "asc", + from: (lastBlockHeight ?? 0) + 1, + subscribe: true, + }); + + return notifications.length; +}; + +const unreadNotifications = getNotificationCount(); + function Navbar(props) { const { page, routes } = props; const [dropdown, setDropdown] = useState(false); @@ -290,69 +305,116 @@ function Navbar(props) { - -
- -
    -
  • - - - View source - -
  • -
  • - - - Edit code - -
  • -
-
-
- {context.accountId ? ( - - ) : ( + {context.accountId && ( )} - +
+ +
+ +
    +
  • + + + View source + +
  • +
  • + + + Edit code + +
  • +
+
+
+ {context.accountId ? ( + + ) : ( + + )} + +
- +
+ {context.accountId && ( + + )} + +
diff --git a/apps/builddao/widget/page/notifications.jsx b/apps/builddao/widget/page/notifications.jsx new file mode 100644 index 00000000..fd2681ce --- /dev/null +++ b/apps/builddao/widget/page/notifications.jsx @@ -0,0 +1,91 @@ +const { Button } = VM.require("buildhub.near/widget/components") || { + Button: () => <>, +}; + +const accountId = context.accountId; + +const LoginContainer = styled.div` + background-color: #23242b; + color: #fff; + + width: 100%; + height: 16rem; + border-radius: 1rem; + + display: flex; + flex-direction: column; + gap: 0.5rem; + align-items: center; + justify-content: center; + + margin-bottom: 1rem; +`; + +if (!accountId) { + return ( + +

Please login in order to see notifications.

+ + + +
+ ); +} + +const index = { + action: "notify", + key: accountId, + options: { + limit: 50, + order: "desc", + subscribe: true, + }, + cacheOptions: { + ignoreCache: true, + }, +}; + +const StyledNotification = styled.div` + .me-2.text-truncate, + .text-muted { + color: white !important; + } + + .btn.rounded-5 { + border-radius: 8px !important; + border: 1px solid rgba(255, 255, 255, 0.2) !important; + font-family: "Poppins", sans-serif !important; + font-weight: 500 !important; + color: white !important; + background: black !important; + } +`; + +const renderItem = (item, i) => { + if (i === 0) { + Storage.set("lastBlockHeight", item.blockHeight); + } + return ( + + +
+
+ } + 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) { -

    -
  • - - - 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 (
- + Try out the Builders Gateway with a trial account.
@@ -246,12 +246,16 @@ const Hero = (props) => { ) : ( <> -
    -
  • - - - 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 (
- + Try out the Builders Gateway with a trial account.
@@ -246,16 +246,12 @@ const Hero = (props) => { ) : ( <>