Skip to content

Commit

Permalink
add ignored home domains
Browse files Browse the repository at this point in the history
  • Loading branch information
Monobladegg committed Aug 16, 2024
1 parent 5f753cf commit 13619e1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 16 deletions.
48 changes: 32 additions & 16 deletions src/pages/public/account/publicnet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { Balance, Information, Signer } from "@/shared/types";
import { DocumentInfo, Issuer } from "@/shared/types";
import { processKeys } from "@/shared/lib";
import BalanceItem from "@/pages/public/account/(BalanceItem)";
import ignoredHomeDomains from "@/shared/configs/ignored-home-domains.json";

interface Props {
id: string | undefined | null;
Expand Down Expand Up @@ -135,6 +136,10 @@ const PublicNet: FC<Props> = ({ id }) => {
handler();
}, [account]);

useEffect(() => {
console.log(information.meta_data);
}, [information.meta_data]);

return (
<MainLayout>
<div className="container">
Expand Down Expand Up @@ -588,8 +593,9 @@ const PublicNet: FC<Props> = ({ id }) => {
style={{ width: "100%" }}
>
<tbody>
{information?.balances?.filter((item: Balance) => !item?.asset_code).map(
(item: Balance, index: number) => {
{information?.balances
?.filter((item: Balance) => !item?.asset_code)
.map((item: Balance, index: number) => {
const totalInfo = item.balance.split(".");
const number = totalInfo[0];
const decimal =
Expand All @@ -598,12 +604,17 @@ const PublicNet: FC<Props> = ({ id }) => {
: "." + totalInfo[1];

return (
<BalanceItem key={index} number={number} decimal={decimal} item={item} />
<BalanceItem
key={index}
number={number}
decimal={decimal}
item={item}
/>
);
}
)}
{information?.balances?.filter((item: Balance) => item?.asset_code).map(
(item: Balance, index: number) => {
})}
{information?.balances
?.filter((item: Balance) => item?.asset_code)
.map((item: Balance, index: number) => {
const totalInfo = item.balance.split(".");
const number = totalInfo[0];
const decimal =
Expand All @@ -612,10 +623,14 @@ const PublicNet: FC<Props> = ({ id }) => {
: "." + totalInfo[1];

return (
<BalanceItem key={index} number={number} decimal={decimal} item={item} />
<BalanceItem
key={index}
number={number}
decimal={decimal}
item={item}
/>
);
}
)}
})}
</tbody>
</table>
</div>
Expand All @@ -624,7 +639,11 @@ const PublicNet: FC<Props> = ({ id }) => {
</div>
</div>
{information?.meta_data &&
information?.meta_data["ORG_NAME"] == undefined ? (
information?.meta_data["ORG_NAME"] !== undefined &&
ignoredHomeDomains &&
ignoredHomeDomains.includes(
information?.meta_data["ORG_URL"]
) ? (
""
) : (
<div className="toml-props">
Expand Down Expand Up @@ -662,12 +681,9 @@ const PublicNet: FC<Props> = ({ id }) => {
{tabIndex == 1 ? (
<div className="segment blank">
{information?.meta_data &&
information?.meta_data["ORG_NAME"] == undefined ? (
information.meta_data?.["ORG_NAME"] == undefined ? (
<div
style={{
fontSize: "13px",
textAlign: "center",
}}
style={{ fontSize: "13px", textAlign: "center" }}
>
Empty Data
</div>
Expand Down
1 change: 1 addition & 0 deletions src/shared/configs/ignored-home-domains.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["https://lobstr.co"]

0 comments on commit 13619e1

Please sign in to comment.