Skip to content

Commit 488098e

Browse files
authored
Merge pull request #187 from adatainment/calc-final
Release of the reward calculator
2 parents eb6dc19 + 56a4c52 commit 488098e

File tree

11 files changed

+55
-25
lines changed

11 files changed

+55
-25
lines changed

netlify.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,9 @@
4141
[[redirects]]
4242
from = "/enterprise/"
4343
to = "https://cardano.org/use-cases/"
44+
status = 301
45+
46+
[[redirects]]
47+
from = "/calculator_demo/"
48+
to = "https://cardano.org/calculator/"
4449
status = 301

src/pages/calculator.js

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,66 @@ import BoundaryBox from "@site/src/components/Layout/BoundaryBox";
44
import TitleWithText from "@site/src/components/Layout/TitleWithText";
55
import OpenGraphImage from "@site/src/components/Layout/OpenGraphImage";
66

7+
// Translation dictionary
8+
const translations = {
9+
en: {
10+
title: "Staking Calculator",
11+
description: "See how much you could potentially earn by staking ada and learn how rewards are calculated.",
12+
rewardTitle: "Reward Calculator",
13+
rewardDescription: "This calculator is provided for guidance only.",
14+
},
15+
jp: {
16+
title: "ステーキング計算機",
17+
description: "エイダをステーキングすることでどれくらいの報酬が得られるか、計算方法を学びましょう。",
18+
rewardTitle: "報酬計算機",
19+
rewardDescription: "報酬計算機が必要なライブデータを読み込むまで数秒お待ちください。",
20+
}
21+
};
22+
723
function HomepageHeader() {
824
const { siteTitle } = "useDocusaurusContext()";
925
return (
1026
<SiteHero
1127
title="Staking Calculator"
12-
description="See how much rewards you can possibly earn by staking ada."
28+
description="See how much you could potentially earn by staking ada and learn how rewards are calculated."
1329
bannerType="dots"
1430
/>
1531
);
1632
}
1733

1834
export default function Home() {
35+
// Get the 'lang' parameter from URL, default to 'en'
36+
const urlParams = new URLSearchParams(typeof window !== "undefined" ? window.location.search : "");
37+
const lang = urlParams.get("lang") === "jp" ? "jp" : "en"; // Only allow 'en' or 'jp'
38+
39+
// Select translations based on language
40+
const t = translations[lang];
1941

2042
return (
2143
<Layout
22-
title="Staking Calculator | cardano.org"
23-
description="See how much rewards you can possibly earn by staking ada."
44+
title={`${t.title} | cardano.org`}
45+
description={t.description}
2446
>
2547
<OpenGraphImage pageName="calculator" />
26-
<HomepageHeader />
48+
<SiteHero
49+
title={t.title}
50+
description={t.description}
51+
bannerType="dots"
52+
/>
2753
<main>
2854
<BoundaryBox>
29-
{/* FIXME: Reward Calculator */}
30-
<TitleWithText
31-
title="The Reward Calculator is being revised"
32-
description={[
33-
"We're currently enhancing our calculator to bring you a more robust and user-friendly \
34-
experience. It's temporarily unavailable as we make these improvements. Please check \
35-
back soon to access the updated tool. We appreciate your patience and are excited to \
36-
share the improvements with you."
37-
]}
38-
titleType="black"
39-
headingDot={true}
40-
/>
55+
<TitleWithText
56+
title={t.rewardTitle}
57+
titleType="black"
58+
description={t.rewardDescription}
59+
headingDot={true}
60+
/>
4161
</BoundaryBox>
62+
{/* Pass the lang parameter dynamically */}
63+
<iframe
64+
src={`/crewardcalculator?lang=${lang}`}
65+
style={{ width: "100%", height: "100vh", border: "none" }}
66+
></iframe>
4267
</main>
4368
</Layout>
4469
);

static/crewardcalculator/404.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><link rel="preload" href="/crewardcalculator/_next/static/css/13307f688a363ebc.css" as="style"/><link rel="stylesheet" href="/crewardcalculator/_next/static/css/13307f688a363ebc.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/crewardcalculator/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/crewardcalculator/_next/static/chunks/webpack-2e9c6a3f0f30e4f9.js" defer=""></script><script src="/crewardcalculator/_next/static/chunks/framework-64ad27b21261a9ce.js" defer=""></script><script src="/crewardcalculator/_next/static/chunks/main-dfb077c8afae29b4.js" defer=""></script><script src="/crewardcalculator/_next/static/chunks/pages/_app-87cee5540118d1b4.js" defer=""></script><script src="/crewardcalculator/_next/static/chunks/pages/_error-7a92967bea80186d.js" defer=""></script><script src="/crewardcalculator/_next/static/jWMkpxcuxdOu7qmEdnv3g/_buildManifest.js" defer=""></script><script src="/crewardcalculator/_next/static/jWMkpxcuxdOu7qmEdnv3g/_ssgManifest.js" defer=""></script></head><body class="antialiased"><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"jWMkpxcuxdOu7qmEdnv3g","assetPrefix":"/crewardcalculator","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><link rel="preload" href="/crewardcalculator/_next/static/css/46694a2e3f2dde89.css" as="style"/><link rel="stylesheet" href="/crewardcalculator/_next/static/css/46694a2e3f2dde89.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/crewardcalculator/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/crewardcalculator/_next/static/chunks/webpack-2e9c6a3f0f30e4f9.js" defer=""></script><script src="/crewardcalculator/_next/static/chunks/framework-64ad27b21261a9ce.js" defer=""></script><script src="/crewardcalculator/_next/static/chunks/main-dfb077c8afae29b4.js" defer=""></script><script src="/crewardcalculator/_next/static/chunks/pages/_app-87cee5540118d1b4.js" defer=""></script><script src="/crewardcalculator/_next/static/chunks/pages/_error-7a92967bea80186d.js" defer=""></script><script src="/crewardcalculator/_next/static/sojEjAWazskR_479a_eEM/_buildManifest.js" defer=""></script><script src="/crewardcalculator/_next/static/sojEjAWazskR_479a_eEM/_ssgManifest.js" defer=""></script></head><body class="antialiased"><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"sojEjAWazskR_479a_eEM","assetPrefix":"/crewardcalculator","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>

static/crewardcalculator/_next/static/chunks/pages/index-8223d78cccaed20d.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

static/crewardcalculator/_next/static/chunks/pages/index-9e1575d3a6dcdaa0.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/crewardcalculator/_next/static/css/13307f688a363ebc.css

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)