Skip to content

Commit

Permalink
Merge branch 'main' into temp/test-api
Browse files Browse the repository at this point in the history
  • Loading branch information
zavelevsky authored Jan 16, 2024
2 parents 035387d + db2716d commit 07a90c1
Show file tree
Hide file tree
Showing 27 changed files with 29 additions and 247 deletions.
5 changes: 0 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
setDarkMode,
setDarkModeCss,
setSlippageTolerance,
setUsdToggle,
} from 'store/user/user';
import { setNotifications } from 'store/notification/notification';
import { store, useAppSelector } from 'store';
Expand All @@ -18,7 +17,6 @@ import {
getMigrationDisabledLS,
getNotificationsLS,
getSlippageToleranceLS,
getUsdToggleLS,
setNotificationsLS,
} from 'utils/localStorage';
import { subscribeToObservables } from 'services/observables/triggers';
Expand Down Expand Up @@ -83,9 +81,6 @@ export const App = () => {
}, []);

useEffect(() => {
const usd = getUsdToggleLS();
if (usd) dispatch(setUsdToggle(usd));

const notify = getNotificationsLS();
if (notify) dispatch(setNotifications(notify));

Expand Down
2 changes: 1 addition & 1 deletion src/components/tokenInputField/TokenInputField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const TokenInputField = ({
? new BigNumber(balance).times(token.usdPrice ?? 0).toString()
: null;

const toggle = useAppSelector<boolean>((state) => state.user.usdToggle);
const toggle = false;
const loadingBalances = useAppSelector<boolean>(
(state) => state.user.loadingBalances
);
Expand Down
2 changes: 0 additions & 2 deletions src/components/widgets/Widget.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { SwapSwitch } from 'elements/swapSwitch/SwapSwitch';
import { ReactComponent as IconTimes } from 'assets/icons/times.svg';
import { useNavigation } from 'hooks/useNavigation';

Expand All @@ -18,7 +17,6 @@ export const Widget = ({ title, subtitle, children, goBack }: Props) => {
return (
<section className="widget mx-auto">
<div className="flex justify-between py-16 px-20">
<SwapSwitch />
<div className="flex items-center justify-center flex-col">
<h1 className="text-20 font-semibold">{title}</h1>
{subtitle && <h2 className="font-normal">{subtitle}</h2>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export const AddLiquiditySingle = ({ pool }: Props) => {
const [errorMsg, setErrorMsg] = useState('');
const [spaceAvailableBnt, setSpaceAvailableBnt] = useState('');
const [spaceAvailableTkn, setSpaceAvailableTkn] = useState('');
const fiatToggle = useAppSelector<boolean>((state) => state.user.usdToggle);
const pools = useAppSelector<Pool[]>((state) => state.pool.v2Pools);
const account = useAppSelector((state) => state.user.account);

Expand Down Expand Up @@ -161,12 +160,11 @@ export const AddLiquiditySingle = ({ pool }: Props) => {
amount,
amountUsd,
undefined,
undefined,
fiatToggle
undefined
);
sendLiquidityEvent(Events.click);
onStart();
}, [amount, amountUsd, fiatToggle, onStart, pool.name, selectedToken.symbol]);
}, [amount, amountUsd, onStart, pool.name, selectedToken.symbol]);

if (!tkn) {
goToPage.notFound();
Expand Down
12 changes: 3 additions & 9 deletions src/elements/earn/pools/poolsTable/v3/DepositV3Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { updatePortfolioData } from 'services/web3/v3/portfolio/helpers';
import { useAppSelector } from 'store';
import { useApproveModal } from 'hooks/useApproveModal';
import { ModalV3 } from 'components/modal/ModalV3';
import { SwapSwitch } from 'elements/swapSwitch/SwapSwitch';
import { bntToken, ethToken } from 'services/web3/config';
import { prettifyNumber, toBigNumber } from 'utils/helperFunctions';
import { expandToken } from 'utils/formulas';
Expand Down Expand Up @@ -43,6 +42,8 @@ import { PopoverV3 } from 'components/popover/PopoverV3';
import { ReactComponent as IconInfo } from 'assets/icons/info.svg';
import { ReactComponent as IconGift } from 'assets/icons/gift.svg';

const isFiat = false;

interface Props {
pool: PoolV3;
renderButton: (onClick: (pool_click_location?: string) => void) => ReactNode;
Expand All @@ -56,7 +57,6 @@ export const DepositV3Modal = ({ pool, renderButton }: Props) => {
const [tosAgreed, setTosAgreed] = useState(false);
const [amount, setAmount] = useState('');
const [inputFiat, setInputFiat] = useState('');
const isFiat = useAppSelector((state) => state.user.usdToggle);
const [accessFullEarnings, setAccessFullEarnings] = useState(true);
const { handleWalletButtonClick } = useWalletConnect();

Expand Down Expand Up @@ -257,13 +257,7 @@ export const DepositV3Modal = ({ pool, renderButton }: Props) => {
sendDepositEvent(DepositEvent.DepositAmountView);
setIsOpen(true);
})}
<ModalV3
title={'Deposit'}
setIsOpen={onClose}
isOpen={isOpen}
titleElement={<SwapSwitch />}
large
>
<ModalV3 title={'Deposit'} setIsOpen={onClose} isOpen={isOpen} large>
<>
<div className="p-30 pb-14">
<TradeWidgetInput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import V3WithdrawStep1 from 'elements/earn/portfolio/v3/initWithdraw/step1/V3Wit
import V3WithdrawStep3 from 'elements/earn/portfolio/v3/initWithdraw/step3/V3WithdrawStep3';
import V3WithdrawStep4 from 'elements/earn/portfolio/v3/initWithdraw/step4/V3WithdrawStep4';
import V3WithdrawStep2 from 'elements/earn/portfolio/v3/initWithdraw/step2/V3WithdrawStep2';
import { SwapSwitch } from 'elements/swapSwitch/SwapSwitch';
import { useV3WithdrawModal } from 'elements/earn/portfolio/v3/initWithdraw/useV3WithdrawModal';
import { Holding } from 'store/portfolio/v3Portfolio.types';
import {
Expand Down Expand Up @@ -63,7 +62,6 @@ const V3WithdrawModal = ({ isOpen, setIsOpen, holding }: Props) => {
title={step === 4 ? 'Complete Withdraw' : 'Begin instant cooldown'}
isOpen={isOpen}
setIsOpen={onClose}
titleElement={step !== 4 && <SwapSwitch />}
>
{step === 1 && (
<V3WithdrawStep1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const useV3WithdrawModal = ({ setIsOpen }: Props) => {
const { withdrawalFee, lockDuration } = useAppSelector(
(state) => state.v3Portfolio.withdrawalSettings
);
const isFiat = useAppSelector((state) => state.user.usdToggle);
const isFiat = false;
const [step, setStep] = useState(1);
const [requestId, setRequestId] = useState('');
const [inputTkn, setInputTkn] = useState('');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const WithdrawLiquidityWidget = ({

const withdrawingBNT = reserveToken.address === bntToken;
const [agreed, setAgreed] = useState(false);
const fiatToggle = useAppSelector<boolean>((state) => state.user.usdToggle);
const fiatToggle = false;

const bntToVBNTRatio = useMemo(() => {
if (token && token.address !== bntToken) {
Expand Down
9 changes: 2 additions & 7 deletions src/elements/layoutHeader/LayoutHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,8 @@ export const LayoutHeader = () => {
<Navigate to={BancorURL.earn}>
<IconBancor className="w-[18px]" />
</Navigate>
<TopMenuDropdown
items={[
{ title: 'Trade', link: BancorURL.trade() },
{ title: 'Tokens', link: BancorURL.tokens },
]}
className="w-[75px]"
/>

<Navigate to={BancorURL.trade()}>Trade</Navigate>

<Navigate to={BancorURL.earn}>Pools</Navigate>
<TopMenuDropdown
Expand Down
4 changes: 1 addition & 3 deletions src/elements/modalVbnt/ModalVbnt.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Modal } from 'components/modal/Modal';
import { SwapSwitch } from 'elements/swapSwitch/SwapSwitch';
import { useMemo, useState } from 'react';
import { Token, updateUserBalances } from 'services/observables/tokens';
import { wait } from 'utils/pureFunctions';
Expand Down Expand Up @@ -46,7 +45,7 @@ export const ModalVbnt = ({
onCompleted,
}: ModalVbntProps) => {
const account = useAppSelector((state) => state.user.account);
const isFiat = useAppSelector((state) => state.user.usdToggle);
const isFiat = false;
const [amount, setAmount] = useState('');
const percentages = useMemo(() => [25, 50, 75, 100], []);
const [selPercentage, setSelPercentage] = useState<number>(-1);
Expand Down Expand Up @@ -151,7 +150,6 @@ export const ModalVbnt = ({
<>
<Modal
title={`${stake ? 'Stake' : 'Unstake'} ${token.symbol}`}
titleElement={<SwapSwitch />}
setIsOpen={setIsOpen}
isOpen={isOpen}
separator
Expand Down
7 changes: 0 additions & 7 deletions src/elements/settings/SettingsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { ReactComponent as IconReddit } from 'assets/icons/reddit.svg';
import { ReactComponent as IconTelegram } from 'assets/icons/telegram.svg';
import { ReactComponent as IconDiscord } from 'assets/icons/discord.svg';
import { ReactComponent as IconVote } from 'assets/icons/vote.svg';
import { ReactComponent as IconCoins } from 'assets/icons/coins.svg';
import { ReactComponent as IconForum } from 'assets/icons/forum.svg';
import { DarkMode } from './DarkMode';
import { Navigate } from 'components/navigate/Navigate';
Expand Down Expand Up @@ -37,12 +36,6 @@ export const SettingsMenuContent = ({ mobile }: { mobile?: boolean }) => {
<div className="flex flex-col gap-[25px]">
{mobile ? (
<>
<Navigate to={BancorURL.tokens}>
<div className="flex items-center gap-10 text-black dark:text-white">
<IconCoins className="w-20 text-black dark:text-white" />
Tokens
</div>
</Navigate>
<Navigate to={BancorURL.vote}>
<div className="flex items-center gap-10 text-black dark:text-white">
<IconVote className="w-20 text-black dark:text-white" />
Expand Down
29 changes: 2 additions & 27 deletions src/elements/swapHeader/SwapHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,14 @@
import { classNameGenerator } from 'utils/pureFunctions';
import 'elements/swapHeader/SwapHeader.css';
import { SwapSwitch } from 'elements/swapSwitch/SwapSwitch';
import { PopoverV3 } from 'components/popover/PopoverV3';
import { ReactComponent as IconSettings } from 'assets/icons/settings.svg';
import { SlippageSettings } from 'elements/settings/SlippageSettings';

interface SwapHeaderProps {
isLimit: boolean;
setIsLimit: Function;
}

export const SwapHeader = ({ isLimit, setIsLimit }: SwapHeaderProps) => {
const marketActive = classNameGenerator({
'swap-header-active': !isLimit,
});

const limitActive = classNameGenerator({
'swap-header-active': isLimit,
});

export const SwapHeader = () => {
return (
<div>
<div className="swap-header">
<div>
<button
className={`${marketActive}`}
onClick={() => setIsLimit(false)}
>
Market
</button>
<span className="border-r b-silver mx-12" />
<button className={limitActive} onClick={() => setIsLimit(true)}>
Limit
</button>
<span className={'swap-header-active'}>Market</span>
</div>

<div className={'flex items-center space-x-20'}>
Expand All @@ -43,7 +19,6 @@ export const SwapHeader = ({ isLimit, setIsLimit }: SwapHeaderProps) => {
>
<SlippageSettings />
</PopoverV3>
<SwapSwitch />
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/elements/swapLimit/SwapLimit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const SwapLimit = ({
const keeperDaoTokens = useAppSelector<KeeprDaoToken[]>(
(state) => state.bancor.keeperDaoTokens
);
const fiatToggle = useAppSelector<boolean>((state) => state.user.usdToggle);
const fiatToggle = false;
const percentages = useMemo(() => [1, 3, 5], []);

const calculatePercentageByRate = useCallback(
Expand Down
7 changes: 0 additions & 7 deletions src/elements/swapSwitch/SwapSwitch.css

This file was deleted.

29 changes: 0 additions & 29 deletions src/elements/swapSwitch/SwapSwitch.tsx

This file was deleted.

Loading

0 comments on commit 07a90c1

Please sign in to comment.