From 6e52c1b28294afcebee686dec26da14a3483c2f2 Mon Sep 17 00:00:00 2001 From: Monoblade <157546326+Monobladegg@users.noreply.github.com> Date: Sun, 18 Aug 2024 07:37:32 +0300 Subject: [PATCH 01/10] checking for home_domain --- src/pages/public/account/account.tsx | 2 +- src/pages/public/account/publicnet.tsx | 62 ++++++++++++++++++++------ 2 files changed, 49 insertions(+), 15 deletions(-) diff --git a/src/pages/public/account/account.tsx b/src/pages/public/account/account.tsx index a7adc87..81d44e5 100644 --- a/src/pages/public/account/account.tsx +++ b/src/pages/public/account/account.tsx @@ -41,7 +41,7 @@ const Page: FC = () => { ); } - return ; + return typeof id === "string" && ; }; export default Page; diff --git a/src/pages/public/account/publicnet.tsx b/src/pages/public/account/publicnet.tsx index 774d26d..fae047a 100644 --- a/src/pages/public/account/publicnet.tsx +++ b/src/pages/public/account/publicnet.tsx @@ -20,7 +20,7 @@ import BalanceItem from "@/pages/public/account/(BalanceItem)"; import ignoredHomeDomains from "@/shared/configs/ignored-home-domains.json"; interface Props { - id: string | undefined | null; + id: string; } export const collapseAccount = (accountId: string) => { @@ -33,15 +33,18 @@ export const collapseAccount = (accountId: string) => { }; const PublicNet: FC = ({ id }) => { - const account = id; - const { net } = useStore(useShallow((state) => ({ net: state.net }))); + const account: string = id; + const { net }: { net: string } = useStore( + useShallow((state) => ({ net: state.net })) + ); const [information, setInformation] = useState( {} as Information ); - const [exists, setExists] = useState(true); - const [tabIndex, setTabIndex] = useState(1); - const [errorvalid, setErrorvalid] = useState(""); - const [loading, setLoading] = useState(false); + const [exists, setExists] = useState(true); + const [tabIndex, setTabIndex] = useState(1); + const [errorvalid, setErrorvalid] = useState(""); + const [loading, setLoading] = useState(false); + const [isVisibleBlockInfo, setIsVisibleBlockInfo] = useState(true); useEffect(() => { const checkAccount = async () => { @@ -136,6 +139,38 @@ const PublicNet: FC = ({ id }) => { handler(); }, [account]); + useEffect(() => { + if (information.tomlInfo) { + const accountsMatch = information.tomlInfo.match( + /ACCOUNTS=\[([\s\S]*?)\]/ + ); + if (accountsMatch && accountsMatch[1]) { + const newAccounts = accountsMatch[1] + .split("\n") + .map((line) => line.trim()) + .filter((line) => line && !line.startsWith("#")) + .map((line) => line.replace(/^"|"$|,$|"$/g, "")) + .map((line) => line.replace(/"$/, "")); + + const foundAccount = newAccounts.find((accountId) => accountId === id); + + if (foundAccount) { + setIsVisibleBlockInfo(true); + } else { + setIsVisibleBlockInfo(false); + } + } else { + setIsVisibleBlockInfo(false); + } + } else { + setIsVisibleBlockInfo(false); + } + }, [information.tomlInfo, id]); + + useEffect(() => { + console.log(isVisibleBlockInfo); + }, [isVisibleBlockInfo]); + return (
@@ -535,7 +570,7 @@ const PublicNet: FC = ({ id }) => { ); return (
  • - {processedKey}: {" "}{processedValue} + {processedKey}: {processedValue}
  • ); } @@ -633,9 +668,8 @@ const PublicNet: FC = ({ id }) => { information?.meta_data["ORG_NAME"] !== undefined && ignoredHomeDomains && information?.home_domain && - ignoredHomeDomains.includes(information?.home_domain) ? ( - "" - ) : ( + !ignoredHomeDomains.includes(information.home_domain) && + isVisibleBlockInfo ? (
    @@ -646,7 +680,7 @@ const PublicNet: FC = ({ id }) => { tabIndex === 1 ? "selected" : "" }`} onClick={(e) => { - e.preventDefault(); // Prevent the default anchor tag behavior + e.preventDefault(); setTabIndex(1); }} > @@ -658,7 +692,7 @@ const PublicNet: FC = ({ id }) => { tabIndex === 2 ? "selected" : "" }`} onClick={(e) => { - e.preventDefault(); // Prevent the default anchor tag behavior + e.preventDefault(); setTabIndex(2); }} > @@ -842,7 +876,7 @@ const PublicNet: FC = ({ id }) => {
    - )} + ) : null} ) : (
    From 00cad0c6934e38a3c2dda5eab6b33b8cfc6f25a8 Mon Sep 17 00:00:00 2001 From: Monoblade <157546326+Monobladegg@users.noreply.github.com> Date: Sun, 18 Aug 2024 07:40:38 +0300 Subject: [PATCH 02/10] add edits of Vitaliy --- README.md | 1 - src/shared/configs/trusted-mtl-assets.json | 5 ----- 2 files changed, 6 deletions(-) diff --git a/README.md b/README.md index d3ccd32..907d6ec 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ The repository is a part of the [Montelibero Organization](https://github.com/mo - [Radix Themes](https://www.radix-ui.com) - An open source component library optimized for fast development, easy maintenance, and accessibility. - [Tailwind CSS](https://tailwindcss.com) - A utility-first CSS framework packed with classes like flex, pt-4, text-center and rotate-90 that can be composed to build any design, directly in your markup. - [Axios](https://github.com/axios/axios) - A simple HTTP client for the browser and Node.js. -- [React icons](https://react-icons.github.io/react-icons) - A library of SVG React icons. - [JS Stellar SDK](https://github.com/stellar/js-stellar-sdk) - A JavaScript library for communicating with a Stellar Horizon server and Soroban RPC. It is used for building Stellar apps either on Node.js or in the browser, though it can be used in other environments with some tinkering. - [Zustand](https://github.com/pmndrs/zustand) - A state management library for React. - [TypeScript](https://www.typescriptlang.org) - A typed superset of JavaScript that compiles to plain JavaScript. diff --git a/src/shared/configs/trusted-mtl-assets.json b/src/shared/configs/trusted-mtl-assets.json index 5512546..417a5e7 100644 --- a/src/shared/configs/trusted-mtl-assets.json +++ b/src/shared/configs/trusted-mtl-assets.json @@ -19,11 +19,6 @@ "issuer": "GACKTN5DAZGWXRWB2WLM6OPBDHAMT6SJNGLJZPQMEZBUR4JUGBX2UK7V", "tag": "stablecoin" }, - { - "code": "SATSMTL", - "issuer": "GACKTN5DAZGWXRWB2WLM6OPBDHAMT6SJNGLJZPQMEZBUR4JUGBX2UK7V", - "tag": "stablecoin" - }, { "code": "MTL", "issuer": "GACKTN5DAZGWXRWB2WLM6OPBDHAMT6SJNGLJZPQMEZBUR4JUGBX2UK7V", From 254f0e2bf52421e0816fefdfbd0868a52f1e1b1b Mon Sep 17 00:00:00 2001 From: Monoblade <157546326+Monobladegg@users.noreply.github.com> Date: Sun, 18 Aug 2024 08:14:33 +0300 Subject: [PATCH 03/10] add state visibility for home domain in Summary --- src/pages/public/account/publicnet.tsx | 30 ++++++++++++-------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/pages/public/account/publicnet.tsx b/src/pages/public/account/publicnet.tsx index fae047a..ec3b9fc 100644 --- a/src/pages/public/account/publicnet.tsx +++ b/src/pages/public/account/publicnet.tsx @@ -44,7 +44,8 @@ const PublicNet: FC = ({ id }) => { const [tabIndex, setTabIndex] = useState(1); const [errorvalid, setErrorvalid] = useState(""); const [loading, setLoading] = useState(false); - const [isVisibleBlockInfo, setIsVisibleBlockInfo] = useState(true); + const [isVisibleHomeDomainInfo, setIsVisibleHomeDomainInfo] = + useState(true); useEffect(() => { const checkAccount = async () => { @@ -155,22 +156,18 @@ const PublicNet: FC = ({ id }) => { const foundAccount = newAccounts.find((accountId) => accountId === id); if (foundAccount) { - setIsVisibleBlockInfo(true); + setIsVisibleHomeDomainInfo(true); } else { - setIsVisibleBlockInfo(false); + setIsVisibleHomeDomainInfo(false); } } else { - setIsVisibleBlockInfo(false); + setIsVisibleHomeDomainInfo(false); } } else { - setIsVisibleBlockInfo(false); + setIsVisibleHomeDomainInfo(false); } }, [information.tomlInfo, id]); - useEffect(() => { - console.log(isVisibleBlockInfo); - }, [isVisibleBlockInfo]); - return (
    @@ -219,22 +216,23 @@ const PublicNet: FC = ({ id }) => {

    Summary


    - {information?.home_domain == undefined ? ( - "" - ) : ( + {information?.home_domain !== undefined && + isVisibleHomeDomainInfo && + information.home_domain && + !ignoredHomeDomains.includes(information.home_domain) ? ( <>
    Home domain:
    - {information?.home_domain == undefined + {information?.home_domain === undefined ? "none" : information?.home_domain} @@ -268,7 +266,7 @@ const PublicNet: FC = ({ id }) => {
    - )} + ) : null}
    Account lock status:
    unlocked @@ -669,7 +667,7 @@ const PublicNet: FC = ({ id }) => { ignoredHomeDomains && information?.home_domain && !ignoredHomeDomains.includes(information.home_domain) && - isVisibleBlockInfo ? ( + isVisibleHomeDomainInfo ? (
    From 4d7f859eb5dbf108de28a5e24b8ae9fc79688105 Mon Sep 17 00:00:00 2001 From: Monoblade <157546326+Monobladegg@users.noreply.github.com> Date: Sun, 18 Aug 2024 08:39:08 +0300 Subject: [PATCH 04/10] fixed bugs at Header>current network --- src/pages/public/account/publicnet.tsx | 10 ++++++++ .../shared/layouts/Header/ui/index.tsx | 25 ++++++++++++------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/pages/public/account/publicnet.tsx b/src/pages/public/account/publicnet.tsx index ec3b9fc..9b557db 100644 --- a/src/pages/public/account/publicnet.tsx +++ b/src/pages/public/account/publicnet.tsx @@ -153,6 +153,15 @@ const PublicNet: FC = ({ id }) => { .map((line) => line.replace(/^"|"$|,$|"$/g, "")) .map((line) => line.replace(/"$/, "")); + /** + * Logic to create an array of strings where item is an accountID + * that is not fake in the home_domain set by the account + * + * example: newAccounts: string[] = ['GCGLKWJX5BPX2BOCOHYA6KUBZ67FR23DAHLG7VD3YRTGEYGZX57KUGFP', + * 'GBEUDKANIFPTFHPWJ5T3R6RIO36RQBFGHYPAQ6STH7KMNDHAT36LHOLD', + * 'GA2T6GR7VXXXBETTERSAFETHANSORRYXXXPROTECTEDBYLOBSTRVAULT'] + */ + const foundAccount = newAccounts.find((accountId) => accountId === id); if (foundAccount) { @@ -891,6 +900,7 @@ const PublicNet: FC = ({ id }) => {

    ) : ( {errorvalid} + )}
    diff --git a/src/widgets/shared/layouts/Header/ui/index.tsx b/src/widgets/shared/layouts/Header/ui/index.tsx index 0f08d9a..5138a9c 100644 --- a/src/widgets/shared/layouts/Header/ui/index.tsx +++ b/src/widgets/shared/layouts/Header/ui/index.tsx @@ -191,7 +191,14 @@ export const Header: FC = () => { color: "#666", }} > - {net} + {collapseAccount( + accounts + .filter( + (account: IAccount) => account.isCurrent === true + ) + .filter((account: IAccount) => account.net === net) + .map((account: IAccount) => account.accountID)[0] + )} )} { Network{" "} {theme !== "day" ? ( - {net} + {net === "public" ? "Public" : "Testnet"} ) : ( { color: "#666", }} > - {net} + {net === "public" ? "Public" : "Testnet"} )} {
    handleSelectNet("testnet")} + } ${net !== "public" ? "selected" : ""}`} + onClick={() => handleSelectNet("public")} > - Testnet + Public
    handleSelectNet("public")} + } ${net !== "testnet" ? "selected" : ""}`} + onClick={() => handleSelectNet("testnet")} > - Public + Testnet
    )} From 286e83e0385636b055b28d170eba5ca4f1bb1f2c Mon Sep 17 00:00:00 2001 From: Monoblade <157546326+Monobladegg@users.noreply.github.com> Date: Sun, 18 Aug 2024 09:39:36 +0300 Subject: [PATCH 05/10] fixed handle net --- package-lock.json | 133 ------------------ src/pages/Layout/layout.tsx | 1 + src/pages/public/account/publicnet.tsx | 3 +- .../shared/layouts/Header/ui/index.tsx | 29 ++-- 4 files changed, 18 insertions(+), 148 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2e7b900..d608bf3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -367,126 +367,6 @@ "node": ">=16 || 14 >=14.17" } }, - "node_modules/@next/swc-darwin-arm64": { - "version": "14.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.5.tgz", - "integrity": "sha512-/9zVxJ+K9lrzSGli1///ujyRfon/ZneeZ+v4ptpiPoOU+GKZnm8Wj8ELWU1Pm7GHltYRBklmXMTUqM/DqQ99FQ==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-darwin-x64": { - "version": "14.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.5.tgz", - "integrity": "sha512-vXHOPCwfDe9qLDuq7U1OYM2wUY+KQ4Ex6ozwsKxp26BlJ6XXbHleOUldenM67JRyBfVjv371oneEvYd3H2gNSA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-arm64-gnu": { - "version": "14.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.5.tgz", - "integrity": "sha512-vlhB8wI+lj8q1ExFW8lbWutA4M2ZazQNvMWuEDqZcuJJc78iUnLdPPunBPX8rC4IgT6lIx/adB+Cwrl99MzNaA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-arm64-musl": { - "version": "14.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.5.tgz", - "integrity": "sha512-NpDB9NUR2t0hXzJJwQSGu1IAOYybsfeB+LxpGsXrRIb7QOrYmidJz3shzY8cM6+rO4Aojuef0N/PEaX18pi9OA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-x64-gnu": { - "version": "14.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.5.tgz", - "integrity": "sha512-8XFikMSxWleYNryWIjiCX+gU201YS+erTUidKdyOVYi5qUQo/gRxv/3N1oZFCgqpesN6FPeqGM72Zve+nReVXQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-x64-musl": { - "version": "14.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.5.tgz", - "integrity": "sha512-6QLwi7RaYiQDcRDSU/os40r5o06b5ue7Jsk5JgdRBGGp8l37RZEh9JsLSM8QF0YDsgcosSeHjglgqi25+m04IQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-win32-arm64-msvc": { - "version": "14.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.5.tgz", - "integrity": "sha512-1GpG2VhbspO+aYoMOQPQiqc/tG3LzmsdBH0LhnDS3JrtDx2QmzXe0B6mSZZiN3Bq7IOMXxv1nlsjzoS1+9mzZw==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-win32-ia32-msvc": { - "version": "14.2.5", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.5.tgz", - "integrity": "sha512-Igh9ZlxwvCDsu6438FXlQTHlRno4gFpJzqPjSIBZooD22tKeI4fE/YMRoHVJHmrQ2P5YL1DoZ0qaOKkbeFWeMg==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, "node_modules/@next/swc-win32-x64-msvc": { "version": "14.2.5", "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.5.tgz", @@ -3307,19 +3187,6 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", diff --git a/src/pages/Layout/layout.tsx b/src/pages/Layout/layout.tsx index 61040b3..4727d9d 100644 --- a/src/pages/Layout/layout.tsx +++ b/src/pages/Layout/layout.tsx @@ -51,6 +51,7 @@ const PageLayout: FC = ({ children }) => { ); }, [accounts, net, setIsAuth]); + const themeLS: string | undefined | null = isWindowDefined ? window.localStorage.getItem("theme") ? window.localStorage.getItem("theme") diff --git a/src/pages/public/account/publicnet.tsx b/src/pages/public/account/publicnet.tsx index 9b557db..f7d0fc1 100644 --- a/src/pages/public/account/publicnet.tsx +++ b/src/pages/public/account/publicnet.tsx @@ -157,7 +157,7 @@ const PublicNet: FC = ({ id }) => { * Logic to create an array of strings where item is an accountID * that is not fake in the home_domain set by the account * - * example: newAccounts: string[] = ['GCGLKWJX5BPX2BOCOHYA6KUBZ67FR23DAHLG7VD3YRTGEYGZX57KUGFP', + * example: newAccounts: string[] = ['GBR2RQKJY6S5JXKZVJYK6YH5CQXN5KUWQXKQO6G7XK5E5WQ4', * 'GBEUDKANIFPTFHPWJ5T3R6RIO36RQBFGHYPAQ6STH7KMNDHAT36LHOLD', * 'GA2T6GR7VXXXBETTERSAFETHANSORRYXXXPROTECTEDBYLOBSTRVAULT'] */ @@ -900,7 +900,6 @@ const PublicNet: FC = ({ id }) => {

    ) : ( {errorvalid} - )}
    diff --git a/src/widgets/shared/layouts/Header/ui/index.tsx b/src/widgets/shared/layouts/Header/ui/index.tsx index 5138a9c..fc578c2 100644 --- a/src/widgets/shared/layouts/Header/ui/index.tsx +++ b/src/widgets/shared/layouts/Header/ui/index.tsx @@ -12,6 +12,7 @@ import AccountItem from "./AccountItem"; import { collapseAccount } from "@/pages/public/account/publicnet"; export const Header: FC = () => { + const { net, setNet, @@ -72,28 +73,30 @@ export const Header: FC = () => { return () => { document.removeEventListener("mousedown", handleClickOutside); }; - }, [isOpenAddAccountModal, setIsOpenAddAccountModal]); // Добавляем зависимость + }, [isOpenAddAccountModal, setIsOpenAddAccountModal]); const toggleDropdownNet = () => setIsOpenNet(!isOpenNet); const toggleDropdownAccount = () => setIsOpenAccount(!isOpenAccount); const handleSelectNet = (network: string) => { setNet(network); - localStorage.setItem("net", network); + localStorage.setItem('net', network); setIsOpenNet(false); - const currentPath = window.location.pathname; - if (currentPath === "/public" || currentPath === "/testnet") { - const newPath = `/${network}`; - router.push(newPath); - } else if ( - currentPath.includes("/public/") || - currentPath.includes("/testnet/") - ) { - // Construct the new path with updated network segment - const newPath = `/${network}` - router.push(newPath); + const currentUrl = new URL(window.location.href); + const pathSegments = currentUrl.pathname.split('/').filter(Boolean); + + let newPath: string; + + if (pathSegments[0] === 'public' || pathSegments[0] === 'testnet') { + newPath = `/${network}${pathSegments.length > 1 ? '/' + pathSegments.slice(1).join('/') : ''}`; + } else { + newPath = `/${network}${currentUrl.pathname}`; } + + const newUrl = `${newPath}${currentUrl.search}`; + + router.push(newUrl); }; // const handleSelectAccount = (account: IAccount) => { From 5a3710cfa3cd1bcfc2ca1fdb269cbbc78751c61f Mon Sep 17 00:00:00 2001 From: Monoblade <157546326+Monobladegg@users.noreply.github.com> Date: Sun, 18 Aug 2024 11:14:18 +0300 Subject: [PATCH 06/10] fix display auth --- package-lock.json | 133 ++++++++++++++++++ src/pages/public/account/publicnet.tsx | 4 +- .../shared/layouts/Header/ui/header.scss | 1 + .../shared/layouts/Header/ui/index.tsx | 14 +- 4 files changed, 142 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index d608bf3..2e7b900 100644 --- a/package-lock.json +++ b/package-lock.json @@ -367,6 +367,126 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/@next/swc-darwin-arm64": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.5.tgz", + "integrity": "sha512-/9zVxJ+K9lrzSGli1///ujyRfon/ZneeZ+v4ptpiPoOU+GKZnm8Wj8ELWU1Pm7GHltYRBklmXMTUqM/DqQ99FQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.5.tgz", + "integrity": "sha512-vXHOPCwfDe9qLDuq7U1OYM2wUY+KQ4Ex6ozwsKxp26BlJ6XXbHleOUldenM67JRyBfVjv371oneEvYd3H2gNSA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.5.tgz", + "integrity": "sha512-vlhB8wI+lj8q1ExFW8lbWutA4M2ZazQNvMWuEDqZcuJJc78iUnLdPPunBPX8rC4IgT6lIx/adB+Cwrl99MzNaA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.5.tgz", + "integrity": "sha512-NpDB9NUR2t0hXzJJwQSGu1IAOYybsfeB+LxpGsXrRIb7QOrYmidJz3shzY8cM6+rO4Aojuef0N/PEaX18pi9OA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.5.tgz", + "integrity": "sha512-8XFikMSxWleYNryWIjiCX+gU201YS+erTUidKdyOVYi5qUQo/gRxv/3N1oZFCgqpesN6FPeqGM72Zve+nReVXQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.5.tgz", + "integrity": "sha512-6QLwi7RaYiQDcRDSU/os40r5o06b5ue7Jsk5JgdRBGGp8l37RZEh9JsLSM8QF0YDsgcosSeHjglgqi25+m04IQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.5.tgz", + "integrity": "sha512-1GpG2VhbspO+aYoMOQPQiqc/tG3LzmsdBH0LhnDS3JrtDx2QmzXe0B6mSZZiN3Bq7IOMXxv1nlsjzoS1+9mzZw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-ia32-msvc": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.5.tgz", + "integrity": "sha512-Igh9ZlxwvCDsu6438FXlQTHlRno4gFpJzqPjSIBZooD22tKeI4fE/YMRoHVJHmrQ2P5YL1DoZ0qaOKkbeFWeMg==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@next/swc-win32-x64-msvc": { "version": "14.2.5", "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.5.tgz", @@ -3187,6 +3307,19 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", diff --git a/src/pages/public/account/publicnet.tsx b/src/pages/public/account/publicnet.tsx index f7d0fc1..c96c68e 100644 --- a/src/pages/public/account/publicnet.tsx +++ b/src/pages/public/account/publicnet.tsx @@ -157,11 +157,13 @@ const PublicNet: FC = ({ id }) => { * Logic to create an array of strings where item is an accountID * that is not fake in the home_domain set by the account * - * example: newAccounts: string[] = ['GBR2RQKJY6S5JXKZVJYK6YH5CQXN5KUWQXKQO6G7XK5E5WQ4', + * example: + * ['GCGLKWJX5BPX2BOCOHYA6KUBZ67FR23DAHLG7VD3YRTGEYGZX57KUGFP', * 'GBEUDKANIFPTFHPWJ5T3R6RIO36RQBFGHYPAQ6STH7KMNDHAT36LHOLD', * 'GA2T6GR7VXXXBETTERSAFETHANSORRYXXXPROTECTEDBYLOBSTRVAULT'] */ + console.log(newAccounts) const foundAccount = newAccounts.find((accountId) => accountId === id); if (foundAccount) { diff --git a/src/widgets/shared/layouts/Header/ui/header.scss b/src/widgets/shared/layouts/Header/ui/header.scss index 98bea7b..a292c65 100644 --- a/src/widgets/shared/layouts/Header/ui/header.scss +++ b/src/widgets/shared/layouts/Header/ui/header.scss @@ -70,6 +70,7 @@ header { margin-top: 5px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); z-index: 1; + width: max-content } .dropdown-menu-light { diff --git a/src/widgets/shared/layouts/Header/ui/index.tsx b/src/widgets/shared/layouts/Header/ui/index.tsx index fc578c2..fbe945e 100644 --- a/src/widgets/shared/layouts/Header/ui/index.tsx +++ b/src/widgets/shared/layouts/Header/ui/index.tsx @@ -94,6 +94,7 @@ export const Header: FC = () => { newPath = `/${network}${currentUrl.pathname}`; } + // Сохраняем query параметры const newUrl = `${newPath}${currentUrl.search}`; router.push(newUrl); @@ -169,13 +170,6 @@ export const Header: FC = () => { } onClick={toggleDropdownAccount} > - - Current account:{" "} - {theme !== "day" ? ( {collapseAccount( @@ -263,7 +257,8 @@ export const Header: FC = () => {
    {accounts .filter((account: IAccount) => account.net === net) - .filter((account: IAccount) => account.isMultiSig) + .filter((account: IAccount) => !account.isMultiSig) + .filter((account: IAccount) => !account.isCurrent) .map((account: IAccount, index: number) => (
    {
    {accounts .filter((account: IAccount) => account.net === net) - .filter((account: IAccount) => !account.isMultiSig) + .filter((account: IAccount) => account.isMultiSig) + .filter((account: IAccount) => !account.isCurrent) .map((account: IAccount, index: number) => (
    Date: Sun, 18 Aug 2024 11:20:48 +0300 Subject: [PATCH 07/10] deleted logs --- src/pages/public/account/publicnet.tsx | 1 - src/widgets/shared/layouts/Header/ui/index.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/src/pages/public/account/publicnet.tsx b/src/pages/public/account/publicnet.tsx index c96c68e..229b1dd 100644 --- a/src/pages/public/account/publicnet.tsx +++ b/src/pages/public/account/publicnet.tsx @@ -163,7 +163,6 @@ const PublicNet: FC = ({ id }) => { * 'GA2T6GR7VXXXBETTERSAFETHANSORRYXXXPROTECTEDBYLOBSTRVAULT'] */ - console.log(newAccounts) const foundAccount = newAccounts.find((accountId) => accountId === id); if (foundAccount) { diff --git a/src/widgets/shared/layouts/Header/ui/index.tsx b/src/widgets/shared/layouts/Header/ui/index.tsx index fbe945e..eb176b4 100644 --- a/src/widgets/shared/layouts/Header/ui/index.tsx +++ b/src/widgets/shared/layouts/Header/ui/index.tsx @@ -94,7 +94,6 @@ export const Header: FC = () => { newPath = `/${network}${currentUrl.pathname}`; } - // Сохраняем query параметры const newUrl = `${newPath}${currentUrl.search}`; router.push(newUrl); From 40d3c525abfeac7148c035b29df8e7d108852202 Mon Sep 17 00:00:00 2001 From: Monoblade <157546326+Monobladegg@users.noreply.github.com> Date: Sun, 18 Aug 2024 12:10:04 +0300 Subject: [PATCH 08/10] fixed warns and errors by font-awesome --- README.md | 1 + app/globals.css | 2 + src/pages/Layout/layout.tsx | 9 --- src/pages/public/account/publicnet.tsx | 3 - .../shared/layouts/Header/ui/index.tsx | 55 +++++-------------- 5 files changed, 18 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index 907d6ec..9a27721 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ The repository is a part of the [Montelibero Organization](https://github.com/mo - [Zustand](https://github.com/pmndrs/zustand) - A state management library for React. - [TypeScript](https://www.typescriptlang.org) - A typed superset of JavaScript that compiles to plain JavaScript. - [Eslint](https://eslint.org) - A static and automatic code checker for your JavaScript projects. +- [Font-Awesome](https://fontawesome.com) - A library that provides scalable vector icons. ## Contributing diff --git a/app/globals.css b/app/globals.css index a80ecfc..127d3ff 100644 --- a/app/globals.css +++ b/app/globals.css @@ -1,3 +1,5 @@ +@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css"); + .blue-ribbon { border-top: 3px solid #08b5e5; } diff --git a/src/pages/Layout/layout.tsx b/src/pages/Layout/layout.tsx index 4727d9d..6a8b86d 100644 --- a/src/pages/Layout/layout.tsx +++ b/src/pages/Layout/layout.tsx @@ -5,7 +5,6 @@ import { useStore } from "@/features/store"; import { Footer, Header } from "@/widgets"; import { useShallow } from "zustand/react/shallow"; import AddAccountModal from "@/widgets/shared/layouts/Header/ui/AddAccountModal"; -import Script from "next/script"; import Head from "next/head"; type Props = { @@ -66,10 +65,6 @@ const PageLayout: FC = ({ children }) => { name="viewport" content="width=device-width, initial-scale=1.0" /> - Stellar Multisig @@ -99,10 +94,6 @@ const PageLayout: FC = ({ children }) => {