Skip to content

Commit

Permalink
Optimism rewards (#913)
Browse files Browse the repository at this point in the history
* Update text for optimism rewards

* link

* update title

* show with decimals

* unit

* new wormhole logo
  • Loading branch information
garet90 authored Jul 10, 2024
1 parent 66a2623 commit f65be64
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 182 deletions.
2 changes: 1 addition & 1 deletion apps/rewards-dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Arb Rewards Dashboard</title>
<title>OP Rewards Dashboard</title>
</head>
<body class="min-h-screen w-screen bg-[#010619] flex flex-col overflow-x-hidden overflow-y-hidden" >
<div id="root" class="
Expand Down
35 changes: 0 additions & 35 deletions apps/rewards-dashboard/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,55 +1,20 @@
import { useState } from "react";
import "./App.css";
import { Background } from "./components/Background";
import { Footer } from "./components/Footer";
import { Header } from "./components/Header";
import { DashboardLayout } from "./layouts/DashboardLayout";
import { AppProvider } from "./providers";
import { Trans } from "@lingui/macro";
import { RxCross1 } from "react-icons/rx";

function App() {
const [hideModal, setHideModal] = useState(false);
return (
<>
<AppProvider>
<Background>
{hideModal ? (
<></>
) : (
<div className="absolute flex flex-col grow h-full w-full scrollbar-hide justify-center items-center ">
<div className="w-96 h-40 bg-[#262b5a] z-10 rounded-3xl border border-1 border-gray-500">
<div className="flex flex-col gap-4">
<div className="flex flex-row justify-between text-gray-300 py-1 justify-center border-b border-gray-500 ">
<div className="flex flex-row items-center grow justify-center text-white pl-5">
<Trans>Program Completed</Trans>
</div>
<div className="flex flex-row items-center justify-center">
<a
className="hover:cursor-pointer pr-3"
onClick={() => {
setHideModal(true);
}}
>
<RxCross1 />
</a>
</div>
</div>
<div className="flex flex-row justify-start text-white text-sm">
<p className="align-start w-full text-center whitespace-pre">
<Trans>Rewards Ended Information</Trans>
</p>
</div>
</div>
</div>
</div>
)}
<div
className={`
flex flex-col grow h-full
justify-between
overflow-scroll scrollbar-hide
${!hideModal && "blur-sm"}
`}
>
<Header />
Expand Down
76 changes: 33 additions & 43 deletions apps/rewards-dashboard/src/layouts/DashboardLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import { WAC_URL } from "../constants";
interface DashboardQueryResult {
user: string;
bridged_amount: number;
usdc_held: number;
ausdc_held: number;
cusdc_held: number;
wsteth_held: number;
aave_wsteth_held: number;
exactly_wsteth_held: number;
pending_rewards: number;
moo_cusdc_held: number;
earned_rewards: number;
}

export interface OverviewQueryResult {
Expand All @@ -46,11 +46,10 @@ const ConnectedDashboard = () => {
number | undefined
>(undefined);

const [usdcBridged, setUSDCBridged] = useState<number | undefined>(undefined);
const [usdcHeld, setUSDCHeld] = useState<number | undefined>(undefined);
const [cusdcHeld, setCUSDCHeld] = useState<number | undefined>(undefined);
const [ausdcHeld, setAUSDCHeld] = useState<number | undefined>(undefined);
const [mooHeld, setMooHeld] = useState<number | undefined>(undefined);
const [wstetehBridged, setWstetehBridged] = useState<number | undefined>(undefined);
const [wstethHeld, setWstethHeld] = useState<number | undefined>(undefined);
const [exactlyWstethHeld, setExactlyWstethHeld] = useState<number | undefined>(undefined);
const [aaveWstethHeld, setAaveWstethHeld] = useState<number | undefined>(undefined);
const [accruedRewards, setAccruedRewards] = useState<number | undefined>(
undefined
);
Expand Down Expand Up @@ -78,12 +77,11 @@ const ConnectedDashboard = () => {
if (!userInfo) {
return;
}
setUSDCBridged(userInfo.bridged_amount);
setUSDCHeld(userInfo.usdc_held);
setAUSDCHeld(userInfo.ausdc_held);
setCUSDCHeld(userInfo.cusdc_held);
setWstetehBridged(userInfo.bridged_amount);
setWstethHeld(userInfo.wsteth_held);
setAaveWstethHeld(userInfo.aave_wsteth_held);
setExactlyWstethHeld(userInfo.exactly_wsteth_held);
setAccruedRewards(userInfo.pending_rewards);
setMooHeld(userInfo.moo_cusdc_held);
}, [userInfo]);
useEffect(() => {
if (!overview) {
Expand All @@ -101,9 +99,9 @@ const ConnectedDashboard = () => {
return x;
};

const formatInteger = (x?: number) => {
const formatInteger = (x?: number, decimals?: number) => {
x = maybeHide(x);
return x !== undefined ? Math.floor(x).toLocaleString() : undefined;
return x !== undefined ? (x === 0 ? "0" : x.toFixed(decimals).toLocaleString()) : undefined;
};

return (
Expand Down Expand Up @@ -179,44 +177,36 @@ const ConnectedDashboard = () => {
<div className="flex flex-col md:flex-row gap-4">
<InfoStatWindow
header={t`Bridged Header`}
value={formatInteger(usdcBridged)}
unit="USDC"
value={formatInteger(wstetehBridged, 6)}
unit="WSTETH"
infoElement={<Trans>Bridged Window Tooltip</Trans>}
/>
<InfoStatWindow
header={t`USDC Held Header`}
value={formatInteger(usdcHeld)}
unit="USDC"
infoElement={<Trans>USDC Held Window Tooltip</Trans>}
header={t`WSTETH Held Header`}
value={formatInteger(wstethHeld, 6)}
unit="WSTETH"
infoElement={<Trans>WSTETH Held Window Tooltip</Trans>}
/>
</div>
<div className="flex flex-col md:flex-row gap-4">
<InfoStatWindow
header={t`aUSDC Held Value Header`}
value={formatInteger(ausdcHeld)}
unit="aUSDC"
infoElement={<Trans>aUSDC Held Value Tooltip</Trans>}
header={t`Aave WSTETH Held Value Header`}
value={formatInteger(aaveWstethHeld, 6)}
unit="aWSTETH"
infoElement={<Trans>Aave WSTETH Held Value Tooltip</Trans>}
/>
<InfoStatWindow
header={t`cUSDC Held Value`}
value={formatInteger(cusdcHeld)}
unit="cUSDC"
infoElement={<Trans>cUSDC Held Value Tooltip</Trans>}
/>
<InfoStatWindow
header={t`Beefy cUSDC Balance`}
value={formatInteger(mooHeld)}
unit="cUSDC"
infoElement={
<Trans>Beefy Finance cUSDC Held Value Tooltip</Trans>
}
header={t`Exactly WSTETH Held Value`}
value={formatInteger(exactlyWstethHeld, 6)}
unit="eWSTETH"
infoElement={<Trans>Exactly WSTETH Held Value Tooltip</Trans>}
/>
</div>
<div className="">
<InfoStatWindow
header={t`Accrued Rewards Header`}
value={formatInteger(accruedRewards)}
unit="ARB"
value={formatInteger(accruedRewards, 6)}
unit="OP"
infoElement={<Trans>Accrued Rewards Tooltip</Trans>}
/>
</div>
Expand All @@ -233,13 +223,13 @@ const ConnectedDashboard = () => {
<StatWindow
header={t`Estimated Rewards Header`}
value={formatInteger(estimatedRewards)}
unit="ARB"
unit="OP"
graphic={<EstimatedRewardsGraphic />}
/>
<StatWindow
header={t`History of Rewards Earned Header`}
value={formatInteger(historyRewardsEarned)}
unit="ARB"
unit="OP"
graphic={<RewardHistoryGraphic />}
infoElement={<Trans>History of Rewards Earned Tooltip</Trans>}
/>
Expand Down Expand Up @@ -302,7 +292,7 @@ const DisconnectedDashboard = () => {
</div>
<div>
<a
href="https://forum.arbitrum.foundation/t/wormhole-final-stip-round-1/16617"
href="https://x.com/WormholeFdn/status/1788999096566677769"
target="_blank"
className="flex flex-row items-center gap-3"
>
Expand Down
125 changes: 52 additions & 73 deletions apps/rewards-dashboard/src/locales/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,123 +13,102 @@ msgstr ""
"Language-Team: \n"
"Plural-Forms: \n"

#: src/layouts/DashboardLayout.tsx:217
msgid "Accrued Rewards Header"
msgstr "Accruing ARB Rewards"

#: src/layouts/DashboardLayout.tsx:220
msgid "Accrued Rewards Tooltip"
msgstr "The estimated amount of ARB you have earned that has not been paid out."
#: src/layouts/DashboardLayout.tsx:193
msgid "Aave WSTETH Held Value Header"
msgstr "aWSTETH Balance"

#: src/layouts/DashboardLayout.tsx:195
msgid "aUSDC Held Value Header"
msgstr "aUSDC Balance"

#: src/layouts/DashboardLayout.tsx:198
msgid "aUSDC Held Value Tooltip"
msgstr "Aave v3 USDC account balance."
#: src/layouts/DashboardLayout.tsx:196
msgid "Aave WSTETH Held Value Tooltip"
msgstr "Aave v3 WSTETH account balance."

#: src/layouts/DashboardLayout.tsx:207
msgid "Beefy cUSDC Balance"
msgstr "Beefy Vault"
msgid "Accrued Rewards Header"
msgstr "Accruing OP Rewards"

#: src/layouts/DashboardLayout.tsx:211
msgid "Beefy Finance cUSDC Held Value Tooltip"
msgstr "Beefy.Finance cUSDC Vault Balance."
#: src/layouts/DashboardLayout.tsx:210
msgid "Accrued Rewards Tooltip"
msgstr "The estimated amount of OP you have earned that has not been paid out."

#: src/layouts/DashboardLayout.tsx:300
#: src/layouts/DashboardLayout.tsx:290
msgid "Bottom Banner Header"
msgstr "How rewards work?"

#: src/layouts/DashboardLayout.tsx:310
#: src/layouts/DashboardLayout.tsx:300
msgid "Bottom Banner Link"
msgstr "Learn more"

#: src/layouts/DashboardLayout.tsx:181
#: src/layouts/DashboardLayout.tsx:179
msgid "Bridged Header"
msgstr "Total USDC bridged"
msgstr "Total WSTETH bridged"

#: src/layouts/DashboardLayout.tsx:184
#: src/layouts/DashboardLayout.tsx:182
msgid "Bridged Window Tooltip"
msgstr "The total amount of canonical USDC you bridged in via CCTP."
msgstr "The total amount of WSTETH you bridged in via Wormhole."

#: src/quarks/WalletManager.tsx:15
msgid "CONNECT WALLET"
msgstr "Connect Wallet"

#: src/layouts/DashboardLayout.tsx:149
#: src/layouts/DashboardLayout.tsx:147
msgid "Connected Dashboard Header"
msgstr "My ARB Rewards"
msgstr "My OP Rewards"

#: src/layouts/DashboardLayout.tsx:135
#: src/layouts/DashboardLayout.tsx:133
msgid "Connected Dashboard Subtitle"
msgstr "Get up to 5% rewards by bridging your USDC to Arbitrum"
msgstr "Get up to 5% rewards by bridging your WSTETH to Optimism"

#: src/layouts/DashboardLayout.tsx:124
#: src/layouts/DashboardLayout.tsx:122
msgid "Connected Dashboard Title"
msgstr "ARB Rewards Dashboard"

#: src/layouts/DashboardLayout.tsx:201
msgid "cUSDC Held Value"
msgstr "cUSDC Balance"
msgstr "OP Rewards Dashboard"

#: src/layouts/DashboardLayout.tsx:204
msgid "cUSDC Held Value Tooltip"
msgstr "Compound v3 USDC account balance."

#: src/layouts/DashboardLayout.tsx:272
#: src/layouts/DashboardLayout.tsx:262
msgid "Disconnect Wallet Dashboard Subtitle One"
msgstr "Claim ARB rewards by bridging your USDC to Arbitrum."
msgstr "Claim OP rewards by bridging your WSTETH to Optimism."

#: src/layouts/DashboardLayout.tsx:275
#: src/layouts/DashboardLayout.tsx:265
msgid "Disconnect Wallet Dashboard Subtitle Two"
msgstr "Supporting Aave and Compound USDC deposits."
msgstr "Supporting Aave and Exactly WSTETH deposits."

#: src/layouts/DashboardLayout.tsx:268
#: src/layouts/DashboardLayout.tsx:258
msgid "Disconnect Wallet Dashboard Title"
msgstr "Arbitrum USDC Rewards Dashboard"
msgstr "Optimism WSTETH Rewards Dashboard"

#: src/layouts/DashboardLayout.tsx:234
#: src/layouts/DashboardLayout.tsx:224
msgid "Estimated Rewards Header"
msgstr "Total Projected Rewards"

#: src/layouts/DashboardLayout.tsx:170
#: src/layouts/DashboardLayout.tsx:199
msgid "Exactly WSTETH Held Value"
msgstr "eWSTETH Balance"

#: src/layouts/DashboardLayout.tsx:202
msgid "Exactly WSTETH Held Value Tooltip"
msgstr "Exactly WSTETH account balance."

#: src/layouts/DashboardLayout.tsx:168
msgid "Hide Number Text"
msgstr "Show Numbers"

#: src/layouts/DashboardLayout.tsx:240
#: src/layouts/DashboardLayout.tsx:230
msgid "History of Rewards Earned Header"
msgstr "Total ARB Earned"
msgstr "Total OP Earned"

#: src/layouts/DashboardLayout.tsx:244
#: src/layouts/DashboardLayout.tsx:234
msgid "History of Rewards Earned Tooltip"
msgstr "A minimum of 1 ARB will be paid out. Outstanding rewards below 1 ARB will roll over to the next week."

#: src/App.tsx:25
msgid "Program Completed"
msgstr "Program Completed"

#: src/App.tsx:40
msgid "Rewards Ended Information"
msgstr ""
"Thank you everyone who participated.\n"
"The Wormhole USDC Arbitrum STIP has completed.\n"
"All ARB rewards have been sent.\n"
"Please check back for future programs.\n"
""
msgstr "A minimum of 1 OP will be paid out. Outstanding rewards below 1 OP will roll over to the next week."

#: src/layouts/DashboardLayout.tsx:170
#: src/layouts/DashboardLayout.tsx:168
msgid "Show Number Text"
msgstr "Hide Numbers"

#: src/layouts/DashboardLayout.tsx:228
#: src/layouts/DashboardLayout.tsx:218
msgid "Staking Power Header"
msgstr "Total USDC Bridged"
msgstr "Total WSTETH Bridged"

#: src/layouts/DashboardLayout.tsx:187
msgid "USDC Held Header"
msgstr "USDC Balance"
#: src/layouts/DashboardLayout.tsx:185
msgid "WSTETH Held Header"
msgstr "WSTETH Balance"

#: src/layouts/DashboardLayout.tsx:190
msgid "USDC Held Window Tooltip"
msgstr "The amount of canonical USDC held in your account."
#: src/layouts/DashboardLayout.tsx:188
msgid "WSTETH Held Window Tooltip"
msgstr "The amount of WSTETH held in your account."
Loading

0 comments on commit f65be64

Please sign in to comment.