diff --git a/src/pages/renew/info.tsx b/src/pages/renew/info.tsx index 04915f09..45b6a38b 100644 --- a/src/pages/renew/info.tsx +++ b/src/pages/renew/info.tsx @@ -31,8 +31,6 @@ export const RenewableParaInfo = ({ parachain }: RenewableParaInfoProps) => { const [loading, setLoading] = useState(false); - const formatDuration = humanizer({ units: ['w', 'd', 'h'], round: true }); - useEffect(() => { const getExpiry = async () => { setLoading(true); @@ -76,30 +74,10 @@ export const RenewableParaInfo = ({ parachain }: RenewableParaInfoProps) => { return ( <> - - - - - - - - {saleInfo.coresSold === saleInfo.coresOffered && ( - + + + {/* If all cores are sold warn the user: */} + {saleInfo.coresSold === saleInfo.coresOffered && ( { }} severity='warning' /> - - )} - {/* If not all cores are sold inform the user: */} - {saleInfo.coresSold < saleInfo.coresOffered && ( - + )} + {/* If not all cores are sold inform the user to renew: */} + {saleInfo.coresSold < saleInfo.coresOffered && ( { }} severity='info' /> - - )} + )} + + + ); +}; + +interface ParachainInfoProps { + parachain: RenewableParachain; + expiryTimestamp: number; + expiryLoading: boolean; +} + +const ParachainInfo = ({ parachain, expiryTimestamp, expiryLoading }: ParachainInfoProps) => { + const { + state: { decimals, symbol }, + } = useCoretimeApi(); + + const formatDuration = humanizer({ units: ['w', 'd', 'h'], round: true }); + + return ( + <> + + + + + ); }; interface PropertyProps { property: string; - value: any; + value: string; tooltip?: string; }