From 318f0e4ed6ff28a56732249a4e442d5dbdcdc081 Mon Sep 17 00:00:00 2001 From: DaveVodrazka Date: Fri, 16 Aug 2024 10:00:59 +0200 Subject: [PATCH] fix: remove unused dependencies --- src/components/PriceGuard/PriceGuard.tsx | 5 ----- src/components/PriceGuard/priceguard.module.css | 5 +++++ src/hooks/useBuyPriceGuardData.ts | 6 ------ src/redux/actions.ts | 7 ------- src/redux/reducers/ui.ts | 11 ----------- 5 files changed, 5 insertions(+), 29 deletions(-) delete mode 100644 src/hooks/useBuyPriceGuardData.ts diff --git a/src/components/PriceGuard/PriceGuard.tsx b/src/components/PriceGuard/PriceGuard.tsx index afefacd8..767ad7bb 100644 --- a/src/components/PriceGuard/PriceGuard.tsx +++ b/src/components/PriceGuard/PriceGuard.tsx @@ -60,7 +60,6 @@ export const PriceGuard = () => { // eslint-disable-next-line react-hooks/exhaustive-deps const callWithDelay = useCallback( debounce((size: number, controller: AbortController) => { - console.log("DEBOUNCING", data); if (!data) { return; } @@ -77,19 +76,15 @@ export const PriceGuard = () => { (o) => o.maturity === expiry && o.strike === currentStrike )!; - console.log("OPTION MAYBE", pickedOption); if (!pickedOption) { return; } - console.log("GETTING PRICE GUARD"); setPriceLoading(true); getPremia(pickedOption, size, false) .then((res) => { - console.log("GOT PRICE GUARD", res); if (controller.signal.aborted) { return; } - console.log("PAST CONTROLLER PRICE GUARD", res); setPrice(res as bigint); setPriceLoading(false); }) diff --git a/src/components/PriceGuard/priceguard.module.css b/src/components/PriceGuard/priceguard.module.css index 097cef61..669ce10b 100644 --- a/src/components/PriceGuard/priceguard.module.css +++ b/src/components/PriceGuard/priceguard.module.css @@ -41,6 +41,11 @@ flex-flow: column; } +.assetamount option { + color: white; + background-color: black; +} + .assetamount>div>div { display: flex; flex-flow: row; diff --git a/src/hooks/useBuyPriceGuardData.ts b/src/hooks/useBuyPriceGuardData.ts deleted file mode 100644 index 27b6bea6..00000000 --- a/src/hooks/useBuyPriceGuardData.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { BuyPriceGuardModalData } from "../components/PriceGuard/BuyPriceGuardModal"; -import { useSelector } from "react-redux"; -import { RootState } from "../redux/store"; - -export const useBuyPriceGuardData = (): BuyPriceGuardModalData | undefined => - useSelector((s: RootState) => s.ui.buyPriceGuardModalData); diff --git a/src/redux/actions.ts b/src/redux/actions.ts index d90783c0..ea26b38d 100644 --- a/src/redux/actions.ts +++ b/src/redux/actions.ts @@ -6,7 +6,6 @@ import { GovernanceSubpage, PortfolioParamType, ReferralSent, - setBuyPriceGuardModalState, setCloseOptionState, setGovernanceSubpageState, setParamState, @@ -20,7 +19,6 @@ import { store } from "./store"; import { Settings } from "../types/settings"; import { NetworkState } from "../types/network"; import { OptionWithPosition } from "../classes/Option"; -import { BuyPriceGuardModalData } from "../components/PriceGuard/BuyPriceGuardModal"; import { TransferData } from "../components/Transfer/transfer"; import { addTxReducer, @@ -64,9 +62,6 @@ export const openSlippageDialog = () => export const openCloseOptionDialog = () => openDialogWithContent(DialogContentElem.CloseOption); -export const openBuyPriceGuardDialog = () => - openDialogWithContent(DialogContentElem.BuyPriceGuard); - export const openAccountDialog = () => openDialogWithContent(DialogContentElem.Account); @@ -84,8 +79,6 @@ export const setSlippage = (n: number) => store.dispatch(setSlippageState(n)); export const setCloseOption = (option: OptionWithPosition) => store.dispatch(setCloseOptionState(option)); -export const setBuyPriceGuardModal = (data: BuyPriceGuardModalData) => - store.dispatch(setBuyPriceGuardModalState(data)); export const setPortfolioParam = (option: PortfolioParamType) => store.dispatch(setParamState(option)); diff --git a/src/redux/reducers/ui.ts b/src/redux/reducers/ui.ts index a5f1e323..cfd3c62a 100644 --- a/src/redux/reducers/ui.ts +++ b/src/redux/reducers/ui.ts @@ -1,7 +1,6 @@ import { createSlice } from "@reduxjs/toolkit"; import { OptionWithPosition } from "../../classes/Option"; -import { BuyPriceGuardModalData } from "../../components/PriceGuard/BuyPriceGuardModal"; import { TransferData } from "../../components/Transfer/transfer"; export enum DialogContentElem { @@ -10,7 +9,6 @@ export enum DialogContentElem { NetworkMismatch = "NetworkMismatch", Slippage = "Slippage", CloseOption = "CloseOption", - BuyPriceGuard = "BuyPriceGuard", MetamaskMissing = "MetamaskMissing", NotEnoughUnlocked = "NotEnoughUnlocked", TransferCapital = "TransferCapital", @@ -52,7 +50,6 @@ export interface UiState { dialogContent: DialogContentElem; toastState: ToastState; activeCloseOption?: OptionWithPosition; - buyPriceGuardModalData?: BuyPriceGuardModalData; transferData?: TransferData; transferDialogShown: boolean; portfolioParam?: PortfolioParamType; @@ -84,13 +81,6 @@ export const ui = createSlice({ state.activeCloseOption = action.payload; return state; }, - setBuyPriceGuardModalState: ( - state, - action: { payload: BuyPriceGuardModalData } - ) => { - state.buyPriceGuardModalData = action.payload; - return state; - }, setToastState: (state, action: { payload: Partial }) => { state.toastState = { ...state.toastState, ...action.payload }; return state; @@ -125,7 +115,6 @@ export const ui = createSlice({ export const { toggleDialog, - setBuyPriceGuardModalState, setCloseOptionState, setToastState, setTransferDataModalState,