Skip to content

Commit

Permalink
Devlop to QA- Merge pull request #805 from credebl/develop-fixed-dco
Browse files Browse the repository at this point in the history
refactor: Schema card changes for Polygon ledger. (#804)

Signed-off-by: Krishna Waske <[email protected]>
  • Loading branch information
GHkrishna authored Oct 29, 2024
2 parents b569408 + 5c670cb commit 4488e32
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/common/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ export enum Network {
MAINNET = 'mainnet'
}

export enum PolygonNetworks {
TESTNET = 'Polygon Testnet',
MAINNET = 'Polygon Mainnet'
}

export enum CommonConstants {
BALANCELIMIT = 0.01
}
Expand Down
10 changes: 7 additions & 3 deletions src/commonComponents/SchemaCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { getFromLocalStorage } from '../api/Auth';
import { limitedAttributesLength, storageKeys } from '../config/CommonConstant';
import type { IAttribute, ISchemaCardProps, ISchemaData } from './interface';
import CustomCheckbox from './CustomCheckbox';
import { Ledgers, Network, PolygonNetworks } from '../common/enums';

const SchemaCard = (props: ISchemaCardProps) => {
const orgDidDetails = async () => {
Expand Down Expand Up @@ -134,11 +135,14 @@ const handleCheckboxChange = (checked: boolean, schemaData?: ISchemaData) => {
<CopyDid value={props.issuerDid || ""} className='truncate font-courier mt-[2px]' />
</span>
</p>
{!props.noLedger &&
{!props.noLedger && (
<p className="truncate dark:text-white break-all flex">
<span className="font-semibold mr-2">Ledger:</span> {props?.issuerDid?.split(":")[2]}
<span className="font-semibold mr-2">Ledger:</span>
{props.issuerDid?.includes(Ledgers.POLYGON)
? (props.issuerDid?.includes(Network.TESTNET) ? PolygonNetworks.TESTNET : PolygonNetworks.MAINNET)
: props?.issuerDid?.split(":")[2]}
</p>
}
)}
</div>

<div className="flex justify-between">
Expand Down

0 comments on commit 4488e32

Please sign in to comment.