Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pyth rewards completely (on 1st January) #161

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/assets/images/banner/10.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
[
{
"image": "december-rewards.png",
"url": "https://dune.com/leifu/thales-speed-markets-competition-24"
},
{
"image": "chained-rewards-10k.png",
"url": "https://dune.com/leifu/thales-speed-markets-competition-24"
},
{
"image": "banner-zerofees.png",
"url": ""
Expand Down
8 changes: 0 additions & 8 deletions src/assets/images/banner/11155420.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
[
{
"image": "december-rewards.png",
"url": "https://dune.com/leifu/thales-speed-markets-competition-24"
},
{
"image": "chained-rewards-10k.png",
"url": "https://dune.com/leifu/thales-speed-markets-competition-24"
},
{
"image": "banner-zerofees.png",
"url": ""
Expand Down
8 changes: 0 additions & 8 deletions src/assets/images/banner/137.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
[
{
"image": "december-rewards.png",
"url": "https://dune.com/leifu/thales-speed-markets-competition-24"
},
{
"image": "chained-rewards-10k.png",
"url": "https://dune.com/leifu/thales-speed-markets-competition-24"
},
{
"image": "banner-zerofees.png",
"url": ""
Expand Down
8 changes: 0 additions & 8 deletions src/assets/images/banner/42161.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
[
{
"image": "december-rewards.png",
"url": "https://dune.com/leifu/thales-speed-markets-competition-24"
},
{
"image": "chained-rewards-10k.png",
"url": "https://dune.com/leifu/thales-speed-markets-competition-24"
},
{
"image": "banner-zerofees.png",
"url": ""
Expand Down
8 changes: 0 additions & 8 deletions src/assets/images/banner/8453.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
[
{
"image": "december-rewards.png",
"url": "https://dune.com/leifu/thales-speed-markets-competition-24"
},
{
"image": "chained-rewards-10k.png",
"url": "https://dune.com/leifu/thales-speed-markets-competition-24"
},
{
"image": "banner-zerofees.png",
"url": ""
Expand Down
Binary file removed src/assets/images/banner/chained-rewards-10k.png
Binary file not shown.
Binary file removed src/assets/images/banner/december-rewards.png
Binary file not shown.
2 changes: 1 addition & 1 deletion src/components/Banner/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Trans } from 'react-i18next';
import 'react-responsive-carousel/lib/styles/carousel.min.css';
import styled from 'styled-components';

const IS_VISIBLE = true;
const IS_VISIBLE = false;

const Banner: React.FC = () => {
const [showBanner, setShowBanner] = useState(IS_VISIBLE);
Expand Down
857 changes: 0 additions & 857 deletions src/constants/pythRewards/total-rewards.json

This file was deleted.

393 changes: 0 additions & 393 deletions src/constants/pythRewards/without-solana-address.json

This file was deleted.

13 changes: 1 addition & 12 deletions src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@
},
"header": {
"get-started": "Get started",
"notification": { "tooltip": "You have {{count}} claimable position(s)" },
"submit-solana": "Submit Solana address"
"notification": { "tooltip": "You have {{count}} claimable position(s)" }
},
"footer": {
"github": "GitHub",
Expand Down Expand Up @@ -360,18 +359,8 @@
"copying-address": "Copying Address",
"docs": "Docs and Tutorials",
"withdraw": "Withdraw",
"pyth": "Pyth Rewards",
"trading-profile": "Trading Profile",
"logout": "Logout",
"session-valid": "Session valid until"
},
"pyth-rewards": {
"title": "PYTH rewards",
"rewards-info": "Input your Solana address to receive the airdrop. Address input will be open until December 31st after which the rewards will be distributed.",
"input-label": "Input/change your solana address:",
"invalid-solana-address": "Invalid Solana address",
"submit": "Submit",
"success": "Successfully submitted solana address",
"total-received": "Total received:"
}
}
64 changes: 10 additions & 54 deletions src/layouts/DappLayout/DappHeader/DappHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
import Button from 'components/Button';
import ConnectWalletModal from 'components/ConnectWalletModal';
import NetworkSwitch from 'components/NetworkSwitch';
import ROUTES from 'constants/routes';
import { ScreenSizeBreakpoint } from 'enums/ui';
import GetStarted from 'pages/AARelatedPages/GetStarted';
import Withdraw from 'pages/AARelatedPages/Withdraw';
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import useExchangeRatesQuery, { Rates } from 'queries/rates/useExchangeRatesQuery';
import useMultipleCollateralBalanceQuery from 'queries/walletBalances/useMultipleCollateralBalanceQuery';
import React, { useCallback, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
import { getIsAppReady } from 'redux/modules/app';
import { getIsMobile } from 'redux/modules/ui';
import { getIsBiconomy, getWalletConnectModalVisibility, setWalletConnectModalVisibility } from 'redux/modules/wallet';
import styled from 'styled-components';
import { Colors, FlexDivRow, FlexDivRowCentered, PAGE_MAX_WIDTH } from 'styles/common';
import { FlexDivRow, FlexDivRowCentered, PAGE_MAX_WIDTH } from 'styles/common';
import { Coins } from 'thales-utils';
import { RootState } from 'types/ui';
import biconomyConnector from 'utils/biconomyWallet';
import { getCollaterals, isStableCurrency } from 'utils/currency';
import { navigateTo } from 'utils/routes';
import { useAccount, useChainId, useClient } from 'wagmi';
import Logo from '../components/Logo';
import Notifications from '../components/Notifications';
import UserInfo from '../components/UserInfo';
import UserWallet from '../components/UserWallet';
import useMultipleCollateralBalanceQuery from 'queries/walletBalances/useMultipleCollateralBalanceQuery';
import useExchangeRatesQuery, { Rates } from 'queries/rates/useExchangeRatesQuery';
import { getIsAppReady } from 'redux/modules/app';
import biconomyConnector from 'utils/biconomyWallet';
import { getCollaterals, isStableCurrency } from 'utils/currency';
import { Coins, localStore } from 'thales-utils';
import { navigateTo } from 'utils/routes';
import ROUTES from 'constants/routes';
import PythModal from '../components/PythModal';
import { LOCAL_STORAGE_KEYS } from 'constants/storage';
import useSolanaAddressForWalletQuery from 'queries/solana/useSolanaAddressForWalletQuery';
import { isValidSolanaAddress } from 'utils/solana';

const DappHeader: React.FC = () => {
const { t } = useTranslation();
Expand All @@ -47,8 +43,6 @@ const DappHeader: React.FC = () => {
const [openGetStarted, setOpenGetStarted] = useState(false);
const [openUserInfo, setOpenUserInfo] = useState(false);
const [openWithdraw, setOpenWithdraw] = useState(false);
const [openPythModal, setPythModalOpen] = useState(false);
const [hideSolanaButton, setHideSolanaButton] = useState(true);

const burgerMenuRef = useRef<HTMLElement>(null);

Expand Down Expand Up @@ -92,29 +86,6 @@ const DappHeader: React.FC = () => {
}
}, [exchangeRates, multipleCollateralBalances.data, networkId, getUSDForCollateral]);

useEffect(() => {
if (isConnected) {
const showPyth = localStore.get(LOCAL_STORAGE_KEYS.SHOW_PYTH_MODAL);
if (!showPyth) {
localStore.set(LOCAL_STORAGE_KEYS.SHOW_PYTH_MODAL, 'true');
setPythModalOpen(true);
}
}
}, [isConnected]);

const solanaAddressQuery = useSolanaAddressForWalletQuery(
(isBiconomy ? biconomyConnector.address : walletAddress) as string,
{
enabled: isConnected,
}
);

useEffect(() => {
if (solanaAddressQuery.isSuccess) {
setHideSolanaButton(isValidSolanaAddress(solanaAddressQuery.data));
}
}, [solanaAddressQuery, solanaAddressQuery.isSuccess, solanaAddressQuery.data]);

return (
<Container>
<LeftContainer>
Expand All @@ -133,19 +104,6 @@ const DappHeader: React.FC = () => {
{t(totalBalanceValue > 0 ? 'deposit.title' : 'common.header.get-started')}
</Button>
)}
{!isMobile && isConnected && !hideSolanaButton && (
<Button
width="240px"
height="30px"
margin="10px"
fontSize="12px"
borderColor={Colors.RED}
pulsate
onClick={() => setPythModalOpen(true)}
>
{t('common.header.submit-solana')}
</Button>
)}
</FlexDivRow>
</LeftContainer>
<RightContainer>
Expand Down Expand Up @@ -198,14 +156,12 @@ const DappHeader: React.FC = () => {
<UserInfo
setUserInfoOpen={setOpenUserInfo}
setOpenWithdraw={setOpenWithdraw}
setPythModalOpen={setPythModalOpen}
skipOutsideClickOnElement={burgerMenuRef}
/>
)}
</RightContainer>
{openGetStarted && <GetStarted onClose={() => setOpenGetStarted(false)} />}
{openWithdraw && <Withdraw onClose={() => setOpenWithdraw(false)} />}
{openPythModal && <PythModal onClose={() => setPythModalOpen(false)} />}

<ConnectWalletModal
isOpen={connectWalletModalVisibility}
Expand Down
Loading