From d5fc9b0a4b85d77d3abd92d77a6a50c32ce50740 Mon Sep 17 00:00:00 2001 From: Jay Welsh Date: Mon, 9 Oct 2023 16:30:17 +0200 Subject: [PATCH 1/2] feat(TokenMetadataTimeline): use completed flags --- src/components/TokenMetadataTimeline.tsx | 5 ++- src/interfaces/index.ts | 2 +- src/pages/SingleTokenPage.tsx | 52 ++++++++++++------------ src/utils/constants.ts | 14 +++++-- 4 files changed, 40 insertions(+), 33 deletions(-) diff --git a/src/components/TokenMetadataTimeline.tsx b/src/components/TokenMetadataTimeline.tsx index 64c05d9..d7d422e 100644 --- a/src/components/TokenMetadataTimeline.tsx +++ b/src/components/TokenMetadataTimeline.tsx @@ -102,12 +102,13 @@ export default function VerticalLinearStepper(props: ITokenMetadataTimeline) { {timeline.map((timelineEntry, index) => ( - + {timelineEntry.milestone} - By {dayjs.unix(Number(timelineEntry.due_date)).format('MMM-D-YYYY hh:mm A')} + {timelineEntry.due_date && By {dayjs.unix(Number(timelineEntry.due_date)).format('MMM-D-YYYY hh:mm A')}} + {!timelineEntry.due_date && Date estimation pending} ))} diff --git a/src/interfaces/index.ts b/src/interfaces/index.ts index a5726d7..f9f995d 100644 --- a/src/interfaces/index.ts +++ b/src/interfaces/index.ts @@ -161,7 +161,7 @@ export interface IAttribute { } export interface ITokenMetadataTimelineEntry { milestone: string; - due_date: number; + due_date?: number; complete: boolean; is_estimate?: boolean; } diff --git a/src/pages/SingleTokenPage.tsx b/src/pages/SingleTokenPage.tsx index 2ec96e5..f73c796 100644 --- a/src/pages/SingleTokenPage.tsx +++ b/src/pages/SingleTokenPage.tsx @@ -145,32 +145,32 @@ const SingleTokenPage = () => { } if(tokenRecordQueryResponse?.data?.metadata) { let metadata = JSON.parse(tokenRecordQueryResponse?.data?.metadata); - // TODO remove temp timeline shim - if(network === 'goerli') { - metadata.timeline = [ - { - milestone: "Offer signed", - due_date: 1695301253, - complete: false, - }, - { - milestone: "Deposit payment", - due_date: 1695819674, - complete: false, - }, - { - milestone: "Inspection", - due_date: 1696424490, - complete: false, - is_estimate: true, - }, - { - milestone: "Closing", - due_date: 1697029313, - complete: false, - } - ] - } + // // temp timeline shim for testing design + // if(network === 'goerli') { + // metadata.timeline = [ + // { + // milestone: "Offer signed", + // due_date: 1695301253, + // complete: false, + // }, + // { + // milestone: "Deposit payment", + // due_date: 1695819674, + // complete: false, + // }, + // { + // milestone: "Inspection", + // due_date: 1696424490, + // complete: false, + // is_estimate: true, + // }, + // { + // milestone: "Closing", + // due_date: 1697029313, + // complete: false, + // } + // ] + // } if(metadata && isMounted) { setTokenMetadata(metadata); } diff --git a/src/utils/constants.ts b/src/utils/constants.ts index b1be1cd..51098de 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -1,6 +1,6 @@ export const STAKING_CONTRACT = '0x00000000219ab540356cBB839Cbe05303d7705Fa' -// export const API_ENDPOINT = "http://localhost:8420"; +export const API_ENDPOINT = "http://localhost:8420"; export const ENV_TO_API_ENDPOINT : {[key: string]: string} = { "local": "http://localhost:8420", @@ -8,7 +8,7 @@ export const ENV_TO_API_ENDPOINT : {[key: string]: string} = { "prod": "https://dappapi.propy.com/", } -export const API_ENDPOINT = (process?.env?.REACT_APP_ENV && ENV_TO_API_ENDPOINT[process.env.REACT_APP_ENV]) ? ENV_TO_API_ENDPOINT[process.env.REACT_APP_ENV] : 'https://dev.dappapi.propy.com/' ; +// export const API_ENDPOINT = (process?.env?.REACT_APP_ENV && ENV_TO_API_ENDPOINT[process.env.REACT_APP_ENV]) ? ENV_TO_API_ENDPOINT[process.env.REACT_APP_ENV] : 'https://dev.dappapi.propy.com/' ; export const TOKEN_NAME_PREFIX : {[key: string]: string} = { "0xB5c4910335D373eb26FeBb30B8f1d7416179A4EC": "MetaAgent", @@ -17,6 +17,7 @@ export const TOKEN_NAME_PREFIX : {[key: string]: string} = { export const TOKEN_NAME_HIDE_ID : {[key: string]: boolean} = { "0x37f6091feF42eFD50d4F07a91c955606e8dE38c2": true, "0x8fbFe4036F13e8E42E51235C9adA6efD2ACF6A95": true, + "0x73C3a1437B0307732Eb086cb2032552eBea15444": true, "0xB5c4910335D373eb26FeBb30B8f1d7416179A4EC": true, "0x567c407D054A644DBBBf2d3a6643776473f82d7a": true, } @@ -31,8 +32,13 @@ const COLLECTIONS_ENTRIES_DEV = [ { network: "goerli", address: "0x8fbFe4036F13e8E42E51235C9adA6efD2ACF6A95", - slug: "propy-deed-certificates-testnet", - } + slug: "propy-deed-certificates-staging-testnet", + }, + { + network: "goerli", + address: "0x73C3a1437B0307732Eb086cb2032552eBea15444", + slug: "propy-deed-certificates-dev-testnet", + }, ] const COLLECTIONS_ENTRIES_PROD = [ From bc98c4e9f547cad2ad9057e56cfd22ea72876ef9 Mon Sep 17 00:00:00 2001 From: Jay Welsh Date: Mon, 9 Oct 2023 16:33:06 +0200 Subject: [PATCH 2/2] chore(constants): undo localhost adjustment --- src/utils/constants.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 51098de..30a2095 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -1,6 +1,6 @@ export const STAKING_CONTRACT = '0x00000000219ab540356cBB839Cbe05303d7705Fa' -export const API_ENDPOINT = "http://localhost:8420"; +// export const API_ENDPOINT = "http://localhost:8420"; export const ENV_TO_API_ENDPOINT : {[key: string]: string} = { "local": "http://localhost:8420", @@ -8,7 +8,7 @@ export const ENV_TO_API_ENDPOINT : {[key: string]: string} = { "prod": "https://dappapi.propy.com/", } -// export const API_ENDPOINT = (process?.env?.REACT_APP_ENV && ENV_TO_API_ENDPOINT[process.env.REACT_APP_ENV]) ? ENV_TO_API_ENDPOINT[process.env.REACT_APP_ENV] : 'https://dev.dappapi.propy.com/' ; +export const API_ENDPOINT = (process?.env?.REACT_APP_ENV && ENV_TO_API_ENDPOINT[process.env.REACT_APP_ENV]) ? ENV_TO_API_ENDPOINT[process.env.REACT_APP_ENV] : 'https://dev.dappapi.propy.com/' ; export const TOKEN_NAME_PREFIX : {[key: string]: string} = { "0xB5c4910335D373eb26FeBb30B8f1d7416179A4EC": "MetaAgent",