Skip to content

Commit

Permalink
support "alertStatus" field in address metadata payload
Browse files Browse the repository at this point in the history
  • Loading branch information
tom2drum committed Aug 30, 2024
1 parent e2081d4 commit 030b510
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/address/parseMetaPayload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default function parseMetaPayload(meta: AddressMetadataTag['meta']): Addr
'data',
'alertBgColor',
'alertTextColor',
'alertStatus',
];

for (const stringField of stringFields) {
Expand Down
3 changes: 3 additions & 0 deletions types/api/addressMetadata.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { AlertStatus } from '@chakra-ui/react';

export interface AddressMetadataInfo {
addresses: Record<string, {
tags: Array<AddressMetadataTag>;
Expand Down Expand Up @@ -35,6 +37,7 @@ export interface AddressMetadataTagApi extends Omit<AddressMetadataTag, 'meta'>
data?: string;
alertBgColor?: string;
alertTextColor?: string;
alertStatus?: AlertStatus;
} | null;
}

Expand Down
2 changes: 1 addition & 1 deletion ui/address/details/AddressMetadataAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const AddressMetadataAlert = ({ tags }: Props) => {
<Alert
mt="-4px"
mb={ 6 }
status="error"
status={ noteTag.meta?.alertStatus ?? 'error' }
bgColor={ noteTag.meta?.alertBgColor }
color={ noteTag.meta?.alertTextColor }
whiteSpace="pre-wrap"
Expand Down

0 comments on commit 030b510

Please sign in to comment.