Skip to content

Commit

Permalink
Merge pull request #183 from adatainment/calculator5
Browse files Browse the repository at this point in the history
Update calculator to version: 25.02.3
  • Loading branch information
gufmar authored Feb 19, 2025
2 parents 9f27131 + 0456997 commit 3352172
Show file tree
Hide file tree
Showing 43 changed files with 4,050 additions and 10 deletions.
47 changes: 37 additions & 10 deletions src/pages/calculator_demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ import BoundaryBox from "@site/src/components/Layout/BoundaryBox";
import TitleWithText from "@site/src/components/Layout/TitleWithText";
import OpenGraphImage from "@site/src/components/Layout/OpenGraphImage";

// Translation dictionary
const translations = {
en: {
title: "Staking Calculator",
description: "See how much you could potentially earn by staking ada and learn how rewards are calculated.",
rewardTitle: "Reward Calculator",
rewardDescription: "Please allow the reward calculator a few seconds to load the necessary live data.",
},
jp: {
title: "ステーキング計算機",
description: "エイダをステーキングすることでどれくらいの報酬が得られるか、計算方法を学びましょう。",
rewardTitle: "報酬計算機",
rewardDescription: "報酬計算機が必要なライブデータを読み込むまで数秒お待ちください。",
}
};

function HomepageHeader() {
const { siteTitle } = "useDocusaurusContext()";
return (
Expand All @@ -16,25 +32,36 @@ function HomepageHeader() {
}

export default function Home() {
// Get the 'lang' parameter from URL, default to 'en'
const urlParams = new URLSearchParams(typeof window !== "undefined" ? window.location.search : "");
const lang = urlParams.get("lang") === "jp" ? "jp" : "en"; // Only allow 'en' or 'jp'

// Select translations based on language
const t = translations[lang];

return (
<Layout
title="Staking Calculator | cardano.org"
description="See how much rewards you can possibly earn by staking ada."
title={`${t.title} | cardano.org`}
description={t.description}
>
<OpenGraphImage pageName="calculator" />
<HomepageHeader />
<SiteHero
title={t.title}
description={t.description}
bannerType="dots"
/>
<main>
<BoundaryBox>
<TitleWithText
title="Reward Calculator"
titleType="black"
description="Please allow the reward calculator a few seconds to load the necessary live data."
headingDot={true}
/>
<TitleWithText
title={t.rewardTitle}
titleType="black"
description={t.rewardDescription}
headingDot={true}
/>
</BoundaryBox>
{/* Pass the lang parameter dynamically */}
<iframe
src="/reward-calculator"
src={`/crewardcalculator?lang=${lang}`}
style={{ width: "100%", height: "100vh", border: "none" }}
></iframe>
</main>
Expand Down
1 change: 1 addition & 0 deletions static/crewardcalculator/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +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>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Loading

0 comments on commit 3352172

Please sign in to comment.