Skip to content

Commit

Permalink
Merge pull request #16 from Propy/feat/timeline-and-enhancements
Browse files Browse the repository at this point in the history
feat(TokenMetadataTimeline): use completed flags
  • Loading branch information
JayWelsh authored Oct 9, 2023
2 parents 8eef669 + bc98c4e commit 04b345b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 31 deletions.
5 changes: 3 additions & 2 deletions src/components/TokenMetadataTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,13 @@ export default function VerticalLinearStepper(props: ITokenMetadataTimeline) {
<Box sx={{ maxWidth: 400 }}>
<Stepper activeStep={activeStep} orientation="vertical">
{timeline.map((timelineEntry, index) => (
<Step key={timelineEntry.milestone} expanded={true}>
<Step key={timelineEntry.milestone} expanded={true} completed={timelineEntry.complete}>
<StepLabel StepIconComponent={QontoStepIcon}>
<Typography variant="subtitle1">{timelineEntry.milestone}</Typography>
</StepLabel>
<StepContent>
<Typography variant="subtitle2">By {dayjs.unix(Number(timelineEntry.due_date)).format('MMM-D-YYYY hh:mm A')}</Typography>
{timelineEntry.due_date && <Typography variant="subtitle2">By {dayjs.unix(Number(timelineEntry.due_date)).format('MMM-D-YYYY hh:mm A')}</Typography>}
{!timelineEntry.due_date && <Typography variant="subtitle2">Date estimation pending</Typography>}
</StepContent>
</Step>
))}
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export interface IAttribute {
}
export interface ITokenMetadataTimelineEntry {
milestone: string;
due_date: number;
due_date?: number;
complete: boolean;
is_estimate?: boolean;
}
Expand Down
52 changes: 26 additions & 26 deletions src/pages/SingleTokenPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
10 changes: 8 additions & 2 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand All @@ -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 = [
Expand Down

0 comments on commit 04b345b

Please sign in to comment.