Skip to content

Commit

Permalink
Remove unsupported token notification (#798)
Browse files Browse the repository at this point in the history
* Remove unsupported token notification

* Update transfer switch icon

* Update opacity of switch svg
  • Loading branch information
JayJay1024 authored Aug 20, 2024
1 parent 951e86c commit 3d99249
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 23 deletions.
22 changes: 11 additions & 11 deletions apps/web/public/images/switch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 3 additions & 5 deletions apps/web/src/components/transfer-switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export default function TransferSwitch({ disabled, onSwitch = () => undefined }:
return (
<div className="relative h-[2px] lg:h-[4px]">
<Tooltip
className={`absolute left-1/2 top-1/2 z-[9] -translate-x-1/2 -translate-y-1/2 rounded-lg bg-[#394a50] transition-shadow hover:shadow-[0_0_16px_1px_rgba(255,255,255,.8)] ${
disabled ? "opacity-60 hover:cursor-not-allowed" : "hover:cursor-pointer"
className={`absolute left-1/2 top-1/2 z-[9] -translate-x-1/2 -translate-y-1/2 rounded-lg bg-[#1F282C] transition-shadow hover:shadow-[0_0_8px_1px_rgba(255,255,255,.8)] ${
disabled ? "opacity-80 hover:cursor-not-allowed" : "hover:cursor-pointer"
}`}
content="This cross-chain is currently unavailable"
enabled={disabled === true}
Expand All @@ -33,9 +33,7 @@ export default function TransferSwitch({ disabled, onSwitch = () => undefined }:
height={28}
alt="Switch"
src="images/switch.svg"
className={`h-[1.75rem] w-[1.75rem] shrink-0 transition-opacity ${
disabled ? "opacity-60" : "opacity-80 hover:opacity-100"
}`}
className={`h-[1.75rem] w-[1.75rem] shrink-0 transition-opacity ${disabled ? "opacity-80" : ""}`}
/>
</div>
</Tooltip>
Expand Down
7 changes: 0 additions & 7 deletions apps/web/src/hooks/use-supported-chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { GQL_GET_SUPPORTED_CHAINS } from "../config";
import { SupportedChainsReqParams, SupportedChainsResData, TokenCategory } from "../types";
import { useQuery } from "@apollo/client";
import { useEffect, useMemo, useState } from "react";
import { notification } from "../ui/notification";

export function useSupportedChains(token: TokenCategory) {
const { loading, data: _data } = useQuery<SupportedChainsResData, SupportedChainsReqParams>(
Expand All @@ -17,12 +16,6 @@ export function useSupportedChains(token: TokenCategory) {
useEffect(() => {
if (!loading) {
setData(_data?.queryLnBridgeSupportedChains || []);
if (!(_data?.queryLnBridgeSupportedChains || []).length) {
notification.warn({
title: "No supported chains",
description: "Cross-chain transfer of this token is temporarily not supported.",
});
}
}
}, [loading, _data?.queryLnBridgeSupportedChains]);

Expand Down

0 comments on commit 3d99249

Please sign in to comment.