diff --git a/src/pages/public/account/publicnet.tsx b/src/pages/public/account/publicnet.tsx index aaff22d..7af2ebf 100644 --- a/src/pages/public/account/publicnet.tsx +++ b/src/pages/public/account/publicnet.tsx @@ -143,25 +143,25 @@ const PublicNet: FC = ({ id }) => { useEffect(() => { if (information.tomlInfo) { const accountsMatch = information.tomlInfo.match( - /ACCOUNTS=\[([\s\S]*?)\]/ + /ACCOUNTS\s*=\s*\[([\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(/"$/, "")); - /** - * Logic to create an array of strings where item is an accountID - * that is not fake in the home_domain set by the account - */ - const foundAccount = newAccounts.find((accountId) => accountId === id); - if (foundAccount) { - setIsVisibleHomeDomainInfo(true); - } else { - setIsVisibleHomeDomainInfo(false); - } + .filter((line) => line.length > 0) + .map((line) => line.replace(/^"|"$|,$/g, "")); + + const cleanedAccounts = newAccounts.map((account) => + account.replace(/"/g, "") + ); + + const foundAccount = cleanedAccounts.some( + (accountId) => accountId === id + ); + + setIsVisibleHomeDomainInfo(foundAccount); } else { setIsVisibleHomeDomainInfo(false); } @@ -771,39 +771,51 @@ const PublicNet: FC = ({ id }) => { information?.meta_data["ORG_DESCRIPTION"]} -
Org physical address:
-
- - {information?.meta_data && - information?.meta_data[ - "ORG_PHYSICAL_ADDRESS" - ]} - -
-
Org official email:
-
- - {information?.meta_data && - information?.meta_data[ - "ORG_OFFICIAL_EMAIL" - ]} - -
+ {information.meta_data["ORG_PHYSICAL_ADDRESS"] !== + undefined && ( + <> +
Org physical address:
+
+ + {information.meta_data && + information?.meta_data[ + "ORG_PHYSICAL_ADDRESS" + ]} + +
+ + )} + {information.meta_data["ORG_OFFICIAL_EMAIL"] !== + undefined && ( + <> +
Org official email:
+
+ + {information?.meta_data && + information?.meta_data[ + "ORG_OFFICIAL_EMAIL" + ]} + +
+ + )} )} diff --git a/src/widgets/shared/layouts/Header/ui/header.scss b/src/widgets/shared/layouts/Header/ui/header.scss index a292c65..d4e078f 100644 --- a/src/widgets/shared/layouts/Header/ui/header.scss +++ b/src/widgets/shared/layouts/Header/ui/header.scss @@ -84,6 +84,8 @@ header { margin-top: 5px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); z-index: 1; + width: max-content + } .dropdown-item {