This commit is contained in:
Matthias Kretschmann 2024-03-30 01:20:15 +00:00
parent 5cdfb1d846
commit 9450b7107c
Signed by: m
GPG Key ID: 606EEEF3C479A91F
5 changed files with 58 additions and 37 deletions

View File

@ -14,12 +14,13 @@
} }
.description { .description {
margin-bottom: 2rem;
font-size: clamp(1.1rem, 10vw, 1.75rem); font-size: clamp(1.1rem, 10vw, 1.75rem);
} }
.footer { .footer {
margin-top: 2rem;
flex-shrink: 0; flex-shrink: 0;
font-size: 0.8rem; font-size: 0.8rem;
width: 100%;
max-width: calc(var(--max-width) * 1.5);
margin: 3rem auto 0 auto;
} }

View File

@ -5,12 +5,16 @@ import { metadata } from './layout'
export default function Home() { export default function Home() {
return ( return (
<> <>
<main className={styles.main}> <header>
<h1 className={styles.title}>{`${metadata.title}`}</h1> <h1 className={styles.title}>{`${metadata.title}`}</h1>
<p className={styles.description}>{`${metadata.description}`}</p> <p className={styles.description}>{`${metadata.description}`}</p>
</header>
<main className={styles.main}>
<Prices /> <Prices />
</main> </main>
<footer className={styles.footer}>Send to krema.eth</footer> <footer className={styles.footer}>
Send & meme coins to krema.eth
</footer>
</> </>
) )
} }

View File

@ -13,6 +13,6 @@
} }
.results h3 { .results h3 {
margin-bottom: 1rem; margin-bottom: 1.5rem;
font-size: 1.1rem; font-size: 1.1rem;
} }

View File

@ -48,35 +48,6 @@ export function Prices() {
return ( return (
<> <>
<div className={styles.grid}> <div className={styles.grid}>
<div className={styles.results}>
<h3>Buying with ${exampleBuyInUsd} right now gets you:</h3>
<Result
tokenSymbol="OCEAN"
tokenAddress="0x967da4048cd07ab37855c090aaf366e4ce1b9f48"
amount={exampleBuyInUsd / priceOcean}
amountAsi={(exampleBuyInUsd / priceOcean) * ratioOceanToAsi}
amountFiat={
(exampleBuyInUsd / priceOcean) * ratioOceanToAsi * priceAsi
}
/>
<Result
tokenSymbol="AGIX"
tokenAddress="0x5b7533812759b45c2b44c19e320ba2cd2681b542"
amount={exampleBuyInUsd / priceAgix}
amountAsi={(exampleBuyInUsd / priceAgix) * ratioAgixToAsi}
amountFiat={
(exampleBuyInUsd / priceAgix) * ratioAgixToAsi * priceAsi
}
/>
<Result
tokenSymbol="FET"
tokenAddress="0xaea46a60368a7bd060eec7df8cba43b7ef41ad85"
amount={exampleBuyInUsd / priceFet}
amountAsi={(exampleBuyInUsd / priceFet) * ratioFetToAsi}
amountFiat={(exampleBuyInUsd / priceFet) * ratioFetToAsi * priceAsi}
/>
</div>
<div className={styles.results}> <div className={styles.results}>
<h3> <h3>
Swapping{' '} Swapping{' '}
@ -131,6 +102,49 @@ export function Prices() {
} }
/> />
</div> </div>
<div className={styles.results}>
<h3>Buying with ${exampleBuyInUsd} right now gets you:</h3>
<Result
tokenSymbol="OCEAN"
tokenAddress="0x967da4048cd07ab37855c090aaf366e4ce1b9f48"
amount={priceOcean ? exampleBuyInUsd / priceOcean : 0}
amountAsi={
priceOcean ? (exampleBuyInUsd / priceOcean) * ratioOceanToAsi : 0
}
amountFiat={
priceOcean
? (exampleBuyInUsd / priceOcean) * ratioOceanToAsi * priceAsi
: 0
}
/>
<Result
tokenSymbol="AGIX"
tokenAddress="0x5b7533812759b45c2b44c19e320ba2cd2681b542"
amount={priceAgix ? exampleBuyInUsd / priceAgix : 0}
amountAsi={
priceAgix ? (exampleBuyInUsd / priceAgix) * ratioAgixToAsi : 0
}
amountFiat={
priceAgix
? (exampleBuyInUsd / priceAgix) * ratioAgixToAsi * priceAsi
: 0
}
/>
<Result
tokenSymbol="FET"
tokenAddress="0xaea46a60368a7bd060eec7df8cba43b7ef41ad85"
amount={priceFet ? exampleBuyInUsd / priceFet : 0}
amountAsi={
priceFet ? (exampleBuyInUsd / priceFet) * ratioFetToAsi : 0
}
amountFiat={
priceFet
? (exampleBuyInUsd / priceFet) * ratioFetToAsi * priceAsi
: 0
}
/>
</div>
</div> </div>
<Content prices={{ ocean: priceOcean, agix: priceAgix, asi: priceAsi }} /> <Content prices={{ ocean: priceOcean, agix: priceAgix, asi: priceAsi }} />
</> </>

View File

@ -29,12 +29,14 @@ export function Result({
/> />
</span> </span>
{formatNumber(amount, tokenSymbol)} {formatNumber(amount || 0, tokenSymbol)}
</p> </p>
<p className={styles.conversion}> <p className={styles.conversion}>
{' '} {' '}
<strong title={`${amountAsi}`}>{formatNumber(amountAsi, 'ASI')}</strong>{' '} <strong title={`${amountAsi}`}>
= <strong>{formatNumber(amountFiat, 'USD')}</strong> {formatNumber(amountAsi || 0, 'ASI')}
</strong>{' '}
= <strong>{formatNumber(amountFiat || 0, 'USD')}</strong>
</p> </p>
</div> </div>
) )