Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from blinklabs-io/chore/merge-tosi-master-main
Browse files Browse the repository at this point in the history
chore: merge 'tosidrop/master'
  • Loading branch information
wolf31o2 authored Sep 21, 2023
2 parents 2ab1af9 + 77b9bac commit 90e5fa5
Show file tree
Hide file tree
Showing 36 changed files with 142 additions and 131 deletions.
2 changes: 1 addition & 1 deletion client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function App() {
const location = useLocation().pathname;
const dispatch = useDispatch();
const connectedWallet = useSelector(
(state: RootState) => state.wallet.walletApi
(state: RootState) => state.wallet.walletApi,
);

const init = async () => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/BlockchainSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function BlockchainSelector({
}) {
const chain = useSelector((state: RootState) => state.global.chain);
const ergoEnabled = useSelector(
(state: RootState) => state.global.ergoEnabled
(state: RootState) => state.global.ergoEnabled,
);
const network = NETWORK_INFO[chain];
const { ref, visible, setVisible } = useComponentVisible(false);
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/Claim/SendAdaInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ const SendAdaInfo = ({
setTransactionStatus,
}: Params) => {
const connectedWalletApi = useSelector(
(state: RootState) => state.wallet.walletApi
(state: RootState) => state.wallet.walletApi,
);
const isWrongNetwork = useSelector(
(state: RootState) => state.wallet.isWrongNetwork
(state: RootState) => state.wallet.isWrongNetwork,
);
const { transfer, loading: transferLoading } = useTransfer();

Expand Down Expand Up @@ -82,7 +82,7 @@ const SendAdaInfo = ({
(txId) => {
setTransactionStatus(TransactionStatusDetail.processing);
setTransactionId(txId);
}
},
);
};

Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Claim/TransactionDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const TransactionDetail = ({
}, []);

const calcTxFee = () => {
let txCalc = ((numberOfTokens * 4000) + settings.txFee).toFixed(6);
let txCalc = (numberOfTokens * 4000 + settings.txFee).toFixed(6);
if (Number(txCalc) >= Number(settings.txFee)) return Number(txCalc);
return Number(settings.txFee);
};
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Header() {
const theme = useSelector((state: RootState) => state.global.theme);
const chain = useSelector((state: RootState) => state.global.chain);
const connectedWallet = useSelector(
(state: RootState) => state.wallet.walletApi
(state: RootState) => state.wallet.walletApi,
);

const RenderWalletConnector = useCallback(() => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Menu/cardano.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default function MenuCardano() {
key={socialMediaItem.url}
socialMediaItem={socialMediaItem}
/>
)
),
)}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Menu/ergo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export default function MenuErgo() {
key={socialMediaItem.url}
socialMediaItem={socialMediaItem}
/>
)
),
)}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/MobileMenu/cardano.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default function MobileMenuCardano() {
key={socialMediaItem.url}
socialMediaItem={socialMediaItem}
/>
)
),
)}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/MobileMenu/ergo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default function MobileMenuErgo() {
key={socialMediaItem.url}
socialMediaItem={socialMediaItem}
/>
)
),
)}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Modal/InfoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { InfoModalTypes } from "src/entities/common.entities";
export const InfoModal = () => {
const dispatch = useDispatch();
const { text, type } = useSelector(
(state: RootState) => state.global.infoModalDetails
(state: RootState) => state.global.infoModalDetails,
);

const renderIcon = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function CardanoWalletSelector() {
dispatch(
showModal({
modalType: ModalTypes.wallet,
})
}),
);
};

Expand Down
2 changes: 1 addition & 1 deletion client/src/components/WalletSelector/Disconnect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const Disconnect = forwardRef<HTMLDivElement, Props>(
Disconnect
</div>
);
}
},
);

export default Disconnect;
8 changes: 4 additions & 4 deletions client/src/components/WalletSelector/ErgoWalletSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import WalletSelector from "./WalletSelector";
export default function ErgoWalletSelector() {
const dispatch = useDispatch();
const connectedWallet = useSelector(
(state: RootState) => state.wallet.ergoWalletApi
(state: RootState) => state.wallet.ergoWalletApi,
);
const { connectWallet, disconnectWallet } = useErgoWallet();
const walletInfoNotConnected = {
Expand All @@ -24,10 +24,10 @@ export default function ErgoWalletSelector() {
isApiConnected: false,
};
const [walletInfo, setWalletInfo] = useState<WalletInfo>(
walletInfoNotConnected
walletInfoNotConnected,
);
const [walletState, setWalletState] = useState<WalletState>(
WalletState.notConnected
WalletState.notConnected,
);

useEffect(() => {
Expand All @@ -52,7 +52,7 @@ export default function ErgoWalletSelector() {
dispatch(
showModal({
modalType: ModalTypes.ergoWallet,
})
}),
);
};

Expand Down
2 changes: 1 addition & 1 deletion client/src/components/WalletSelector/WalletSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface Props {

function WalletSelector({ disconnectWallet, showWalletSelection }: Props) {
const walletState = useSelector(
(state: RootState) => state.wallet.walletState
(state: RootState) => state.wallet.walletState,
);

switch (walletState) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/entities/dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export namespace Dto {
export interface GetMinswapPriceInfoMap extends Base {
response: MinswapTypes.PriceInfoMap;
}

export interface PostBannerText extends Base {
body: {
text: string;
Expand Down
14 changes: 7 additions & 7 deletions client/src/hooks/cardano/claim/useClaimReward.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ export default function useClaimReward() {
const { handleError } = useErrorHandler();
const { showInfoModal } = useModal();
const connectedWalletAddress = useSelector(
(state: RootState) => state.wallet.walletAddress
(state: RootState) => state.wallet.walletAddress,
);
const isWrongNetwork = useSelector(
(state: RootState) => state.wallet.isWrongNetwork
(state: RootState) => state.wallet.isWrongNetwork,
);

const [searchAddress, setSearchAddress] = useState("");
Expand All @@ -43,7 +43,7 @@ export default function useClaimReward() {
agg += 1;
}
return agg;
}, 0)
}, 0),
);
}, [claimableTokens]);

Expand All @@ -56,7 +56,7 @@ export default function useClaimReward() {
) {
showInfoModal(
`You have selected the maximum number of tokens to claim (${maxTokenSelected}).
Please deselect other tokens first`
Please deselect other tokens first`,
);
return;
}
Expand Down Expand Up @@ -86,7 +86,7 @@ export default function useClaimReward() {
const updatedClaimableTokens = [...claimableTokens];
updatedClaimableTokens.forEach((token) => (token.selected = false));
positions.forEach(
(position) => (updatedClaimableTokens[position].selected = true)
(position) => (updatedClaimableTokens[position].selected = true),
);

setClaimableTokens(updatedClaimableTokens);
Expand Down Expand Up @@ -133,7 +133,7 @@ export default function useClaimReward() {
} else {
return a.premium ? -1 : 1;
}
})
}),
);
setPoolInfo(getRewardsResponse.pool_info);
setIsCheckRewardLoading(false);
Expand Down Expand Up @@ -165,7 +165,7 @@ export default function useClaimReward() {
stakeAddress,
stakeAddress.slice(0, 40),
selectedTokenId.join(","),
selectedPremiumToken
selectedPremiumToken,
);
if (res == null) throw new Error();

Expand Down
2 changes: 1 addition & 1 deletion client/src/hooks/cardano/claimHistory/useClaimHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function useClaimHistory() {
text: "No claim history found for the account, yet.",
type: InfoModalTypes.info,
},
})
}),
);
}
} catch (e: unknown) {
Expand Down
4 changes: 2 additions & 2 deletions client/src/hooks/cardano/useStakeToPool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export default function useStakeToPool() {
const [loading, setLoading] = useState(false);
const { handleError } = useErrorHandler();
const connectedWalletApi = useSelector(
(state: RootState) => state.wallet.walletApi
(state: RootState) => state.wallet.walletApi,
);
const connectedWalletAddress = useSelector(
(state: RootState) => state.wallet.walletAddress
(state: RootState) => state.wallet.walletAddress,
);

async function stakeToPool(poolId: string, callback?: () => void) {
Expand Down
6 changes: 3 additions & 3 deletions client/src/hooks/cardano/useTransfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ export default function useTransfer() {
const [loading, setLoading] = useState(false);
const { handleError } = useErrorHandler();
const connectedWalletApi = useSelector(
(state: RootState) => state.wallet.walletApi
(state: RootState) => state.wallet.walletApi,
);
const connectedWalletAddress = useSelector(
(state: RootState) => state.wallet.walletAddress
(state: RootState) => state.wallet.walletAddress,
);

async function transfer(
{ toAddress, amountToSend }: { toAddress: string; amountToSend: string },
callback?: (txId?: string) => void
callback?: (txId?: string) => void,
) {
setLoading(true);
try {
Expand Down
2 changes: 1 addition & 1 deletion client/src/hooks/ergo/useErgoWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function useErgoWallet() {
};

const connectNautilus = async (
ergoConnector: ErgoConnector
ergoConnector: ErgoConnector,
): Promise<NautilusErgoWalletApi> => {
const nautilus = ergoConnector.nautilus;
if (nautilus == null)
Expand Down
2 changes: 1 addition & 1 deletion client/src/hooks/useClickOutside.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const useClickOutside = (action: Function) => {
action();
}
},
[action]
[action],
);

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/hooks/useErrorHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const useErrorHandler = () => {
text,
type: InfoModalTypes.failure,
},
})
}),
);
};

Expand Down
6 changes: 3 additions & 3 deletions client/src/hooks/useModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function useModal() {
text: text,
type: InfoModalTypes.info,
},
})
}),
);
};

Expand All @@ -25,7 +25,7 @@ export default function useModal() {
text: text,
type: InfoModalTypes.failure,
},
})
}),
);
};

Expand All @@ -37,7 +37,7 @@ export default function useModal() {
text: text,
type: InfoModalTypes.success,
},
})
}),
);
};

Expand Down
4 changes: 2 additions & 2 deletions client/src/hooks/useWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const useWallet = () => {
wallet: connectedWallet,
walletApi: connectedWalletApi,
walletAddress: addressInBech32,
})
}),
);
localStorage.setItem("wallet-provider", walletKey);

Expand All @@ -60,7 +60,7 @@ const useWallet = () => {
};

const getWalletAddressInBech32 = async (
walletApi: WalletApi
walletApi: WalletApi,
): Promise<string> => {
if (walletApi == null) {
return "";
Expand Down
2 changes: 1 addition & 1 deletion client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ReactDOM.render(
</Provider>
</BrowserRouter>
</React.StrictMode>,
document.getElementById("root")
document.getElementById("root"),
);

// If you want to start measuring performance in your app, pass a function
Expand Down
2 changes: 1 addition & 1 deletion client/src/layouts/RouterWrapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { RootState } from "src/store";

export default function RouterWrapper() {
const ergoEnabled = useSelector(
(state: RootState) => state.global.ergoEnabled
(state: RootState) => state.global.ergoEnabled,
);
return (
<Routes>
Expand Down
4 changes: 2 additions & 2 deletions client/src/pages/Cardano/ClaimHistory/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { RootState } from "src/store";

function ClaimHistory() {
const connectedWalletAddress = useSelector(
(state: RootState) => state.wallet.walletAddress
(state: RootState) => state.wallet.walletAddress,
);
const isWrongNetwork = useSelector(
(state: RootState) => state.wallet.isWrongNetwork
(state: RootState) => state.wallet.isWrongNetwork,
);
const { claimHistory, loading, checkClaimHistory } = useClaimHistory();
const [searchAddress, setSearchAddress] = useState<string>("");
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/Cardano/Deposit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const DepositInfoPage = () => {
*/
const txStatus: TransactionStatus = await getTxStatus(
requestId,
stakeAddress.slice(0, 40)
stakeAddress.slice(0, 40),
);

/**
Expand Down
2 changes: 1 addition & 1 deletion client/src/reducers/globalSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const globalSlice = createSlice({
action: PayloadAction<{
modalType: ModalTypes;
details?: InfoModalDetails;
}>
}>,
) => {
const { modalType, details } = action.payload;
switch (modalType) {
Expand Down
Loading

0 comments on commit 90e5fa5

Please sign in to comment.