Skip to content

Commit

Permalink
Fix display XLM
Browse files Browse the repository at this point in the history
  • Loading branch information
Monobladegg committed Aug 28, 2024
1 parent 59970cd commit 77bd980
Showing 1 changed file with 118 additions and 108 deletions.
226 changes: 118 additions & 108 deletions src/pages/public/account/publicnet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,18 @@ const PublicNet: FC<Props> = ({ id }) => {
<hr className="flare"></hr>
<dl>
{information?.home_domain !== undefined &&
isVisibleHomeDomainInfo &&
information.home_domain &&
!ignoredHomeDomains.includes(information.home_domain) ? (
isVisibleHomeDomainInfo &&
information.home_domain &&
!ignoredHomeDomains.includes(information.home_domain) ? (
<>
<dt>Home domain:</dt>
<dd>
<a
href={`${information?.home_domain === undefined
? "#"
: information?.home_domain
}`}
href={`${
information?.home_domain === undefined
? "#"
: information?.home_domain
}`}
rel="noreferrer noopener"
target="_blank"
>
Expand Down Expand Up @@ -352,9 +353,9 @@ const PublicNet: FC<Props> = ({ id }) => {
? "immutable, "
: ""}
{information?.flags?.auth_required == false &&
information?.flags?.auth_revocable == false &&
information?.flags?.auth_clawback_enabled == false &&
information?.flags?.auth_immutable == false
information?.flags?.auth_revocable == false &&
information?.flags?.auth_clawback_enabled == false &&
information?.flags?.auth_immutable == false
? "none"
: ""}

Expand Down Expand Up @@ -408,7 +409,7 @@ const PublicNet: FC<Props> = ({ id }) => {
</dl>

{information?.issuers?.length &&
information?.issuers?.length > 0 ? (
information?.issuers?.length > 0 ? (
<div className="account-issued-assets">
<h4
style={{
Expand Down Expand Up @@ -524,7 +525,7 @@ const PublicNet: FC<Props> = ({ id }) => {
)}
</ul>
{information?.entries &&
Object.keys(information?.entries).length ? (
Object.keys(information?.entries).length ? (
<>
<h4
style={{
Expand Down Expand Up @@ -618,44 +619,49 @@ const PublicNet: FC<Props> = ({ id }) => {
style={{ width: "100%" }}
>
<tbody>
{information?.balances
?.filter((item: Balance) => !item?.asset_code)
.map((item: Balance, index: number) => {
const totalInfo = item.balance.split(".");
const number = totalInfo[0];
const decimal =
Number(totalInfo[1]) === 0
? ""
: "." + totalInfo[1];

return (
<BalanceItem
key={index}
number={number}
decimal={decimal}
item={item}
/>
);
})}
{information?.balances
?.filter((item: Balance) => item?.asset_code)
.map((item: Balance, index: number) => {
const totalInfo = item.balance.split(".");
const number = totalInfo[0];
const decimal =
Number(totalInfo[1]) === 0
? ""
: "." + totalInfo[1];

return (
<BalanceItem
key={index}
number={number}
decimal={decimal}
item={item}
/>
);
})}
{information.balances &&
information.balances.map(
(item: Balance, index: number) => {
const totalInfo = item.balance.split(".");
const number = totalInfo[0];
const decimal =
Number(totalInfo[1]) === 0
? ""
: "." + totalInfo[1];
if (item.asset_type === "native") {
return (
<BalanceItem
key={index}
number={number}
decimal={decimal}
item={item}
/>
);
}
}
)}
{information.balances &&
information.balances.map(
(item: Balance, index: number) => {
const totalInfo = item.balance.split(".");
const number = totalInfo[0];
const decimal =
Number(totalInfo[1]) === 0
? ""
: "." + totalInfo[1];
console.log(item)
if (item.asset_code) {
return (
<BalanceItem
key={index}
number={number}
decimal={decimal}
item={item}
/>
);
}
}
)}
</tbody>
</table>
</div>
Expand All @@ -664,19 +670,20 @@ const PublicNet: FC<Props> = ({ id }) => {
</div>
</div>
{information?.meta_data &&
information?.meta_data["ORG_NAME"] !== undefined &&
ignoredHomeDomains &&
information?.home_domain &&
!ignoredHomeDomains.includes(information.home_domain) &&
isVisibleHomeDomainInfo ? (
information?.meta_data["ORG_NAME"] !== undefined &&
ignoredHomeDomains &&
information?.home_domain &&
!ignoredHomeDomains.includes(information.home_domain) &&
isVisibleHomeDomainInfo ? (
<div className="toml-props">
<div className="tabs space inline-right">
<div className="tabs-header">
<div>
<a
href="#"
className={`tabs-item condensed ${tabIndex === 1 ? "selected" : ""
}`}
className={`tabs-item condensed ${
tabIndex === 1 ? "selected" : ""
}`}
onClick={(e) => {
e.preventDefault();
setTabIndex(1);
Expand All @@ -686,8 +693,9 @@ const PublicNet: FC<Props> = ({ id }) => {
</a>
<a
href="#"
className={`tabs-item condensed ${tabIndex === 2 ? "selected" : ""
}`}
className={`tabs-item condensed ${
tabIndex === 2 ? "selected" : ""
}`}
onClick={(e) => {
e.preventDefault();
setTabIndex(2);
Expand All @@ -702,7 +710,7 @@ 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" }}
>
Expand Down Expand Up @@ -770,51 +778,52 @@ const PublicNet: FC<Props> = ({ id }) => {
</dd>
{information.meta_data["ORG_PHYSICAL_ADDRESS"] !==
undefined && (
<>
<dt>Org physical address:</dt>
<dd>
<span
className="block-select"
tabIndex={-1}
style={{
whiteSpace: "normal",
overflow: "visible",
display: "inline",
}}
>
{information.meta_data &&
information?.meta_data[
<>
<dt>Org physical address:</dt>
<dd>
<span
className="block-select"
tabIndex={-1}
style={{
whiteSpace: "normal",
overflow: "visible",
display: "inline",
}}
>
{information.meta_data &&
information?.meta_data[
"ORG_PHYSICAL_ADDRESS"
]}
</span>
</dd>
</>
)}
]}
</span>
</dd>
</>
)}
{information.meta_data["ORG_OFFICIAL_EMAIL"] !==
undefined && (
<>
<dt>Org official email:</dt>
<dd>
<a
href={`mailto:${information?.meta_data &&
information?.meta_data[
<>
<dt>Org official email:</dt>
<dd>
<a
href={`mailto:${
information?.meta_data &&
information?.meta_data[
"ORG_OFFICIAL_EMAIL"
]
}`}
target="_blank"
rel="noreferrer noopener"
>
{information?.meta_data &&
information?.meta_data[
]
}`}
target="_blank"
rel="noreferrer noopener"
>
{information?.meta_data &&
information?.meta_data[
"ORG_OFFICIAL_EMAIL"
]}
</a>
</dd>
</>
)}
</dl >
]}
</a>
</dd>
</>
)}
</dl>
)}
</div >
</div>
) : (
<div>
<pre
Expand Down Expand Up @@ -881,16 +890,17 @@ const PublicNet: FC<Props> = ({ id }) => {
</pre>
</div>
)}
</div >
</div >
</div >
</div>
</div>
</div>
) : null}
</>
) : (
<div className="cotainer">
<div
className={`search ${exists === false ? "error" : ""
} container narrow`}
className={`search ${
exists === false ? "error" : ""
} container narrow`}
style={{ padding: "20px" }}
>
<h2 className="text-overflow">Search results for {account}</h2>
Expand All @@ -904,10 +914,10 @@ const PublicNet: FC<Props> = ({ id }) => {
</div>
</div>
)}
</div >
</div >
</MainLayout >
</div>
</div>
</MainLayout>
);
};

export default PublicNet;
export default PublicNet;

0 comments on commit 77bd980

Please sign in to comment.