Select a token
diff --git a/packages/web/src/components/common/tooltip/FloatingTooltip.tsx b/packages/web/src/components/common/tooltip/FloatingTooltip.tsx
index 2ccd6d9c7..c3c9b53fe 100644
--- a/packages/web/src/components/common/tooltip/FloatingTooltip.tsx
+++ b/packages/web/src/components/common/tooltip/FloatingTooltip.tsx
@@ -17,11 +17,12 @@ interface TooltipProps {
position: FloatingPosition;
content: React.ReactNode;
className?: string;
+ isHiddenArrow?: boolean;
children?: any;
}
const FloatingTooltip = forwardRef, TooltipProps>(
- ({ children, content, className }, ref) => {
+ ({ children, content, className, isHiddenArrow, position = "top" as FloatingPosition, offset = 20 }, ref) => {
const {
handleMouseMove,
x,
@@ -34,14 +35,15 @@ const FloatingTooltip = forwardRef, TooltipProps>(
floating,
setOpened,
} = useFloatingTooltip({
- offset: 20,
- position: "top",
+ offset: offset,
+ position: position,
});
+
const theme = useTheme();
const targetRef = useMergedRef(boundaryRef, (children as any).ref, ref);
- const onMouseEnter = (event: React.MouseEvent) => {
+ const onMouseEnter = (event: React.MouseEvent | React.TouchEvent) => {
children.props.onMouseEnter?.(event);
handleMouseMove(event);
setOpened(true);
@@ -52,6 +54,12 @@ const FloatingTooltip = forwardRef, TooltipProps>(
setOpened(false);
};
+ const onTouchStart = (event: React.TouchEvent) => {
+ children.props.onPointerEnter?.(event);
+ handleMouseMove(event);
+ setOpened(true);
+ };
+
return (
<>
{cloneElement(children, {
@@ -59,6 +67,8 @@ const FloatingTooltip = forwardRef, TooltipProps>(
ref: targetRef,
onMouseEnter,
onMouseLeave,
+ onTouchStart: onTouchStart,
+ onTouchMove: onTouchStart,
})}
@@ -72,16 +82,18 @@ const FloatingTooltip = forwardRef, TooltipProps>(
zIndex: Z_INDEX.modalTooltip,
}}
className={className}
+ onTouchMove={onTouchStart}
+ onTouchStart={onTouchStart}
>
-
- {content}
+ />}
+ {content && {content}}
>
diff --git a/packages/web/src/components/common/wallet-connector-button/WalletConnectorButton.styles.ts b/packages/web/src/components/common/wallet-connector-button/WalletConnectorButton.styles.ts
index 5dfd64f20..c4a7cc458 100644
--- a/packages/web/src/components/common/wallet-connector-button/WalletConnectorButton.styles.ts
+++ b/packages/web/src/components/common/wallet-connector-button/WalletConnectorButton.styles.ts
@@ -21,6 +21,17 @@ export const WalletConnectorButtonWrapper = styled.div`
.switch-network {
margin: 16px 0;
}
+ .loading-button {
+ width: 20px;
+ height: 20px;
+ background: conic-gradient(from 0deg at 50% 50.63%, #FFFFFF 0deg, #233DBD 360deg);
+ margin: auto;
+ &::before {
+ width: 14px;
+ height: 14px;
+ background-color: ${({ theme }) => theme.color.background04Hover};
+ }
+ }
`;
export const FailNetworkTooltipContentWrap = styled.div`
diff --git a/packages/web/src/components/common/wallet-connector-button/WalletConnectorButton.tsx b/packages/web/src/components/common/wallet-connector-button/WalletConnectorButton.tsx
index 03aee480b..90c270049 100644
--- a/packages/web/src/components/common/wallet-connector-button/WalletConnectorButton.tsx
+++ b/packages/web/src/components/common/wallet-connector-button/WalletConnectorButton.tsx
@@ -14,6 +14,8 @@ import { AccountModel } from "@models/account/account-model";
import IconFailed from "../icons/IconFailed";
import Tooltip from "../tooltip/Tooltip";
import { Global, css } from "@emotion/react";
+import LoadingSpinner from "../loading-spinner/LoadingSpinner";
+import useEscCloseModal from "@hooks/common/use-esc-close-modal";
interface WalletConnectProps {
account: AccountModel | null;
@@ -23,6 +25,7 @@ interface WalletConnectProps {
disconnectWallet: () => void;
switchNetwork: () => void;
isSwitchNetwork: boolean;
+ loadingConnect: string;
}
const ToolTipGlobalStyle = () => {
@@ -58,8 +61,22 @@ const WalletConnectorButton: React.FC
= ({
disconnectWallet,
switchNetwork,
isSwitchNetwork,
+ loadingConnect,
}) => {
const [toggle, setToggle] = useAtom(CommonState.headerToggle);
+ const handleESC = () => {
+ setToggle(prev => {
+ if (prev.walletConnect) {
+ return {
+ ...prev,
+ walletConnect: false,
+ };
+ }
+ return prev;
+ });
+ };
+
+ useEscCloseModal(() => handleESC());
const address = useMemo(() => {
if (account === null) {
@@ -75,6 +92,10 @@ const WalletConnectorButton: React.FC = ({
}));
};
+ const isLoading = useMemo(() => {
+ return loadingConnect === "loading";
+ }, [loadingConnect]);
+
return (
{connected ? (
@@ -105,19 +126,20 @@ const WalletConnectorButton: React.FC = ({
arrowColor: "text18",
padding: "10px 16px",
gap: "8px",
+ height: 36
}}
onClick={onMenuToggle}
/>
) : (
}
+ text={isLoading ? "" : "Wallet Login"}
+ rightIcon={isLoading ? : }
style={{
hierarchy: ButtonHierarchy.Primary,
fontType: "p1",
- width: 155,
+ width: 136,
height: 36,
- padding: "10px 16px 10px 20px",
+ padding: isLoading ? "8.5px 16px 7.5px 20px" : "10px 16px 10px 20px",
justify: "space-between",
}}
onClick={onMenuToggle}
diff --git a/packages/web/src/components/common/wallet-connector-menu/WalletConnectorMenu.styles.ts b/packages/web/src/components/common/wallet-connector-menu/WalletConnectorMenu.styles.ts
index 6454de9ba..759a7ecbc 100644
--- a/packages/web/src/components/common/wallet-connector-menu/WalletConnectorMenu.styles.ts
+++ b/packages/web/src/components/common/wallet-connector-menu/WalletConnectorMenu.styles.ts
@@ -17,6 +17,7 @@ export const WalletConnectorMenuWrapper = styled.div`
border-radius: 8px;
box-shadow: 8px 8px 20px rgba(0, 0, 0, 0.2);
padding: 16px;
+ z-index: ${Z_INDEX.modal};
right: ${({ width }) => {
return width && width < 1521 && "0px";
}};
@@ -131,4 +132,16 @@ export const CopyTooltip = styled.div`
.polygon-icon * {
fill: ${({ theme }) => theme.color.background02};
}
-`;
\ No newline at end of file
+`;
+
+export const Overlay = styled.div`
+ position: fixed;
+ top: 0px;
+ bottom: 0px;
+ left: 0px;
+ right: 0px;
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+ z-index: ${Z_INDEX.modalOverlay};
+`;
diff --git a/packages/web/src/components/common/wallet-connector-menu/WalletConnectorMenu.tsx b/packages/web/src/components/common/wallet-connector-menu/WalletConnectorMenu.tsx
index 9f40225e4..b40984c5c 100644
--- a/packages/web/src/components/common/wallet-connector-menu/WalletConnectorMenu.tsx
+++ b/packages/web/src/components/common/wallet-connector-menu/WalletConnectorMenu.tsx
@@ -1,6 +1,5 @@
import React, {
useCallback,
- useEffect,
useMemo,
useRef,
useState,
@@ -15,6 +14,7 @@ import {
CopyTooltip,
IconButton,
MenuHeader,
+ Overlay,
ThemeSelector,
WalletConnectorMenuWrapper,
} from "./WalletConnectorMenu.styles";
@@ -110,50 +110,55 @@ const WalletConnectorMenu: React.FC = ({
disconnectWallet();
}, [disconnectWallet]);
- useEffect(() => {
- const closeMenu = (e: MouseEvent) => {
- if (menuRef.current && menuRef.current.contains(e.target as Node)) {
- return;
- } else {
- e.stopPropagation();
- onMenuToggle();
- }
- };
- window.addEventListener("click", closeMenu, true);
- return () => {
- window.removeEventListener("click", closeMenu, true);
- };
- }, [menuRef, onMenuToggle]);
-
const connect = useCallback(() => {
+ onMenuToggle();
connectAdenaClient();
}, [connectAdenaClient]);
return (
-
- {connected ? (
-
-
+ <>
+
+ {connected ? (
+
+
+ {isSwitchNetwork ? (
+
+ ) : (
+
+ )}
+
+ {formatAddress(account?.address || "")}
+
+
+
{isSwitchNetwork ? (
-
+
) : (
-
+
{balanceText}
)}
-
- {formatAddress(account?.address || "")}
-
-
-
- {isSwitchNetwork ? (
+
+ ) : (
+
- ) : (
-
-
+
+ )}
+
+
+ Theme
+
+
- )}
-
-
- Theme
-
-
-
-
+
+
+ >
);
};
diff --git a/packages/web/src/components/dashboard/activity-info/ActivityInfo.styles.ts b/packages/web/src/components/dashboard/activity-info/ActivityInfo.styles.ts
index d19ebda6b..c4410ad4d 100644
--- a/packages/web/src/components/dashboard/activity-info/ActivityInfo.styles.ts
+++ b/packages/web/src/components/dashboard/activity-info/ActivityInfo.styles.ts
@@ -15,7 +15,6 @@ export const TokenInfoWrapper = styled.div`
export const HoverSection = styled.div`
${mixins.flexbox("row", "center", "center", false)};
- background-color: ${({ theme }) => theme.color.background01};
transition: background-color 0.3s ease;
height: 100%;
&:hover {
@@ -50,6 +49,9 @@ export const TableColumn = styled.div<{ tdWidth: number }>`
${fonts.body11};
color: ${({ theme }) => theme.color.text02};
}
+ .tooltip-label {
+ cursor: default;
+ }
.symbol-text {
font-weight: 700;
}
diff --git a/packages/web/src/components/dashboard/activity-info/ActivityInfo.tsx b/packages/web/src/components/dashboard/activity-info/ActivityInfo.tsx
index 2bd58bfc5..6b300e81f 100644
--- a/packages/web/src/components/dashboard/activity-info/ActivityInfo.tsx
+++ b/packages/web/src/components/dashboard/activity-info/ActivityInfo.tsx
@@ -74,7 +74,7 @@ const ActivityInfo: React.FC = ({ item, idx, key }) => {
}
>
- {account}
+ {account}
@@ -86,7 +86,7 @@ const ActivityInfo: React.FC = ({ item, idx, key }) => {
}
>
- {time}
+ {time}
diff --git a/packages/web/src/components/dashboard/activity-list-header/ActivityListHeader.styles.ts b/packages/web/src/components/dashboard/activity-list-header/ActivityListHeader.styles.ts
index f599d2e49..df354cd38 100644
--- a/packages/web/src/components/dashboard/activity-list-header/ActivityListHeader.styles.ts
+++ b/packages/web/src/components/dashboard/activity-list-header/ActivityListHeader.styles.ts
@@ -7,7 +7,9 @@ export const ActivityListHeaderwrapper = styled.div`
${mixins.flexbox("row", "center", "flex-start")};
width: 100%;
gap: 36px;
-
+ ${media.tabletMiddle} {
+ gap: 36px;
+ }
${media.mobile} {
flex-direction: column;
justify-content: center;
@@ -16,6 +18,7 @@ export const ActivityListHeaderwrapper = styled.div`
}
h2 {
${fonts.h5};
+ flex: 0 0 auto;
${media.mobile} {
${fonts.h6};
}
@@ -25,6 +28,9 @@ export const ActivityListHeaderwrapper = styled.div`
> div {
padding: 1px;
}
+ ${media.tabletMiddle} {
+ overflow-x: scroll;
+ }
${media.mobile} {
max-width: ${ContainerWidth.MOBILE_CONTAINER};
width: 100%;
diff --git a/packages/web/src/components/dashboard/activity-list-header/ActivityListHeader.tsx b/packages/web/src/components/dashboard/activity-list-header/ActivityListHeader.tsx
index 4f0f05f75..9789816bf 100644
--- a/packages/web/src/components/dashboard/activity-list-header/ActivityListHeader.tsx
+++ b/packages/web/src/components/dashboard/activity-list-header/ActivityListHeader.tsx
@@ -13,7 +13,7 @@ const ActivityListHeader: React.FC = ({
changeActivityType,
}) => (
- Activities
+ Onchain Activities
theme.color.point};
- width: 36px;
- height: 36px;
- border-radius: 100%;
- ${media.mobile} {
- width: 25px;
- height: 25px;
+ svg {
+ width: 36px;
+ height: 36px;
+ ${media.mobile} {
+ width: 25px;
+ height: 25px;
+ }
}
}
.gnos-image {
@@ -60,13 +60,13 @@ export const GnotLogoWrapper = styled.div`
gap: 8px;
.gnot-image-wrapper {
${mixins.flexbox("row", "center", "center")};
- background-color: ${({ theme }) => theme.color.icon09};
- width: 36px;
- height: 36px;
- border-radius: 100%;
- ${media.mobile} {
- width: 25px;
- height: 25px;
+ svg {
+ width: 36px;
+ height: 36px;
+ ${media.mobile} {
+ width: 25px;
+ height: 25px;
+ }
}
}
.gnot-symbol {
diff --git a/packages/web/src/components/dashboard/dashboard-info-title/DashboardInfoTitle.tsx b/packages/web/src/components/dashboard/dashboard-info-title/DashboardInfoTitle.tsx
index c00d72de7..c6544e211 100644
--- a/packages/web/src/components/dashboard/dashboard-info-title/DashboardInfoTitle.tsx
+++ b/packages/web/src/components/dashboard/dashboard-info-title/DashboardInfoTitle.tsx
@@ -8,6 +8,7 @@ import {
import IconLogoWhite from "../../common/icons/IconLogoWhite";
import { DashboardTokenInfo } from "@containers/dashboard-info-container/DashboardInfoContainer";
import { DEVICE_TYPE } from "@styles/media";
+import IconLogoGnot from "@components/common/icons/IconLogoGnot";
interface DashboardInfoTitleProps {
dashboardTokenInfo: DashboardTokenInfo;
@@ -24,7 +25,7 @@ const DashboardInfoTitle: React.FC = ({
- GNOS
+ GNS
{dashboardTokenInfo.gnosAmount}
@@ -32,7 +33,7 @@ const DashboardInfoTitle: React.FC = ({
-
+
GNOT
diff --git a/packages/web/src/components/dashboard/dashboard-info/DashboardInfo.styles.ts b/packages/web/src/components/dashboard/dashboard-info/DashboardInfo.styles.ts
index 797b09ca9..7c66a9392 100644
--- a/packages/web/src/components/dashboard/dashboard-info/DashboardInfo.styles.ts
+++ b/packages/web/src/components/dashboard/dashboard-info/DashboardInfo.styles.ts
@@ -7,12 +7,21 @@ export const DashboardInfoWrapper = styled.div`
${mixins.flexbox("column", "flex-start", "flex-start")};
max-width: ${ContainerWidth.WEB_CONTAINER};
width: 100%;
- padding: 24px;
+ padding: 23px;
gap: 24px;
background-color: ${({ theme }) => theme.color.background03};
border: 1px solid ${({ theme }) => theme.color.border01};
border-radius: 10px;
box-shadow: 8px 8px 20px 0px rgba(0, 0, 0, 0.08);
+ .loading-spining {
+ padding: 8px 0;
+ width: 100%;
+ span {
+ height: 20px;
+ display: block;
+ max-width: 100%;
+ }
+ }
${media.tablet} {
max-width: ${ContainerWidth.TABLET_CONTAINER};
}
@@ -20,5 +29,8 @@ export const DashboardInfoWrapper = styled.div`
max-width: ${ContainerWidth.MOBILE_CONTAINER};
padding: 0px;
gap: 0px;
+ .loading-spining {
+ padding: 30px 0 30px 11px;
+ }
}
`;
diff --git a/packages/web/src/components/dashboard/dashboard-info/DashboardInfo.tsx b/packages/web/src/components/dashboard/dashboard-info/DashboardInfo.tsx
index 630e7a00c..073b04f9d 100644
--- a/packages/web/src/components/dashboard/dashboard-info/DashboardInfo.tsx
+++ b/packages/web/src/components/dashboard/dashboard-info/DashboardInfo.tsx
@@ -7,12 +7,14 @@ import {
SupplyOverviewInfo,
} from "@containers/dashboard-info-container/DashboardInfoContainer";
import { DEVICE_TYPE } from "@styles/media";
+import { SHAPE_TYPES, skeletonTokenDetail } from "@constants/skeleton.constant";
interface DashboardInfoProps {
dashboardTokenInfo: DashboardTokenInfo;
supplyOverviewInfo: SupplyOverviewInfo;
governenceOverviewInfo: GovernenceOverviewInfo;
breakpoint: DEVICE_TYPE;
+ loading: boolean;
}
const DashboardInfo: React.FC = ({
@@ -20,16 +22,23 @@ const DashboardInfo: React.FC = ({
supplyOverviewInfo,
governenceOverviewInfo,
breakpoint,
+ loading,
}) => (
-
+ />}
+ {loading &&
+
+
}
);
diff --git a/packages/web/src/components/dashboard/dashboard-label/DashboardLabel.tsx b/packages/web/src/components/dashboard/dashboard-label/DashboardLabel.tsx
index 0d9f0b019..a222df070 100644
--- a/packages/web/src/components/dashboard/dashboard-label/DashboardLabel.tsx
+++ b/packages/web/src/components/dashboard/dashboard-label/DashboardLabel.tsx
@@ -4,7 +4,7 @@ import Tooltip from "@components/common/tooltip/Tooltip";
import { WalletBalanceDetailInfoTooltipContent } from "./DashboardLabel.styles";
interface WalletBalanceDetailInfoProps {
- tooltip: string;
+ tooltip: React.ReactNode;
}
const DashboardLabel: React.FC = ({
diff --git a/packages/web/src/components/dashboard/dashboard-overview/DashboardOverview.tsx b/packages/web/src/components/dashboard/dashboard-overview/DashboardOverview.tsx
index bb3d8ad89..733493eae 100644
--- a/packages/web/src/components/dashboard/dashboard-overview/DashboardOverview.tsx
+++ b/packages/web/src/components/dashboard/dashboard-overview/DashboardOverview.tsx
@@ -15,22 +15,24 @@ interface DashboardOverviewProps {
supplyOverviewInfo: SupplyOverviewInfo;
governenceOverviewInfo: GovernenceOverviewInfo;
breakpoint: DEVICE_TYPE;
+ loading: boolean;
}
const DashboardOverview: React.FC = ({
supplyOverviewInfo,
governenceOverviewInfo,
breakpoint,
+ loading,
}) => (
{breakpoint === DEVICE_TYPE.MOBILE && }
-
+
{breakpoint !== DEVICE_TYPE.MOBILE ? (
) : (
)}
-
+
);
diff --git a/packages/web/src/components/dashboard/governance-overview/GovernanceOverview.styles.ts b/packages/web/src/components/dashboard/governance-overview/GovernanceOverview.styles.ts
index acfe626a4..e0e9fa48b 100644
--- a/packages/web/src/components/dashboard/governance-overview/GovernanceOverview.styles.ts
+++ b/packages/web/src/components/dashboard/governance-overview/GovernanceOverview.styles.ts
@@ -7,10 +7,10 @@ export const GovernanceOverviewWrapper = styled.div`
${mixins.flexbox("column", "flex-start", "flex-start")};
width: 100%;
color: ${({ theme }) => theme.color.text02};
- padding: 24px;
+ padding: 23px;
gap: 24px;
${media.mobile} {
- padding: 12px 12px 16px 12px;
+ padding: 11px 11px 15px 11px;
gap: 16px;
}
`;
@@ -87,7 +87,6 @@ export const GovernanceWrapper = styled.div`
${fonts.body12}
}
svg {
- cursor: pointer;
margin: 1.5px 0px;
width: 18px;
height: 18px;
@@ -163,3 +162,14 @@ export const GovernanceWrapper = styled.div`
}
}
`;
+
+export const LoadingTextWrapper = styled.div`
+ padding: 2.5px 0;
+ span {
+ height: 20px;
+ display: block;
+ }
+ ${media.mobile} {
+ padding: 1px 0;
+ }
+`;
\ No newline at end of file
diff --git a/packages/web/src/components/dashboard/governance-overview/GovernanceOverview.tsx b/packages/web/src/components/dashboard/governance-overview/GovernanceOverview.tsx
index d6ee4d709..aed5b178a 100644
--- a/packages/web/src/components/dashboard/governance-overview/GovernanceOverview.tsx
+++ b/packages/web/src/components/dashboard/governance-overview/GovernanceOverview.tsx
@@ -6,15 +6,29 @@ import {
GovernanceWrapper,
IconButton,
LabelIconButton,
+ LoadingTextWrapper,
} from "./GovernanceOverview.styles";
import { GovernenceOverviewInfo } from "@containers/dashboard-info-container/DashboardInfoContainer";
+import { SHAPE_TYPES, skeletonTokenDetail } from "@constants/skeleton.constant";
interface GovernanceOverviewProps {
governenceOverviewInfo: GovernenceOverviewInfo;
+ loading: boolean;
}
+const LoadingText = () => {
+ return (
+
+
+
+ );
+};
+
const GovernanceOverview: React.FC = ({
governenceOverviewInfo,
+ loading,
}) => (
@@ -30,31 +44,33 @@ const GovernanceOverview: React.FC = ({
-
Total xGNOS Issued
-
+
Total xGNS Issued
+
-
{governenceOverviewInfo.totalXgnosIssued}
+ {!loading ?
{governenceOverviewInfo.totalXgnosIssued}
:
}
-
{governenceOverviewInfo.holders}
+ {!loading ?
{governenceOverviewInfo.holders}
:
}
-
{governenceOverviewInfo.passedProposals}
+ {!loading ?
{governenceOverviewInfo.passedProposals}
:
}
+
-
{governenceOverviewInfo.activeProposals}
-
{governenceOverviewInfo.activeProposals} :
}
+
+ {!loading &&
{
alert("open Link");
}}
@@ -62,15 +78,15 @@ const GovernanceOverview: React.FC = ({
-
+ }
-
{governenceOverviewInfo.communityPool}
+ {!loading ?
{governenceOverviewInfo.communityPool}
:
}
diff --git a/packages/web/src/components/dashboard/supply-overview/SupplyOverview.styles.ts b/packages/web/src/components/dashboard/supply-overview/SupplyOverview.styles.ts
index 33d4ebf68..b286cb5b9 100644
--- a/packages/web/src/components/dashboard/supply-overview/SupplyOverview.styles.ts
+++ b/packages/web/src/components/dashboard/supply-overview/SupplyOverview.styles.ts
@@ -7,7 +7,7 @@ export const SupplyOverviewWrapper = styled.div`
${mixins.flexbox("column", "flex-start", "flex-start")}
width: 100%;
color: ${({ theme }) => theme.color.text02};
- padding: 24px;
+ padding: 23px;
gap: 24px;
.supply-overview {
${fonts.body9};
@@ -16,7 +16,7 @@ export const SupplyOverviewWrapper = styled.div`
}
}
${media.mobile} {
- padding: 12px;
+ padding: 11px;
gap: 16px;
}
`;
@@ -41,7 +41,6 @@ export const SupplyInfoWrapper = styled.div`
${fonts.body12}
}
svg {
- cursor: pointer;
margin: 1.5px 0px;
width: 18px;
height: 18px;
@@ -104,11 +103,31 @@ export const SupplyInfoWrapper = styled.div`
${mixins.flexbox("column", "flex-end", "center")};
width: 100%;
gap: 4px;
+ .loading-text-wrapper {
+ &:last-of-type {
+ padding: 0;
+ margin-bottom: -4px;
+ }
+ }
${media.tabletMiddle} {
flex-direction: column;
align-items: flex-start;
gap: 4px;
}
+ ${media.mobile} {
+ flex-direction: row;
+ align-items: center;
+ justify-content: space-between;
+ gap: 4px;
+ .loading-text-wrapper {
+ span {
+ width: 100px;
+ }
+ &:last-of-type {
+ margin-bottom: 0px;
+ }
+ }
+ }
}
.staked-ratio-title {
${fonts.p2}
@@ -120,7 +139,7 @@ export const SupplyInfoWrapper = styled.div`
${mixins.flexbox("row", "center", "flex-start")};
gap: 4px;
svg {
- cursor: pointer;
+ cursor: default;
margin: 3.5px 0px;
width: 18px;
height: 18px;
@@ -150,3 +169,53 @@ export const ProgressBar = styled.div`
background-color: ${({ theme }) => theme.color.point};
}
`;
+
+export const LoadingTextWrapper = styled.div`
+ padding: 2.5px 0;
+ span {
+ height: 20px;
+ display: block;
+ }
+ ${media.mobile} {
+ padding: 1px 0;
+ }
+`;
+export const LoadingProgressWrapper = styled.div`
+ width: 100%;
+ span {
+ height: 12px;
+ display: block;
+ }
+`;
+
+export const BlockEmissionsWrapper = styled.div`
+ width: 268px;
+ ${mixins.flexbox("column", "flex-start", "flex-start")};
+ gap: 8px;
+ ${media.mobile} {
+ gap: 4px;
+ }
+ h5 {
+ color: ${({ theme }) => theme.color.text04};
+ ${fonts.body12}
+ }
+ .content {
+ height: 28px;
+ width: 100%;
+ ${mixins.flexbox("row", "center", "space-between")};
+
+ .label, .value {
+ color: ${({ theme }) => theme.color.text02};
+ ${fonts.body12}
+ }
+ .value {
+ ${mixins.flexbox("row", "center", "flex-end")};
+ gap: 8px;
+ img {
+ display: block;
+ width: 20px;
+ height: 20px;
+ }
+ }
+ }
+`;
diff --git a/packages/web/src/components/dashboard/supply-overview/SupplyOverview.tsx b/packages/web/src/components/dashboard/supply-overview/SupplyOverview.tsx
index 00e2fe3d3..1feb0b919 100644
--- a/packages/web/src/components/dashboard/supply-overview/SupplyOverview.tsx
+++ b/packages/web/src/components/dashboard/supply-overview/SupplyOverview.tsx
@@ -4,13 +4,67 @@ import {
SupplyOverviewWrapper,
SupplyInfoWrapper,
ProgressBar,
+ LoadingTextWrapper,
+ LoadingProgressWrapper,
+ BlockEmissionsWrapper,
} from "./SupplyOverview.styles";
+import { SHAPE_TYPES, skeletonTokenDetail } from "@constants/skeleton.constant";
+
interface SupplyOverviewInfoProps {
supplyOverviewInfo: SupplyOverviewInfo;
+ loading: boolean;
}
+const LoadingText = () => {
+ return (
+
+
+
+ );
+};
+
+const LoadingProgress = () => {
+ return (
+
+
+
+ );
+};
+
+const BlockEmissions = () => {
+ return (
+ Block Emissions
+
+
Liquidity Staking
+
+
+
123.44 / day
+
+
+
+
DevOps
+
+
+
53.44 / day
+
+
+
+
Community
+
+
+
12.44 / day
+
+
+ );
+};
+
const SupplyOverview: React.FC = ({
supplyOverviewInfo,
+ loading,
}) => (
Supply Overview
@@ -18,42 +72,42 @@ const SupplyOverview: React.FC = ({
Total Supply
-
+
-
{supplyOverviewInfo.totalSupply}
+ {!loading ?
{supplyOverviewInfo.totalSupply}
:
}
-
{supplyOverviewInfo.circulatingSupply}
+ {!loading ?
{supplyOverviewInfo.circulatingSupply}
:
}
-
+ {!loading ?
-
+ :
}
Daily Block Emissions
-
+
-
{supplyOverviewInfo.dailyBlockEmissions}
-
+ {!loading ?
{supplyOverviewInfo.dailyBlockEmissions}
:
}
+ {!loading &&
} />}
-
{supplyOverviewInfo.totalStaked}
-
+ {!loading ?
{supplyOverviewInfo.totalStaked}
:
}
+ {!loading ?
Staking Ratio: {supplyOverviewInfo.stakingRatio}
-
+
:
}
diff --git a/packages/web/src/components/dashboard/tvl-chart-graph/TvlChartGraph.styles.ts b/packages/web/src/components/dashboard/tvl-chart-graph/TvlChartGraph.styles.ts
index 649bda37d..8f0031d63 100644
--- a/packages/web/src/components/dashboard/tvl-chart-graph/TvlChartGraph.styles.ts
+++ b/packages/web/src/components/dashboard/tvl-chart-graph/TvlChartGraph.styles.ts
@@ -6,7 +6,7 @@ import mixins from "@styles/mixins";
export const TvlChartGraphWrapper = styled.div`
${mixins.flexbox("column", "flex-start", "flex-start")};
width: 100%;
- background-color: ${({ theme }) => theme.color.background01};
+ background-color: ${({ theme }) => theme.color.background15};
border-radius: 8px;
padding: 0 0 12px 0;
${media.mobile} {
diff --git a/packages/web/src/components/dashboard/tvl-chart-graph/TvlChartGraph.tsx b/packages/web/src/components/dashboard/tvl-chart-graph/TvlChartGraph.tsx
index 0982b51d7..91fa75e21 100644
--- a/packages/web/src/components/dashboard/tvl-chart-graph/TvlChartGraph.tsx
+++ b/packages/web/src/components/dashboard/tvl-chart-graph/TvlChartGraph.tsx
@@ -1,8 +1,10 @@
import LineGraph from "@components/common/line-graph/LineGraph";
import { useTheme } from "@emotion/react";
import useComponentSize from "@hooks/common/use-component-size";
-import React, { useCallback } from "react";
+import React, { useCallback, useMemo } from "react";
import { TvlChartGraphWrapper } from "./TvlChartGraph.styles";
+import { useWindowSize } from "@hooks/common/use-window-size";
+import { DEVICE_TYPE } from "@styles/media";
export interface TvlChartGraphProps {
datas: {
@@ -22,6 +24,7 @@ const TvlChartGraph: React.FC = ({
}) => {
const theme = useTheme();
const [componentRef, size] = useComponentSize();
+ const { breakpoint } = useWindowSize();
const getDatas = useCallback(() => {
return datas.map(data => ({
@@ -29,7 +32,12 @@ const TvlChartGraph: React.FC = ({
time: data.time,
}));
}, [datas]);
-
+
+ const countXAxis = useMemo(() => {
+ if (breakpoint !== DEVICE_TYPE.MOBILE)
+ return Math.floor((((size.width || 0) + 20) - 25) / 100);
+ return Math.floor((((size.width || 0) + 20) - 8) / 80);
+ }, [size.width, breakpoint]);
return (
@@ -38,15 +46,19 @@ const TvlChartGraph: React.FC = ({
cursor
className="graph"
width={size.width}
- height={size.height}
- color={theme.color.point}
+ height={size.height - 36}
+ color={theme.color.background04Hover}
strokeWidth={1}
datas={getDatas()}
typeOfChart="tvl"
+ customData={{
+ height: 36,
+ locationTooltip: 170,
+ }}
/>
- {xAxisLabels.map((label, index) => (
+ {xAxisLabels.slice(0, Math.min(countXAxis, 8)).map((label, index) => (
{label}
))}
diff --git a/packages/web/src/components/dashboard/tvl-chart/TvlChart.styles.ts b/packages/web/src/components/dashboard/tvl-chart/TvlChart.styles.ts
index adccc1830..712f9a76b 100644
--- a/packages/web/src/components/dashboard/tvl-chart/TvlChart.styles.ts
+++ b/packages/web/src/components/dashboard/tvl-chart/TvlChart.styles.ts
@@ -7,10 +7,10 @@ export const TvlChartWrapper = styled.div`
background-color: ${({ theme }) => theme.color.background06};
border: 1px solid ${({ theme }) => theme.color.border02};
border-radius: 8px;
- padding: 24px;
+ padding: 23px;
gap: 31px;
${media.mobile} {
- padding: 12px 24px 12px 12px;
+ padding: 11px 23px 11px 11px;
gap: 16px;
}
`;
@@ -23,3 +23,30 @@ export const ChartWrapper = styled.div`
gap: 12px;
}
`;
+
+export const LoadingTVLChart = styled.div`
+ ${mixins.flexbox("row", "center", "center")}
+ width: 100%;
+ height: 246px;
+ background-color: ${({ theme }) => theme.color.background15};
+ border-radius: 8px;
+ > div {
+ width: 60px;
+ height: 60px;
+ &::before {
+ width: 48px;
+ height: 48px;
+ }
+ &::after {
+ ${mixins.positionCenter()};
+ content: "";
+ border-radius: 50%;
+ width: 48px;
+ height: 48px;
+ background-color: ${({ theme }) => theme.color.background15};
+ }
+ }
+ ${media.mobile} {
+ height: 224px;
+ }
+`;
\ No newline at end of file
diff --git a/packages/web/src/components/dashboard/tvl-chart/TvlChart.tsx b/packages/web/src/components/dashboard/tvl-chart/TvlChart.tsx
index 8f1bc6fee..6b1d05e67 100644
--- a/packages/web/src/components/dashboard/tvl-chart/TvlChart.tsx
+++ b/packages/web/src/components/dashboard/tvl-chart/TvlChart.tsx
@@ -6,12 +6,14 @@ import {
import TvlChartGraph from "../tvl-chart-graph/TvlChartGraph";
import TvlChartPriceInfo from "../tvl-chart-price-info/TvlChartPriceInfo";
import TvlChartSelectTab from "../tvl-chart-select-tab/TvlChartSelectTab";
-import { ChartWrapper, TvlChartWrapper } from "./TvlChart.styles";
+import { ChartWrapper, LoadingTVLChart, TvlChartWrapper } from "./TvlChart.styles";
+import LoadingSpinner from "@components/common/loading-spinner/LoadingSpinner";
interface TvlChartItemProps {
tvlChartType: CHART_TYPE;
tvlPriceInfo: TvlPriceInfo;
tvlChartInfo: TvlChartInfo;
+ loading: boolean;
changeTvlChartType: (newType: string) => void;
}
@@ -20,6 +22,7 @@ const TvlChart: React.FC = ({
tvlPriceInfo,
tvlChartInfo,
changeTvlChartType,
+ loading,
}) => {
return (
@@ -29,10 +32,13 @@ const TvlChart: React.FC = ({
tvlChartType={tvlChartType}
changeTvlChartType={changeTvlChartType}
/>
-
+ />}
+ {loading &&
+
+ }
);
diff --git a/packages/web/src/components/dashboard/volume-chart-graph/VolumeChartGraph.styles.ts b/packages/web/src/components/dashboard/volume-chart-graph/VolumeChartGraph.styles.ts
index c1886767d..1fb0c25cc 100644
--- a/packages/web/src/components/dashboard/volume-chart-graph/VolumeChartGraph.styles.ts
+++ b/packages/web/src/components/dashboard/volume-chart-graph/VolumeChartGraph.styles.ts
@@ -6,7 +6,7 @@ import mixins from "@styles/mixins";
export const VolumeChartGraphWrapper = styled.div`
${mixins.flexbox("column", "flex-start", "flex-start")};
width: 100%;
- background-color: ${({ theme }) => theme.color.background01};
+ background-color: ${({ theme }) => theme.color.background15};
border-radius: 8px;
padding: 0 0 12px 0;
${media.mobile} {
@@ -21,7 +21,6 @@ export const VolumeChartGraphWrapper = styled.div`
}
.graph {
- cursor: pointer;
height: 204px;
border-bottom: 1px solid ${({ theme }) => theme.color.border02};
& svg {
diff --git a/packages/web/src/components/dashboard/volume-chart-graph/VolumeChartGraph.tsx b/packages/web/src/components/dashboard/volume-chart-graph/VolumeChartGraph.tsx
index 5bba4295e..06f54c2ad 100644
--- a/packages/web/src/components/dashboard/volume-chart-graph/VolumeChartGraph.tsx
+++ b/packages/web/src/components/dashboard/volume-chart-graph/VolumeChartGraph.tsx
@@ -1,20 +1,37 @@
import BarGraph from "@components/common/bar-graph/BarGraph";
import { useTheme } from "@emotion/react";
import useComponentSize from "@hooks/common/use-component-size";
-import React from "react";
+import React, { useMemo } from "react";
import { VolumeChartGraphWrapper } from "./VolumeChartGraph.styles";
+import { useWindowSize } from "@hooks/common/use-window-size";
+import { DEVICE_TYPE } from "@styles/media";
export interface VolumeChartGraphProps {
datas: string[];
+ times: string[];
xAxisLabels: string[];
}
const VolumeChartGraph: React.FC = ({
datas,
xAxisLabels,
+ times,
}) => {
const theme = useTheme();
const [componentRef, size] = useComponentSize();
+ const { breakpoint } = useWindowSize();
+
+ const countXAxis = useMemo(() => {
+ if (breakpoint !== DEVICE_TYPE.MOBILE)
+ return Math.floor((((size.width || 0) + 20) - 25) / 100);
+ return Math.floor((((size.width || 0) + 20) - 8) / 80);
+ }, [size.width, breakpoint]);
+
+ const minGap = useMemo(() => {
+ if (datas.length === 8) return 16;
+ if (datas.length === 31) return 6;
+ if (datas.length === 91) return 2;
+ }, [datas.length]);
return (
@@ -22,16 +39,23 @@ const VolumeChartGraph: React.FC = ({
- {xAxisLabels.map((label, index) => (
+ {xAxisLabels.slice(0, Math.min(countXAxis, 8)).map((label, index) => (
{label}
diff --git a/packages/web/src/components/dashboard/volume-chart/VolumeChart.stories.tsx b/packages/web/src/components/dashboard/volume-chart/VolumeChart.stories.tsx
index 6bb39af1e..028980b11 100644
--- a/packages/web/src/components/dashboard/volume-chart/VolumeChart.stories.tsx
+++ b/packages/web/src/components/dashboard/volume-chart/VolumeChart.stories.tsx
@@ -21,5 +21,6 @@ Default.args = {
volumeChartInfo: {
datas: Array.from({ length: 24 }, (_, index) => `${index + 1}`),
xAxisLabels: ["09:00", "12:00", "15:00", "18:00", "21:00", "24:00"],
+ times: [],
},
};
diff --git a/packages/web/src/components/dashboard/volume-chart/VolumeChart.styles.ts b/packages/web/src/components/dashboard/volume-chart/VolumeChart.styles.ts
index 5dfc28e3c..8dd1b457a 100644
--- a/packages/web/src/components/dashboard/volume-chart/VolumeChart.styles.ts
+++ b/packages/web/src/components/dashboard/volume-chart/VolumeChart.styles.ts
@@ -7,9 +7,9 @@ export const VolumeChartWrapper = styled.div`
background-color: ${({ theme }) => theme.color.background06};
border: 1px solid ${({ theme }) => theme.color.border02};
border-radius: 8px;
- padding: 24px;
+ padding: 23px;
${media.mobile} {
- padding: 12px 12px 12px 12px;
+ padding: 11px 11px 11px 11px;
}
`;
@@ -21,3 +21,31 @@ export const ChartWrapper = styled.div`
gap: 12px;
}
`;
+
+export const LoadingVolumnChart = styled.div`
+ ${mixins.flexbox("row", "center", "center")}
+ width: 100%;
+ height: 246px;
+ background-color: ${({ theme }) => theme.color.background15};
+ border-radius: 8px;
+ > div {
+ width: 60px;
+ height: 60px;
+ &::before {
+ width: 48px;
+ height: 48px;
+ background-color: ${({ theme }) => theme.color.background01};
+ }
+ &::after {
+ ${mixins.positionCenter()};
+ content: "";
+ border-radius: 50%;
+ width: 48px;
+ height: 48px;
+ background-color: ${({ theme }) => theme.color.background15};
+ }
+ }
+ ${media.mobile} {
+ height: 224px;
+ }
+`;
\ No newline at end of file
diff --git a/packages/web/src/components/dashboard/volume-chart/VolumeChart.tsx b/packages/web/src/components/dashboard/volume-chart/VolumeChart.tsx
index 3293d393c..d0a0da159 100644
--- a/packages/web/src/components/dashboard/volume-chart/VolumeChart.tsx
+++ b/packages/web/src/components/dashboard/volume-chart/VolumeChart.tsx
@@ -6,14 +6,16 @@ import {
} from "@containers/volume-chart-container/VolumeChartContainer";
import VolumeChartPriceInfo from "../volume-chart-price-info/VolumeChartPriceInfo";
import VolumeChartSelectTab from "../volume-chart-select-tab/VolumeChartSelectTab";
-import { VolumeChartWrapper, ChartWrapper } from "./VolumeChart.styles";
+import { VolumeChartWrapper, ChartWrapper, LoadingVolumnChart } from "./VolumeChart.styles";
import VolumeChartGraph from "../volume-chart-graph/VolumeChartGraph";
+import LoadingSpinner from "@components/common/loading-spinner/LoadingSpinner";
interface VolumeChartItemProps {
volumeChartType: CHART_TYPE;
changeVolumeChartType: (newType: string) => void;
volumePriceInfo: VolumePriceInfo;
volumeChartInfo: VolumeChartInfo;
+ loading: boolean;
}
const VolumeChart: React.FC
= ({
@@ -21,6 +23,7 @@ const VolumeChart: React.FC = ({
changeVolumeChartType,
volumePriceInfo,
volumeChartInfo,
+ loading,
}) => (
@@ -29,10 +32,14 @@ const VolumeChart: React.FC = ({
volumeChartType={volumeChartType}
changeVolumeChartType={changeVolumeChartType}
/>
-
+ times={volumeChartInfo.times}
+ />}
+ {loading &&
+
+ }
);
diff --git a/packages/web/src/components/earn-add/earn-add-liquidity/EarnAddLiquidity.tsx b/packages/web/src/components/earn-add/earn-add-liquidity/EarnAddLiquidity.tsx
index 27ca78f80..39efcef5a 100644
--- a/packages/web/src/components/earn-add/earn-add-liquidity/EarnAddLiquidity.tsx
+++ b/packages/web/src/components/earn-add/earn-add-liquidity/EarnAddLiquidity.tsx
@@ -43,7 +43,7 @@ interface EarnAddLiquidityProps {
submit: () => void;
isEarnAdd: boolean;
connected: boolean;
- slippage: number;
+ slippage: string;
changeSlippage: (value: string) => void;
handleClickOneStaking?: () => void;
openModal: () => void;
diff --git a/packages/web/src/components/earn/earn-my-positions-header/EarnMyPositionsHeader.tsx b/packages/web/src/components/earn/earn-my-positions-header/EarnMyPositionsHeader.tsx
index 4eaa4f4f0..c7cd38f2e 100644
--- a/packages/web/src/components/earn/earn-my-positions-header/EarnMyPositionsHeader.tsx
+++ b/packages/web/src/components/earn/earn-my-positions-header/EarnMyPositionsHeader.tsx
@@ -4,19 +4,21 @@ import { PositionsWrapper } from "./EarnMyPositionsHeader.styles";
export interface EarnMyPositionsHeaderProps {
connected: boolean;
+ isSwitchNetwork: boolean;
moveEarnAdd: () => void;
moveEarnStake: () => void;
}
const EarnMyPositionsHeader: React.FC = ({
connected,
+ isSwitchNetwork,
moveEarnAdd,
moveEarnStake,
}) => {
const disabledNewPosition = useMemo(() => {
- return !connected;
- }, [connected]);
+ return !connected || isSwitchNetwork;
+ }, [connected, isSwitchNetwork]);
const onClickNewPosition = useCallback(() => {
moveEarnAdd();
diff --git a/packages/web/src/components/earn/earn-my-positions-no-liquidity/EarnMyPositionNoLiquidity.tsx b/packages/web/src/components/earn/earn-my-positions-no-liquidity/EarnMyPositionNoLiquidity.tsx
index 4360cbb32..f7c4ad1f4 100644
--- a/packages/web/src/components/earn/earn-my-positions-no-liquidity/EarnMyPositionNoLiquidity.tsx
+++ b/packages/web/src/components/earn/earn-my-positions-no-liquidity/EarnMyPositionNoLiquidity.tsx
@@ -19,7 +19,7 @@ const EarnMyPositionNoLiquidity: React.FC<
Add liquidity to Gnoswap’s pools to earn trading fees on every swap. You
- may also stake LP tokens to earn GNOS token rewards.
+ may also stake LP tokens to earn GNS token rewards.
);
diff --git a/packages/web/src/components/earn/earn-my-positions/EarnMyPositions.tsx b/packages/web/src/components/earn/earn-my-positions/EarnMyPositions.tsx
index 3e10d83e6..6de428b97 100644
--- a/packages/web/src/components/earn/earn-my-positions/EarnMyPositions.tsx
+++ b/packages/web/src/components/earn/earn-my-positions/EarnMyPositions.tsx
@@ -44,6 +44,7 @@ const EarnMyPositions: React.FC = ({
connected={connected}
moveEarnAdd={moveEarnAdd}
moveEarnStake={moveEarnStake}
+ isSwitchNetwork={isSwitchNetwork}
/>
= ({
@@ -99,20 +101,7 @@ const CreateProposalModal: React.FC = ({
}
};
- useEffect(() => {
- const closeModal = (e: MouseEvent) => {
- if (modalRef.current && modalRef.current.contains(e.target as Node)) {
- return;
- } else {
- e.stopPropagation();
- setIsShowCreateProposal(true);
- }
- };
- window.addEventListener("click", closeModal, true);
- return () => {
- window.removeEventListener("click", closeModal, true);
- };
- }, [modalRef, setIsShowCreateProposal]);
+ useEscCloseModal(() => setIsShowCreateProposal(false));
useEffect(() => {
handleResize();
@@ -181,151 +170,154 @@ const CreateProposalModal: React.FC = ({
}, [isDirty, isValid, errors]);
return (
-
- {}}>
-
-
-
-
Create Proposal
-
setIsShowCreateProposal(false)}
- >
-
-
-
-
-
- {ProposalOption.map((item, index) => (
-
setType(ProposalOption[index])}
- >
- {ProposalOption[index]}
-
- ))}
+ <>
+
+ {}}>
+
+
+
+
Create Proposal
+
setIsShowCreateProposal(false)}
+ >
+
+
-
-
-
-
-
- {type === ProposalOption[1] && (
-
+
+
+ {ProposalOption.map((item, index) => (
+
setType(ProposalOption[index])}
+ >
+ {ProposalOption[index]}
+
+ ))}
+
+
+
+
-
+
+ {type === ProposalOption[1] && (
+
-
-
-
{TOKEN.currency}
+
+
+
+
+
{TOKEN.currency}
+
-
-
- )}
- {type === ProposalOption[2] && (
-
- {fields.map((item, index) => (
-
-
-
+
+ )}
+ {type === ProposalOption[2] && (
+
+ {fields.map((item, index) => (
+
+
+
-
-
+
+
+
+
handleClickFormFieldArray(index)}
+ >
+ {index === fields.length - 1 ? (
+
+ ) : (
+
+ )}
+
+
+ ))}
+
+ )}
+
+
+
+
+
+
{TOKEN.currency}
-
handleClickFormFieldArray(index)}
- >
- {index === fields.length - 1 ? (
-
- ) : (
-
- )}
-
-
- ))}
-
- )}
-
-
-
-
-
-
{TOKEN.currency}
+
{TOKEN.value}
-
{TOKEN.value}
-
-
-
-
-
-
-
+
+
+
+
+
+
+
setIsShowCreateProposal(false)}/>
+ >
);
};
diff --git a/packages/web/src/components/governance/governance-detail/GovernanceDetail.tsx b/packages/web/src/components/governance/governance-detail/GovernanceDetail.tsx
index 237aacb88..c48403dda 100644
--- a/packages/web/src/components/governance/governance-detail/GovernanceDetail.tsx
+++ b/packages/web/src/components/governance/governance-detail/GovernanceDetail.tsx
@@ -11,10 +11,10 @@ const GovernanceDetail: React.FC = ({
}) => (
@@ -22,9 +22,9 @@ const GovernanceDetail: React.FC = ({
title={"Community Pool"}
value={governanceDetailInfo.communityPool}
tooltip={
- "Amount of GNOS accumulated in the Community Pool from Emissions."
+ "Amount of GNS accumulated in the Community Pool from Emissions."
}
- currency="GNOS"
+ currency="GNS"
/>
- Stake liquidity from GNOT-GNOS pools to earn xGNOS,
+ Stake liquidity from GNOT-GNS pools to earn xGNOS,
which represent your voting shares in the Gnoswap Governance.
>
@@ -91,20 +93,7 @@ const LearnMoreModal: React.FC = ({ setIsShowLearnMoreModal }) => {
}
};
- useEffect(() => {
- const closeModal = (e: MouseEvent) => {
- if (modalRef.current && modalRef.current.contains(e.target as Node)) {
- return;
- } else {
- e.stopPropagation();
- setIsShowLearnMoreModal(false);
- }
- };
- window.addEventListener("click", closeModal, true);
- return () => {
- window.removeEventListener("click", closeModal, true);
- };
- }, [modalRef, setIsShowLearnMoreModal]);
+ useEscCloseModal(() => setIsShowLearnMoreModal(false));
useEffect(() => {
handleResize();
@@ -115,65 +104,68 @@ const LearnMoreModal: React.FC = ({ setIsShowLearnMoreModal }) => {
}, [modalRef]);
return (
-
-
-
-
- e.preventDefault()}>
- {LEARN_MORE_DATA[index].title}
- {LEARN_MORE_DATA[index].description}
-
-
- e.preventDefault()}
- onMouseDown={e => e.preventDefault()}
- draggable="false"
- src={
- themeKey === "dark"
- ? LEARN_MORE_DATA[index].darkImageUrl
- : LEARN_MORE_DATA[index].lightImageURL
- }
- alt="logo img"
- />
-
- setIndex(
- index < LEARN_MORE_DATA.length - 1
- ? index + 1
- : LEARN_MORE_DATA.length - 1,
- )
- }
- className={`slide-icon right-icon ${
- index < LEARN_MORE_DATA.length - 1 ? "active-icon" : ""
- }`}
- />
- setIndex(index > 0 ? index - 1 : 0)}
- className={`slide-icon left-icon ${
- index > 0 ? "active-icon" : ""
- }`}
- />
-
-
-
-
+ <>
+
+
+
+
+ e.preventDefault()}>
+ {LEARN_MORE_DATA[index].title}
+ {LEARN_MORE_DATA[index].description}
+
+
+ e.preventDefault()}
+ onMouseDown={e => e.preventDefault()}
+ draggable="false"
+ src={
+ themeKey === "dark"
+ ? LEARN_MORE_DATA[index].darkImageUrl
+ : LEARN_MORE_DATA[index].lightImageURL
+ }
+ alt="logo img"
+ />
+
+ setIndex(
+ index < LEARN_MORE_DATA.length - 1
+ ? index + 1
+ : LEARN_MORE_DATA.length - 1,
+ )
+ }
+ className={`slide-icon right-icon ${
+ index < LEARN_MORE_DATA.length - 1 ? "active-icon" : ""
+ }`}
+ />
+ setIndex(index > 0 ? index - 1 : 0)}
+ className={`slide-icon left-icon ${
+ index > 0 ? "active-icon" : ""
+ }`}
+ />
+
+
+
+
+ setIsShowLearnMoreModal(false)}/>
+ >
);
};
diff --git a/packages/web/src/components/governance/proposals-list/ProposalList.tsx b/packages/web/src/components/governance/proposals-list/ProposalList.tsx
index 582d59f39..520bb87e6 100644
--- a/packages/web/src/components/governance/proposals-list/ProposalList.tsx
+++ b/packages/web/src/components/governance/proposals-list/ProposalList.tsx
@@ -19,6 +19,7 @@ interface ProposalListProps {
setIsShowCreateProposal: Dispatch>;
isConnected: boolean;
isSwitchNetwork: boolean;
+ handleSelectVote: () => void;
}
const ProposalList: React.FC = ({
@@ -34,6 +35,7 @@ const ProposalList: React.FC = ({
setIsShowCreateProposal,
isConnected,
isSwitchNetwork,
+ handleSelectVote,
}) => (
= ({
breakpoint={breakpoint}
proposalDetail={proposalDetail}
setIsShowProposalModal={setIsShowProposalModal}
+ isConnected={isConnected}
+ isSwitchNetwork={isSwitchNetwork}
+ handleSelectVote={handleSelectVote}
/>
)}
{isShowCreateProposal && (
diff --git a/packages/web/src/components/governance/view-proposal-modal/ViewProposalModal.styles.ts b/packages/web/src/components/governance/view-proposal-modal/ViewProposalModal.styles.ts
index 9f708f00a..1684536d4 100644
--- a/packages/web/src/components/governance/view-proposal-modal/ViewProposalModal.styles.ts
+++ b/packages/web/src/components/governance/view-proposal-modal/ViewProposalModal.styles.ts
@@ -13,11 +13,12 @@ export const ViewProposalModalBackground = styled.div`
right: 0px;
width: 100%;
height: 100lvh;
- background: rgba(10, 14, 23, 0.7);
- z-index: ${Z_INDEX.modalOverlay};
+ z-index: ${Z_INDEX.modal};
+ pointer-events: none;
`;
export const ViewProposalModalWrapper = styled.div`
+ pointer-events: initial;
position: absolute;
overflow: hidden;
width: 700px;
@@ -260,7 +261,7 @@ export const BoxQuorumWrapper = styled.div`
color: ${({ theme }) => theme.color.text10};
${fonts.body12}
}
- > div {
+ > div:first-of-type {
${fonts.body4}
color: ${({ theme }) => theme.color.text02};
}
diff --git a/packages/web/src/components/governance/view-proposal-modal/ViewProposalModal.tsx b/packages/web/src/components/governance/view-proposal-modal/ViewProposalModal.tsx
index c892cc477..a330ed7b8 100644
--- a/packages/web/src/components/governance/view-proposal-modal/ViewProposalModal.tsx
+++ b/packages/web/src/components/governance/view-proposal-modal/ViewProposalModal.tsx
@@ -32,6 +32,8 @@ import {
} from "./ViewProposalModal.styles";
import dayjs from "dayjs";
import relative from "dayjs/plugin/relativeTime";
+import { Overlay } from "@components/common/modal/Modal.styles";
+import useEscCloseModal from "@hooks/common/use-esc-close-modal";
dayjs.extend(relative);
@@ -39,6 +41,9 @@ interface Props {
breakpoint: DEVICE_TYPE;
proposalDetail: ProposalDetailProps;
setIsShowProposalModal: Dispatch>;
+ isConnected: boolean;
+ isSwitchNetwork: boolean;
+ handleSelectVote: () => void;
}
type OptionVote = "YES" | "NO" | "ABSTAIN" | "";
@@ -161,6 +166,9 @@ const ViewProposalModal: React.FC = ({
breakpoint,
proposalDetail,
setIsShowProposalModal,
+ isSwitchNetwork,
+ isConnected,
+ handleSelectVote,
}) => {
const [optionVote, setOptionVote] = useState("");
@@ -179,20 +187,7 @@ const ViewProposalModal: React.FC = ({
}
};
- useEffect(() => {
- const closeModal = (e: MouseEvent) => {
- if (modalRef.current && modalRef.current.contains(e.target as Node)) {
- return;
- } else {
- e.stopPropagation();
- setIsShowProposalModal(true);
- }
- };
- window.addEventListener("click", closeModal, true);
- return () => {
- window.removeEventListener("click", closeModal, true);
- };
- }, [modalRef, setIsShowProposalModal]);
+ useEscCloseModal(() => setIsShowProposalModal(false));
useEffect(() => {
handleResize();
@@ -202,130 +197,152 @@ const ViewProposalModal: React.FC = ({
};
}, [modalRef]);
- const handleSelectVoting = useCallback(() => {}, [optionVote]);
+ const handleSelectVoting = useCallback(() => {
+ handleSelectVote();
+ }, [optionVote, handleSelectVote]);
+
+ const disableButton = useMemo(() => {
+ if (!isConnected) {
+ return false;
+ }
+ if (isSwitchNetwork) {
+ return false;
+ }
+ return optionVote === "";
+ },[isConnected, isSwitchNetwork, optionVote]);
+
+ const textButton = useMemo(() => {
+ if (!isConnected) {
+ return "Wallet Login";
+ }
+ if (isSwitchNetwork) {
+ return "Switch to Gnoland";
+ }
+ return proposalDetail.typeVote
+ ? "Already Vote"
+ : optionVote === ""
+ ? "Select Voting Option"
+ : "Vote";
+ },[isConnected, isSwitchNetwork, proposalDetail, optionVote]);
if (!proposalDetail) return null;
return (
-
-
-
-
-
-
- {proposalDetail.title}
- {breakpoint !== DEVICE_TYPE.MOBILE && (
-
- )}
-
-
setIsShowProposalModal(false)}
- >
-
+ <>
+
+
+
+
+
+
+ {proposalDetail.title}
+ {breakpoint !== DEVICE_TYPE.MOBILE && (
+
+ )}
+
+
setIsShowProposalModal(false)}
+ >
+
+
-
- {breakpoint === DEVICE_TYPE.MOBILE && (
-
- )}
-
- {MAPPING_STATUS[proposalDetail.status]}
-
-
{" "}
- {`Voting ${
- proposalDetail.status === "ACTIVE" ? "Ends in" : "Ended1"
- } ${dayjs(proposalDetail.timeEnd).fromNow()} `}
-
- {proposalDetail.timeEnd}
+ {breakpoint === DEVICE_TYPE.MOBILE && (
+
+ )}
+
+ {MAPPING_STATUS[proposalDetail.status]}
+
+ {" "}
+ {`Voting ${
+ proposalDetail.status === "ACTIVE" ? "Ends in" : "Ended1"
+ } ${dayjs(proposalDetail.timeEnd).fromNow()} `}
+
+ {proposalDetail.timeEnd}
+
-
-
-
-
-
Quorum
-
-
{proposalDetail.currentValue.toLocaleString()}/
-
{proposalDetail.maxValue.toLocaleString()}
+
+
+
+
Quorum
+
+
{proposalDetail.currentValue.toLocaleString()}/
+
{proposalDetail.maxValue.toLocaleString()}
+
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
- {proposalDetail.status === "ACTIVE" && (
-
-
-
+
+ {proposalDetail.status === "ACTIVE" && (
+
+ )}
+
+
+
+
+
setIsShowProposalModal(false)}/>
+ >
);
};
diff --git a/packages/web/src/components/home/banner/Banner.styled.ts b/packages/web/src/components/home/banner/Banner.styled.ts
index b5a2d8625..291c81638 100644
--- a/packages/web/src/components/home/banner/Banner.styled.ts
+++ b/packages/web/src/components/home/banner/Banner.styled.ts
@@ -61,11 +61,14 @@ export const BannerContent = styled.div`
height: 20px;
}
svg * {
- fill: ${({ theme }) => theme.color.text01};
+ fill: ${({ theme }) => theme.color.border07};
}
&:hover {
+ span {
+ color: #C3D2EA;
+ }
svg * {
- fill: ${({ theme }) => theme.color.text01};
+ fill: #C3D2EA !important;
}
background-color: ${({ theme }) => theme.color.background04Hover};
}
diff --git a/packages/web/src/components/home/banner/Banner.tsx b/packages/web/src/components/home/banner/Banner.tsx
index 98c5f71ea..0dfdb20a5 100644
--- a/packages/web/src/components/home/banner/Banner.tsx
+++ b/packages/web/src/components/home/banner/Banner.tsx
@@ -17,7 +17,7 @@ const Banner: React.FC = () => {
bgColor: "background04",
fontType: "body11",
padding: "16px 40px",
- textColor: "text09",
+ textColor: "border07",
}}
className="banner-button"
/>
diff --git a/packages/web/src/components/home/card-list/CardList.tsx b/packages/web/src/components/home/card-list/CardList.tsx
index a91024395..4fe9256b9 100644
--- a/packages/web/src/components/home/card-list/CardList.tsx
+++ b/packages/web/src/components/home/card-list/CardList.tsx
@@ -121,8 +121,8 @@ const CardListTokenItem: React.FC = ({ index, item, onCl
}, [item.upDown]);
const onClick = useCallback(() => {
- onClickItem(item.token.path);
- }, [onClickItem, item.token.path]);
+ onClickItem(item.token.symbol + `?tokenB=${item.token.path}&direction=EXACT_IN`);
+ }, [onClickItem, item.token.symbol]);
return (
diff --git a/packages/web/src/components/home/gnoswap-brand/GnoswapBrand.styles.ts b/packages/web/src/components/home/gnoswap-brand/GnoswapBrand.styles.ts
index 2479ccd0e..12acc1197 100644
--- a/packages/web/src/components/home/gnoswap-brand/GnoswapBrand.styles.ts
+++ b/packages/web/src/components/home/gnoswap-brand/GnoswapBrand.styles.ts
@@ -16,6 +16,7 @@ export const GnoswapBrandWrapper = styled.div`
max-width: 328px;
align-items: center;
gap: 32px;
+ padding: 10px 0 0 0;
}
.sns {
diff --git a/packages/web/src/components/home/highest-aprs-card-list/HighestAprsCardList.styles.ts b/packages/web/src/components/home/highest-aprs-card-list/HighestAprsCardList.styles.ts
index 48183fe62..8bb122489 100644
--- a/packages/web/src/components/home/highest-aprs-card-list/HighestAprsCardList.styles.ts
+++ b/packages/web/src/components/home/highest-aprs-card-list/HighestAprsCardList.styles.ts
@@ -8,18 +8,26 @@ interface SkeletonStyleProps {
tdWidth?: CSSProperties["width"];
}
-export const HighestAprsCardListwrapper = styled.div`
+interface Props {
+ loading: boolean;
+}
+
+export const HighestAprsCardListwrapper = styled.div`
${mixins.flexbox("column", "flex-start", "center")}
width: 100%;
background-color: ${({ theme }) => theme.color.background06};
border: 1px solid ${({ theme }) => theme.color.border02};
box-shadow: 8px 8px 20px 0px rgba(0, 0, 0, 0.08);
border-radius: 10px;
- padding: 16px 0px 12px;
- gap: 12px;
+ padding: ${({ loading }) => {
+ return loading ? "15px 0px 15px" : "15px 0px 11px";
+ }};
+ gap: ${({ loading }) => {
+ return loading ? "8px" : "12px";
+ }};
${media.mobile} {
- padding: 16px 0px;
+ padding: 15px 0px;
gap: 16px;
}
h2 {
@@ -43,22 +51,9 @@ export const HighestAprsCardListwrapper = styled.div`
export const SkeletonItem = styled.div`
width: ${({ tdWidth }) => `${tdWidth}`};
height: 100%;
- padding: 8px 24px;
+ padding: 4px 24px;
${mixins.flexbox("row", "center", "flex-start")};
-`;
-
-export const LoadingWrapper = styled.div`
- ${mixins.flexbox("column", "flex-start", "flex-start")}
- width: 100%;
- background-color: ${({ theme }) => theme.color.background06};
- border: 1px solid ${({ theme }) => theme.color.border02};
- box-shadow: 8px 8px 20px 0px rgba(0, 0, 0, 0.08);
- border-radius: 10px;
- padding: 16px 0px 12px;
- & > div:first-of-type {
- padding: 0 24px 13px 24px;
+ &:first-of-type {
+ padding: 0px 24px 5px 24px;
}
- ${media.mobile} {
- padding: 16px 0px;
- }
-`;
\ No newline at end of file
+`;
diff --git a/packages/web/src/components/home/highest-aprs-card-list/HighestAprsCardList.tsx b/packages/web/src/components/home/highest-aprs-card-list/HighestAprsCardList.tsx
index 697c5a922..042051dae 100644
--- a/packages/web/src/components/home/highest-aprs-card-list/HighestAprsCardList.tsx
+++ b/packages/web/src/components/home/highest-aprs-card-list/HighestAprsCardList.tsx
@@ -1,10 +1,16 @@
import React, { useMemo } from "react";
import CardList from "@components/home/card-list/CardList";
-import { HighestAprsCardListwrapper, LoadingWrapper, SkeletonItem } from "./HighestAprsCardList.styles";
+import {
+ HighestAprsCardListwrapper,
+ SkeletonItem,
+} from "./HighestAprsCardList.styles";
import IconDiamond from "@components/common/icons/IconDiamond";
import { DEVICE_TYPE } from "@styles/media";
import { CardListPoolInfo } from "@models/common/card-list-item-info";
-import { SHAPE_TYPES, skeletonTrendingStyle } from "@constants/skeleton.constant";
+import {
+ SHAPE_TYPES,
+ skeletonTrendingStyle,
+} from "@constants/skeleton.constant";
interface HighestAprsCardListProps {
list: Array;
@@ -23,29 +29,42 @@ const HighestAprsCardList: React.FC = ({
return device !== DEVICE_TYPE.MOBILE;
}, [device]);
- if (loading) {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-
return visible ? (
-
-
- Highest APRs
-
-
+
+ {loading ? (
+
+
+
+ ) : (
+
+
+ Highest APRs
+
+
+ )}
+ {loading ? (
+ <>
+
+
+
+
+
+
+
+
+
+ >
+ ) : (
+
+ )}
) : null;
};
diff --git a/packages/web/src/components/home/home-swap/HomeSwap.stories.tsx b/packages/web/src/components/home/home-swap/HomeSwap.stories.tsx
index e5045e708..2e681776e 100644
--- a/packages/web/src/components/home/home-swap/HomeSwap.stories.tsx
+++ b/packages/web/src/components/home/home-swap/HomeSwap.stories.tsx
@@ -47,7 +47,7 @@ Default.args = {
tokenBUSD: 0,
tokenBUSDStr: "0",
direction: "EXACT_IN",
- slippage: 0,
+ slippage: "0",
},
swapNow: action("swapNow"),
};
diff --git a/packages/web/src/components/home/home-swap/HomeSwap.styles.ts b/packages/web/src/components/home/home-swap/HomeSwap.styles.ts
index 018999f68..b4c9985c1 100644
--- a/packages/web/src/components/home/home-swap/HomeSwap.styles.ts
+++ b/packages/web/src/components/home/home-swap/HomeSwap.styles.ts
@@ -36,11 +36,14 @@ export const wrapper = (theme: Theme) => css`
width: 100%;
height: 100%;
position: relative;
+
.from,
.to {
${mixins.flexbox("row", "center", "space-between")};
flex-wrap: wrap;
-
+ &:focus-within {
+ border: 1px solid ${theme.color.border15};
+ }
width: 100%;
padding: 9px 23px;
@@ -56,11 +59,13 @@ export const wrapper = (theme: Theme) => css`
}
.token {
- width: 112px;
- height: 30px;
cursor: default;
+ > div {
+ padding: 5px 12px 5px 6px;
+ height: 34px;
+ }
span {
- font-size: 15px;
+ font-size: 16px;
line-height: 19px;
}
}
@@ -77,12 +82,15 @@ export const wrapper = (theme: Theme) => css`
line-height: 38px;
color: ${theme.color.text01};
margin-right: 30px;
+ &::placeholder {
+ color: ${theme.color.text01};
+ }
}
.price-text,
.balance-text {
${fonts.p2};
- color: ${theme.color.text10};
+ color: ${theme.color.text04};
}
.token {
diff --git a/packages/web/src/components/home/home-swap/HomeSwap.tsx b/packages/web/src/components/home/home-swap/HomeSwap.tsx
index 37d5b5ca5..524b471f2 100644
--- a/packages/web/src/components/home/home-swap/HomeSwap.tsx
+++ b/packages/web/src/components/home/home-swap/HomeSwap.tsx
@@ -7,6 +7,7 @@ import { SwapTokenInfo } from "@models/swap/swap-token-info";
import { useWindowSize } from "@hooks/common/use-window-size";
interface HomeSwapProps {
+ changeTokenAAmount: (value: string) => void;
swapTokenInfo: SwapTokenInfo;
swapNow: () => void;
onSubmitSwapValue: () => void;
@@ -17,7 +18,7 @@ function isAmount(str: string) {
return regex.test(str);
}
-const HomeSwap: React.FC = ({ swapTokenInfo, swapNow, onSubmitSwapValue }) => {
+const HomeSwap: React.FC = ({ swapTokenInfo, swapNow, onSubmitSwapValue, changeTokenAAmount}) => {
const { breakpoint } = useWindowSize();
const [fromAmount, setFromAmount] = useState("0");
const [toAmount, setToAmount] = useState("0");
@@ -27,7 +28,9 @@ const HomeSwap: React.FC = ({ swapTokenInfo, swapNow, onSubmitSwa
const value = e.target.value;
if (value !== "" && !isAmount(value)) return;
- setFromAmount(value);
+ const temp = value.replace(/^0+(?=\d)|(\.\d*)$/g, "$1");
+ setFromAmount(temp);
+ changeTokenAAmount(temp);
// TODO
// - mapT0AmountToT0Price
// - mapT0AmpuntT1Amount
@@ -41,7 +44,7 @@ const HomeSwap: React.FC = ({ swapTokenInfo, swapNow, onSubmitSwa
const value = e.target.value;
if (value !== "" && !isAmount(value)) return;
- setToAmount(value);
+ setToAmount(value.replace(/^0+(?=\d)|(\.\d*)$/g, "$1"));
// TODO
// - mapT1AmountToT1Price
// - mapT1AmpuntT0Amount
diff --git a/packages/web/src/components/home/recently-added-card-list/RecentlyAddedCardList.styles.ts b/packages/web/src/components/home/recently-added-card-list/RecentlyAddedCardList.styles.ts
index d585e7fc7..e347a47ab 100644
--- a/packages/web/src/components/home/recently-added-card-list/RecentlyAddedCardList.styles.ts
+++ b/packages/web/src/components/home/recently-added-card-list/RecentlyAddedCardList.styles.ts
@@ -7,18 +7,26 @@ interface SkeletonStyleProps {
tdWidth?: CSSProperties["width"];
}
-export const RecentlyAddedCardListwrapper = styled.div`
+interface Props {
+ loading: boolean;
+}
+
+export const RecentlyAddedCardListwrapper = styled.div`
${mixins.flexbox("column", "flex-start", "center")}
width: 100%;
background-color: ${({ theme }) => theme.color.background06};
border: 1px solid ${({ theme }) => theme.color.border02};
box-shadow: 8px 8px 20px 0px rgba(0, 0, 0, 0.08);
border-radius: 10px;
- padding: 16px 0px 12px;
- gap: 12px;
+ padding: ${({ loading }) => {
+ return loading ? "15px 0px 15px" : "15px 0px 11px";
+ }};
+ gap: ${({ loading }) => {
+ return loading ? "8px" : "12px";
+ }};
${media.mobile} {
- padding: 16px 0px;
+ padding: 15px 0px;
gap: 16px;
}
h2 {
@@ -42,23 +50,9 @@ export const RecentlyAddedCardListwrapper = styled.div`
export const SkeletonItem = styled.div`
width: ${({ tdWidth }) => `${tdWidth}`};
height: 100%;
- padding: 8px 24px;
+ padding: 4px 24px;
${mixins.flexbox("row", "center", "flex-start")};
-`;
-
-
-export const LoadingWrapper = styled.div`
- ${mixins.flexbox("column", "flex-start", "flex-start")}
- width: 100%;
- background-color: ${({ theme }) => theme.color.background06};
- border: 1px solid ${({ theme }) => theme.color.border02};
- box-shadow: 8px 8px 20px 0px rgba(0, 0, 0, 0.08);
- border-radius: 10px;
- padding: 16px 0px 12px;
- & > div:first-of-type {
- padding: 0 24px 13px 24px;
+ &:first-of-type {
+ padding: 0px 24px 5px 24px;
}
- ${media.mobile} {
- padding: 16px 0px;
- }
-`;
\ No newline at end of file
+`;
diff --git a/packages/web/src/components/home/recently-added-card-list/RecentlyAddedCardList.tsx b/packages/web/src/components/home/recently-added-card-list/RecentlyAddedCardList.tsx
index 286b06fbd..31e7185d4 100644
--- a/packages/web/src/components/home/recently-added-card-list/RecentlyAddedCardList.tsx
+++ b/packages/web/src/components/home/recently-added-card-list/RecentlyAddedCardList.tsx
@@ -1,10 +1,16 @@
import React, { useMemo } from "react";
import CardList from "@components/home/card-list/CardList";
-import { LoadingWrapper, RecentlyAddedCardListwrapper, SkeletonItem } from "./RecentlyAddedCardList.styles";
+import {
+ RecentlyAddedCardListwrapper,
+ SkeletonItem,
+} from "./RecentlyAddedCardList.styles";
import IconClock from "@components/common/icons/IconClock";
import { DEVICE_TYPE } from "@styles/media";
import { CardListTokenInfo } from "@models/common/card-list-item-info";
-import { SHAPE_TYPES, skeletonTrendingStyle } from "@constants/skeleton.constant";
+import {
+ SHAPE_TYPES,
+ skeletonTrendingStyle,
+} from "@constants/skeleton.constant";
interface RecentlyAddedCardListProps {
list: Array;
device: DEVICE_TYPE;
@@ -22,28 +28,42 @@ const RecentlyAddedCardList: React.FC = ({
return device !== DEVICE_TYPE.MOBILE;
}, [device]);
- if (loading) {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
return visible ? (
-
-
- New Listings
-
-
+
+ {loading ? (
+
+
+
+ ) : (
+
+
+ New Listings
+
+
+ )}
+ {loading ? (
+ <>
+
+
+
+
+
+
+
+
+
+ >
+ ) : (
+
+ )}
) : null;
};
diff --git a/packages/web/src/components/home/token-info/TokenInfo.tsx b/packages/web/src/components/home/token-info/TokenInfo.tsx
index 8a6b31850..d89a86a42 100644
--- a/packages/web/src/components/home/token-info/TokenInfo.tsx
+++ b/packages/web/src/components/home/token-info/TokenInfo.tsx
@@ -48,7 +48,9 @@ const TokenInfo: React.FC = ({ item, idx }) => {
} = item;
const onClickItem = (symbol: string) => {
- location.href = "/tokens/" + symbol;
+ console.log(symbol);
+
+ location.href = "/tokens/" + "FOO" + "?tokenB=gno.land/r/foo&direction=EXACT_IN";
};
return (
diff --git a/packages/web/src/components/home/token-list-header/TokenListHeader.styles.ts b/packages/web/src/components/home/token-list-header/TokenListHeader.styles.ts
index a36849747..32a212076 100644
--- a/packages/web/src/components/home/token-list-header/TokenListHeader.styles.ts
+++ b/packages/web/src/components/home/token-list-header/TokenListHeader.styles.ts
@@ -41,16 +41,20 @@ export const TokenTitleWrapper = styled.div`
}
}
- .search-icon {
- width: 24px;
- height: 24px;
- * {
- fill: ${({ theme }) => theme.color.icon08};
+ .icon-wrap {
+ height: 100%;
+ .search-icon {
+ width: 24px;
+ height: 24px;
+ margin-right: 13px;
+ * {
+ fill: ${({ theme }) => theme.color.icon08};
+ }
}
- }
- .search-icon:hover {
- * {
- fill: ${({ theme }) => theme.color.icon02};
+ .search-icon:hover {
+ * {
+ fill: ${({ theme }) => theme.color.icon02};
+ }
}
}
`;
diff --git a/packages/web/src/components/home/token-list-header/TokenListHeader.tsx b/packages/web/src/components/home/token-list-header/TokenListHeader.tsx
index 535864b9e..037e8abbe 100644
--- a/packages/web/src/components/home/token-list-header/TokenListHeader.tsx
+++ b/packages/web/src/components/home/token-list-header/TokenListHeader.tsx
@@ -17,6 +17,7 @@ interface TokenListHeaderProps {
breakpoint: DEVICE_TYPE;
searchIcon: boolean;
onTogleSearch: () => void;
+ searchRef: React.RefObject;
}
const TokenListHeader: React.FC = ({
@@ -27,6 +28,7 @@ const TokenListHeader: React.FC = ({
breakpoint,
searchIcon,
onTogleSearch,
+ searchRef,
}) => (
@@ -38,13 +40,15 @@ const TokenListHeader: React.FC = ({
onClick={changeTokenType}
/>
) : searchIcon ? (
-
+ }>
+
+
) : (
diff --git a/packages/web/src/components/home/token-list/TokenList.tsx b/packages/web/src/components/home/token-list/TokenList.tsx
index 70d870bed..a54e56ced 100644
--- a/packages/web/src/components/home/token-list/TokenList.tsx
+++ b/packages/web/src/components/home/token-list/TokenList.tsx
@@ -30,6 +30,7 @@ interface TokenItem {
breakpoint: DEVICE_TYPE;
searchIcon: boolean;
onTogleSearch: () => void;
+ searchRef: React.RefObject
;
}
const TokenList: React.FC = ({
@@ -49,6 +50,7 @@ const TokenList: React.FC = ({
breakpoint,
searchIcon,
onTogleSearch,
+ searchRef,
}) => {
return (
@@ -60,6 +62,7 @@ const TokenList: React.FC
= ({
breakpoint={breakpoint}
searchIcon={searchIcon}
onTogleSearch={onTogleSearch}
+ searchRef={searchRef}
/>
`
${mixins.flexbox("column", "flex-start", "flex-start")}
width: 100%;
background-color: ${({ theme }) => theme.color.background06};
border: 1px solid ${({ theme }) => theme.color.border02};
box-shadow: 8px 8px 20px 0px rgba(0, 0, 0, 0.08);
border-radius: 10px;
- padding: 16px 0px 12px;
- gap: 12px;
+ padding: ${({ loading }) => {
+ return loading ? "15px 0px 15px" : "15px 0px 11px";
+ }};
+ gap: ${({ loading }) => {
+ return loading ? "8px" : "12px";
+ }};
${media.mobile} {
- padding: 16px 0px;
+ padding: 15px 0px;
gap: 16px;
}
h2 {
@@ -42,23 +49,9 @@ export const TrendingCardListwrapper = styled.div`
export const SkeletonItem = styled.div`
width: ${({ tdWidth }) => `${tdWidth}`};
height: 100%;
- padding: 8px 24px;
+ padding: 4px 24px;
${mixins.flexbox("row", "center", "flex-start")};
-`;
-
-
-export const LoadingWrapper = styled.div`
- ${mixins.flexbox("column", "flex-start", "flex-start")}
- width: 100%;
- background-color: ${({ theme }) => theme.color.background06};
- border: 1px solid ${({ theme }) => theme.color.border02};
- box-shadow: 8px 8px 20px 0px rgba(0, 0, 0, 0.08);
- border-radius: 10px;
- padding: 16px 0px 12px;
- & > div:first-of-type {
- padding: 0 24px 13px 24px;
+ &:first-of-type {
+ padding: 0px 24px 5px 24px;
}
- ${media.mobile} {
- padding: 16px 0px;
- }
-`;
\ No newline at end of file
+`;
diff --git a/packages/web/src/components/home/trending-card-list/TrendingCardList.tsx b/packages/web/src/components/home/trending-card-list/TrendingCardList.tsx
index 40a3bcca5..8876da2e7 100644
--- a/packages/web/src/components/home/trending-card-list/TrendingCardList.tsx
+++ b/packages/web/src/components/home/trending-card-list/TrendingCardList.tsx
@@ -1,10 +1,16 @@
import React, { useMemo } from "react";
import CardList from "@components/home/card-list/CardList";
-import { LoadingWrapper, SkeletonItem, TrendingCardListwrapper } from "./TrendingCardList.styles";
+import {
+ SkeletonItem,
+ TrendingCardListwrapper,
+} from "./TrendingCardList.styles";
import IconFlame from "@components/common/icons/IconFlame";
import { DEVICE_TYPE } from "@styles/media";
import { CardListTokenInfo } from "@models/common/card-list-item-info";
-import { SHAPE_TYPES, skeletonTrendingStyle } from "@constants/skeleton.constant";
+import {
+ SHAPE_TYPES,
+ skeletonTrendingStyle,
+} from "@constants/skeleton.constant";
interface TrendingCardListProps {
list: Array;
device: DEVICE_TYPE;
@@ -18,35 +24,48 @@ const TrendingCardList: React.FC = ({
onClickItem,
loading,
}) => {
+
const visible = useMemo(() => {
return device !== DEVICE_TYPE.MOBILE;
}, [device]);
-
- if (loading) {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-
return visible ? (
-
-
-
- Trending
-
-
+
+ {loading ? (
+
+
+
+ ) : (
+
+
+
+ Trending
+
+
+ )}
+ {loading ? (
+ <>
+
+
+
+
+
+
+
+
+
+ >
+ ) : (
+
+ )}
) : null;
};
diff --git a/packages/web/src/components/pool/learn-more-modal/LearnMoreModal.styles.ts b/packages/web/src/components/pool/learn-more-modal/LearnMoreModal.styles.ts
index 24d28b1bf..5a1490986 100644
--- a/packages/web/src/components/pool/learn-more-modal/LearnMoreModal.styles.ts
+++ b/packages/web/src/components/pool/learn-more-modal/LearnMoreModal.styles.ts
@@ -12,11 +12,12 @@ export const LearnMoreModalBackground = styled.div`
right: 0px;
width: 100%;
height: 100lvh;
- background: rgba(10, 14, 23, 0.7);
- z-index: ${Z_INDEX.modalOverlay};
+ z-index: ${Z_INDEX.modal};
+ pointer-events: none;
`;
export const LearnMoreModalWrapper = styled.div`
+ pointer-events: initial;
${mixins.flexbox("column", "flex-start", "flex-start")};
position: absolute;
overflow: hidden;
diff --git a/packages/web/src/components/pool/learn-more-modal/LearnMoreModal.tsx b/packages/web/src/components/pool/learn-more-modal/LearnMoreModal.tsx
index 0110879a8..1a3ed902d 100644
--- a/packages/web/src/components/pool/learn-more-modal/LearnMoreModal.tsx
+++ b/packages/web/src/components/pool/learn-more-modal/LearnMoreModal.tsx
@@ -1,6 +1,8 @@
import Button from "@components/common/button/Button";
import IconStrokeArrowLeft from "@components/common/icons/IconStrokeArrowLeft";
import IconStrokeArrowRight from "@components/common/icons/IconStrokeArrowRight";
+import { Overlay } from "@components/common/modal/Modal.styles";
+import useEscCloseModal from "@hooks/common/use-esc-close-modal";
import { useWindowSize } from "@hooks/common/use-window-size";
import { ThemeState } from "@states/index";
import { DEVICE_TYPE } from "@styles/media";
@@ -107,20 +109,7 @@ const LearnMoreModal: React.FC = ({ setIsShowLearnMoreModal }) => {
}
};
- useEffect(() => {
- const closeModal = (e: MouseEvent) => {
- if (modalRef.current && modalRef.current.contains(e.target as Node)) {
- return;
- } else {
- e.stopPropagation();
- setIsShowLearnMoreModal(false);
- }
- };
- window.addEventListener("click", closeModal, true);
- return () => {
- window.removeEventListener("click", closeModal, true);
- };
- }, [modalRef, setIsShowLearnMoreModal]);
+ useEscCloseModal(() => setIsShowLearnMoreModal(false));
useEffect(() => {
handleResize();
@@ -131,65 +120,68 @@ const LearnMoreModal: React.FC = ({ setIsShowLearnMoreModal }) => {
}, [modalRef]);
return (
-
-
-
-
- e.preventDefault()}>
- {LEARN_MORE_DATA[index].title}
- {LEARN_MORE_DATA[index].description}
-
-
- e.preventDefault()}
- onMouseDown={e => e.preventDefault()}
- draggable="false"
- src={
- themeKey === "dark"
- ? LEARN_MORE_DATA[index].darkImageUrl
- : LEARN_MORE_DATA[index].lightImageURL
- }
- alt="logo img"
- />
-
- setIndex(
- index < LEARN_MORE_DATA.length - 1
- ? index + 1
- : LEARN_MORE_DATA.length - 1,
- )
- }
- className={`slide-icon right-icon ${
- index < LEARN_MORE_DATA.length - 1 ? "active-icon" : ""
- }`}
- />
- setIndex(index > 0 ? index - 1 : 0)}
- className={`slide-icon left-icon ${
- index > 0 ? "active-icon" : ""
- }`}
- />
-
-
-
-
+ <>
+
+
+
+
+ e.preventDefault()}>
+ {LEARN_MORE_DATA[index].title}
+ {LEARN_MORE_DATA[index].description}
+
+
+ e.preventDefault()}
+ onMouseDown={e => e.preventDefault()}
+ draggable="false"
+ src={
+ themeKey === "dark"
+ ? LEARN_MORE_DATA[index].darkImageUrl
+ : LEARN_MORE_DATA[index].lightImageURL
+ }
+ alt="logo img"
+ />
+
+ setIndex(
+ index < LEARN_MORE_DATA.length - 1
+ ? index + 1
+ : LEARN_MORE_DATA.length - 1,
+ )
+ }
+ className={`slide-icon right-icon ${
+ index < LEARN_MORE_DATA.length - 1 ? "active-icon" : ""
+ }`}
+ />
+ setIndex(index > 0 ? index - 1 : 0)}
+ className={`slide-icon left-icon ${
+ index > 0 ? "active-icon" : ""
+ }`}
+ />
+
+
+
+
+ setIsShowLearnMoreModal(false)}/>
+ >
);
};
diff --git a/packages/web/src/components/pool/my-liquidity-details/MyLiquidityDetails.tsx b/packages/web/src/components/pool/my-liquidity-details/MyLiquidityDetails.tsx
index 302c21bf0..f03980a27 100644
--- a/packages/web/src/components/pool/my-liquidity-details/MyLiquidityDetails.tsx
+++ b/packages/web/src/components/pool/my-liquidity-details/MyLiquidityDetails.tsx
@@ -27,8 +27,8 @@ export const poolDetailListInit = [
},
rangeType: RANGE_STATUS_OPTION.IN,
stakeType: STAKED_OPTION.STAKED,
- minPriceAmount: "1,105.1 GNOT per GNOS",
- maxPriceAmount: "1,268.2 GNOT per GNOS",
+ minPriceAmount: "1,105.1 GNOT per GNS",
+ maxPriceAmount: "1,268.2 GNOT per GNS",
balance: "$18,092.45",
rewards: "$1,015.24",
apr: "90.5%",
@@ -52,8 +52,8 @@ export const poolDetailListInit = [
},
rangeType: RANGE_STATUS_OPTION.OUT,
stakeType: STAKED_OPTION.UNSTAKED,
- minPriceAmount: "1,105.1 GNOT per GNOS",
- maxPriceAmount: "1,268.2 GNOT per GNOS",
+ minPriceAmount: "1,105.1 GNOT per GNS",
+ maxPriceAmount: "1,268.2 GNOT per GNS",
balance: "$18,092.45",
rewards: "$1,015.24",
apr: "90.5%",
@@ -77,8 +77,8 @@ export const poolDetailListInit = [
},
rangeType: RANGE_STATUS_OPTION.IN,
stakeType: STAKED_OPTION.STAKED,
- minPriceAmount: "1,105.1 GNOT per GNOS",
- maxPriceAmount: "1,268.2 GNOT per GNOS",
+ minPriceAmount: "1,105.1 GNOT per GNS",
+ maxPriceAmount: "1,268.2 GNOT per GNS",
balance: "$18,092.45",
rewards: "$1,015.24",
apr: "90.5%",
diff --git a/packages/web/src/components/pool/my-position-card/MyPositionCard.tsx b/packages/web/src/components/pool/my-position-card/MyPositionCard.tsx
index a0bef24cd..3b010f2e7 100644
--- a/packages/web/src/components/pool/my-position-card/MyPositionCard.tsx
+++ b/packages/web/src/components/pool/my-position-card/MyPositionCard.tsx
@@ -194,12 +194,12 @@ const MyPositionCard: React.FC = ({
<>
Min
- {content.tokenPair.minAmount} GNOT per GNOS
+ {content.tokenPair.minAmount} GNOT per GNS
{"<->"}
Max
- {content.tokenPair.maxAmount} GNOT per GNOS
+ {content.tokenPair.maxAmount} GNOT per GNS
>
) : (
@@ -207,13 +207,13 @@ const MyPositionCard: React.FC = ({
Min
- {content.tokenPair.minAmount} GNOT per GNOS {"<->"}
+ {content.tokenPair.minAmount} GNOT per GNS {"<->"}
Max
- {content.tokenPair.maxAmount} GNOT per GNOS
+ {content.tokenPair.maxAmount} GNOT per GNS
>
diff --git a/packages/web/src/components/stake/select-stake-result/SelectStakeResult.tsx b/packages/web/src/components/stake/select-stake-result/SelectStakeResult.tsx
index 795ac2228..8f547d87e 100644
--- a/packages/web/src/components/stake/select-stake-result/SelectStakeResult.tsx
+++ b/packages/web/src/components/stake/select-stake-result/SelectStakeResult.tsx
@@ -29,7 +29,7 @@ const SelectStakeResult: React.FC = ({
-
Pooled GNOS
+
Pooled GNS
1,140.058845
$5,564.48
diff --git a/packages/web/src/components/swap/confirm-swap-modal/ConfirmSwapModal.stories.tsx b/packages/web/src/components/swap/confirm-swap-modal/ConfirmSwapModal.stories.tsx
index b33acd19c..0a8b5bf26 100644
--- a/packages/web/src/components/swap/confirm-swap-modal/ConfirmSwapModal.stories.tsx
+++ b/packages/web/src/components/swap/confirm-swap-modal/ConfirmSwapModal.stories.tsx
@@ -39,7 +39,7 @@ const swapTokenInfo: SwapTokenInfo = {
tokenBUSD: 0,
tokenBUSDStr: "0",
direction: "EXACT_IN",
- slippage: 10
+ slippage: "10"
};
const swapSummaryInfo: SwapSummaryInfo = {
diff --git a/packages/web/src/components/swap/confirm-swap-modal/ConfirmSwapModal.styles.ts b/packages/web/src/components/swap/confirm-swap-modal/ConfirmSwapModal.styles.ts
index e21aa9461..dcd863e92 100644
--- a/packages/web/src/components/swap/confirm-swap-modal/ConfirmSwapModal.styles.ts
+++ b/packages/web/src/components/swap/confirm-swap-modal/ConfirmSwapModal.styles.ts
@@ -5,6 +5,7 @@ import { Z_INDEX } from "@styles/zIndex";
import { media } from "@styles/media";
export const ConfirmSwapModalBackground = styled.div`
+ z-index: ${Z_INDEX.modal};
position: fixed;
overflow: scroll;
top: 0px;
@@ -13,15 +14,15 @@ export const ConfirmSwapModalBackground = styled.div`
right: 0px;
width: 100%;
height: 100%;
- background: rgba(10, 14, 23, 0.7);
- z-index: ${Z_INDEX.modalOverlay};
+ pointer-events: none;
`;
export const ConfirmModal = styled.div`
+ pointer-events: initial;
${mixins.flexbox("column", "flex-start", "flex-start")};
overflow: hidden;
width: 460px;
- padding: 24px 0px;
+ padding: 23px 0px;
gap: 16px;
${mixins.positionCenter}
border-radius: 8px;
@@ -32,17 +33,18 @@ export const ConfirmModal = styled.div`
${media.mobile} {
width: 328px;
${mixins.positionCenter}
- padding: 16px 0px;
+ padding: 15px 0px;
}
.modal-body {
${mixins.flexbox("column", "flex-start", "flex-start")};
width: 100%;
- padding: 0px 24px;
- gap: 24px;
+ padding: 0px 23px;
+ gap: 16px;
${media.mobile} {
- padding: 0px 12px;
+ padding: 0px 15px;
+ gap: 12px;
}
.modal-header {
@@ -95,7 +97,7 @@ export const ConfirmModal = styled.div`
padding: 16px;
gap: 8px;
border-radius: 8px;
- background: ${({ theme }) => theme.color.background01};
+ background: ${({ theme }) => theme.color.background20};
border: 1px solid ${({ theme }) => theme.color.border02};
}
.second-section {
@@ -104,7 +106,7 @@ export const ConfirmModal = styled.div`
padding: 16px;
gap: 8px;
border-radius: 8px;
- background: ${({ theme }) => theme.color.background01};
+ background: ${({ theme }) => theme.color.background20};
border: 1px solid ${({ theme }) => theme.color.border02};
}
.amount-container {
@@ -119,9 +121,10 @@ export const ConfirmModal = styled.div`
}
.button-wrapper {
${mixins.flexbox("row", "center", "flex-start")};
- padding: 4px 12px 4px 6px;
+ padding: 5px 12px 5px 6px;
gap: 8px;
border-radius: 36px;
+ height: 34px;
background: ${({ theme }) => theme.color.background13};
${fonts.body9}
color: ${({ theme }) => theme.color.text02};
@@ -134,7 +137,7 @@ export const ConfirmModal = styled.div`
${mixins.flexbox("row", "center", "flex-start")};
.price-text {
${fonts.body12};
- color: ${({ theme }) => theme.color.text10};
+ color: ${({ theme }) => theme.color.text04};
${media.mobile} {
${fonts.p2};
}
@@ -151,7 +154,7 @@ export const ConfirmModal = styled.div`
${mixins.flexbox("row", "center", "center")};
width: 40px;
height: 40px;
- background-color: ${({ theme }) => theme.color.background01};
+ background-color: ${({ theme }) => theme.color.background20};
border: 1px solid ${({ theme }) => theme.color.border02};
border-radius: 50%;
@@ -174,7 +177,7 @@ export const ConfirmModal = styled.div`
padding: 12px;
}
border-radius: 8px;
- background: ${({ theme }) => theme.color.background01};
+ background: ${({ theme }) => theme.color.background20};
border: 1px solid ${({ theme }) => theme.color.border02};
.coin-info {
${mixins.flexbox("row", "center", "flex-start")};
@@ -184,7 +187,7 @@ export const ConfirmModal = styled.div`
${media.mobile} {
${fonts.p2};
}
- color: ${({ theme }) => theme.color.text03};
+ color: ${({ theme }) => theme.color.text10};
}
.exchange-price {
${fonts.body12};
@@ -209,7 +212,7 @@ export const ConfirmModal = styled.div`
gap: 8px;
}
border-radius: 8px;
- background: ${({ theme }) => theme.color.background01};
+ background: ${({ theme }) => theme.color.background20};
border: 1px solid ${({ theme }) => theme.color.border02};
${fonts.body12};
@@ -219,9 +222,12 @@ export const ConfirmModal = styled.div`
.gray-text {
color: ${({ theme }) => theme.color.text04};
+ &:last-of-type {
+ margin-left: 4px;
+ }
}
.white-text {
- color: ${({ theme }) => theme.color.text03};
+ color: ${({ theme }) => theme.color.text10};
}
.slippage,
.received,
@@ -237,6 +243,9 @@ export const ConfirmModal = styled.div`
.modal-button {
${mixins.flexbox("column", "flex-start", "flex-start")};
width: 100%;
+ ${media.mobile} {
+ height: 41px;
+ }
}
.animation {
@@ -246,9 +255,6 @@ export const ConfirmModal = styled.div`
.animation-logo {
width: 72px;
height: 72px;
- * {
- fill: ${({ theme }) => theme.color.point};
- }
${media.mobile} {
width: 60px;
height: 54px;
@@ -306,9 +312,14 @@ export const ConfirmModal = styled.div`
.close-button {
${mixins.flexbox("column", "flex-start", "flex-start")};
width: 100%;
+ button {
+ height: 57px;
+ }
${media.mobile} {
- height: 41px;
- width: 304px;
+ button {
+ height: 41px;
+ width: 304px;
+ }
}
}
}
@@ -318,7 +329,7 @@ export const ConfirmModal = styled.div`
padding-bottom: 36px;
}
${media.mobile} {
- gap: 16px;
+ gap: 12px;
.view-transaction {
padding-bottom: 12px;
}
diff --git a/packages/web/src/components/swap/confirm-swap-modal/ConfirmSwapModal.tsx b/packages/web/src/components/swap/confirm-swap-modal/ConfirmSwapModal.tsx
index 2e5912e4e..cdcb116f2 100644
--- a/packages/web/src/components/swap/confirm-swap-modal/ConfirmSwapModal.tsx
+++ b/packages/web/src/components/swap/confirm-swap-modal/ConfirmSwapModal.tsx
@@ -6,7 +6,6 @@ import {
} from "./ConfirmSwapModal.styles";
import IconClose from "@components/common/icons/IconCancel";
import IconSwapArrowDown from "@components/common/icons/IconSwapArrowDown";
-import IconInfo from "@components/common/icons/IconInfo";
import Button, { ButtonHierarchy } from "@components/common/button/Button";
import IconSuccess from "@components/common/icons/IconSuccess";
import IconOpenLink from "@components/common/icons/IconOpenLink";
@@ -15,11 +14,11 @@ import LoadingSpinner from "@components/common/loading-spinner/LoadingSpinner";
import { SwapTokenInfo } from "@models/swap/swap-token-info";
import { SwapSummaryInfo, swapDirectionToGuaranteedType } from "@models/swap/swap-summary-info";
import { SwapResultInfo } from "@models/swap/swap-result-info";
-import useModalCloseEvent from "@hooks/common/use-modal-close-event";
import { numberToUSD, toNumberFormat } from "@utils/number-utils";
import { numberToFormat } from "@utils/string-utils";
-import BigNumber from "bignumber.js";
import { usePositionModal } from "@hooks/common/use-position-modal";
+import { Overlay } from "@components/common/modal/Modal.styles";
+import useEscCloseModal from "@hooks/common/use-esc-close-modal";
interface ConfirmSwapModalProps {
submitted: boolean;
@@ -41,17 +40,9 @@ const ConfirmSwapModal: React.FC = ({
}) => {
const menuRef = useRef(null);
- useModalCloseEvent(menuRef, close);
+ useEscCloseModal(close);
usePositionModal(menuRef);
- const tokenAAmountStr = useMemo(() => {
- return BigNumber(swapTokenInfo.tokenAAmount).toFormat();
- }, [swapTokenInfo.tokenAAmount]);
-
- const tokenBAmountStr = useMemo(() => {
- return BigNumber(swapTokenInfo.tokenBAmount).toFormat();
- }, [swapTokenInfo.tokenBAmount]);
-
const swapRateDescription = useMemo(() => {
const { tokenA, tokenB, swapRate } = swapSummaryInfo;
return `1 ${tokenA.symbol} = ${numberToFormat(swapRate)} ${tokenB.symbol}`;
@@ -91,121 +82,123 @@ const ConfirmSwapModal: React.FC = ({
const gasFeeUSD = swapSummaryInfo.gasFeeUSD;
return `$${toNumberFormat(gasFeeUSD)}`;
}, [swapSummaryInfo.gasFeeUSD]);
-
+
return (
-
-
-
-
- {!submitted &&
Confirm Swap}
-
-
+ <>
+
+
+
+
+ {!submitted &&
Confirm Swap}
+
+
+
-
- {submitted ? (
-
- ) : (
- <>
-
-
-
-
-
{tokenAAmountStr}
-
-
-
{swapSummaryInfo.tokenA.symbol}
+ {submitted ? (
+
+ ) : (
+ <>
+
+
+
+
+
{swapTokenInfo.tokenAAmount}
+
+
+
{swapSummaryInfo.tokenA.symbol}
+
-
-
- {swapTokenInfo.tokenAUSDStr}
-
-
-
-
+
+ {swapTokenInfo.tokenAUSDStr}
-
-
-
-
-
{tokenBAmountStr}
-
-
-
{swapSummaryInfo.tokenB.symbol}
+
-
-
{swapTokenInfo.tokenBUSDStr}
+
+
+
{swapTokenInfo.tokenBAmount}
+
+
+
{swapSummaryInfo.tokenB.symbol}
+
+
+
+ {swapTokenInfo.tokenBUSDStr}
+
-
-
-
-
-
- {swapRateDescription}
-
-
- {swapRateUSDStr}
-
-
-
-
-
- Price Impact
-
- {priceImpactStr}
-
-
-
- Max. Slippage
- {slippageStr}
-
-
-
-
{guaranteedTypeStr}
-
- {guaranteedStr}
-
+
+
+
+ {swapRateDescription}
+
+
+ {swapRateUSDStr}
+
+
-
-
Gas Fee
-
- {gasFeeStr} GNOT
-
- ({gasFeeUSDStr})
+
+
+ Price Impact
+
+ {priceImpactStr}
+
+
+
+ Max. Slippage
+ {slippageStr}
+
+
+
+ {guaranteedTypeStr}
+
+ {guaranteedStr}
+
+
+
+ Gas Fee
+
+ {gasFeeStr} GNOT
+
+ ({gasFeeUSDStr})
+
-
+
-
-
-
-
- >
- )}
-
-
-
+
+
+
+ >
+ )}
+
+
+
+
+ >
);
};
@@ -228,7 +221,7 @@ const ConfirmSwapResult: React.FC = ({
Waiting for Confirmation
- Swapping 0.1 GNOS for 0.12 GNOT
+ Swapping 0.1 GNS for 0.12 GNOT
Confirm this transaction in your wallet
@@ -263,7 +256,6 @@ const ConfirmSwapResult: React.FC
= ({
text="Close"
style={{
fullWidth: true,
- height: 57,
fontType: "body7",
hierarchy: ButtonHierarchy.Primary,
}}
diff --git a/packages/web/src/components/swap/setting-menu-modal/SettingMenuModal.stories.tsx b/packages/web/src/components/swap/setting-menu-modal/SettingMenuModal.stories.tsx
index 901f8c6da..2b5e11cbc 100644
--- a/packages/web/src/components/swap/setting-menu-modal/SettingMenuModal.stories.tsx
+++ b/packages/web/src/components/swap/setting-menu-modal/SettingMenuModal.stories.tsx
@@ -19,7 +19,7 @@ const Template: ComponentStory = args => (
export const Default = Template.bind({});
Default.args = {
- slippage: 0,
+ slippage: "0",
changeSlippage: action("changeSlippage"),
close: action("close"),
};
diff --git a/packages/web/src/components/swap/setting-menu-modal/SettingMenuModal.styles.ts b/packages/web/src/components/swap/setting-menu-modal/SettingMenuModal.styles.ts
index ad1b0b5fb..a64ab827f 100644
--- a/packages/web/src/components/swap/setting-menu-modal/SettingMenuModal.styles.ts
+++ b/packages/web/src/components/swap/setting-menu-modal/SettingMenuModal.styles.ts
@@ -8,7 +8,7 @@ export const SettingMenuModalWrapper = styled.div`
z-index: ${Z_INDEX.modal};
position: absolute;
width: 236px;
- padding: 16px 0px;
+ padding: 15px 0px;
gap: 16px;
border-radius: 8px;
background: ${({ theme }) => theme.color.background06};
@@ -20,7 +20,7 @@ export const SettingMenuModalWrapper = styled.div`
.modal-body {
${mixins.flexbox("column", "flex-start", "flex-start")};
width: 100%;
- padding: 0px 16px;
+ padding: 0px 15px;
gap: 16px;
.modal-header {
@@ -62,7 +62,6 @@ export const SettingMenuModalWrapper = styled.div`
${mixins.flexbox("row", "center", "center")};
width: 16px;
height: 16px;
- cursor: pointer;
.info-icon {
* {
fill: ${({ theme }) => theme.color.icon03};
@@ -85,11 +84,17 @@ export const SettingMenuModalWrapper = styled.div`
color: ${({ theme }) => theme.color.text03};
border: 1px solid ${({ theme }) => theme.color.border02};
background: ${({ theme }) => theme.color.background01};
+ &:focus-within {
+ border: 1px solid ${({ theme }) => theme.color.border15};
+ }
}
.amount-text {
${mixins.flexbox("row", "center", "flex-end")};
text-align: right;
width: 100%;
+ &::placeholder {
+ color: ${({ theme }) => theme.color.text03};
+ }
}
}
}
@@ -104,3 +109,15 @@ export const ModalTooltipWrap = styled.div`
${mixins.flexbox("column", "flex-start", "flex-start")};
}
`;
+
+export const Overlay = styled.div`
+ position: fixed;
+ top: 0px;
+ bottom: 0px;
+ left: 0px;
+ right: 0px;
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+ z-index: ${Z_INDEX.modalOverlay};
+`;
diff --git a/packages/web/src/components/swap/setting-menu-modal/SettingMenuModal.tsx b/packages/web/src/components/swap/setting-menu-modal/SettingMenuModal.tsx
index 88bf81589..eb16cd83f 100644
--- a/packages/web/src/components/swap/setting-menu-modal/SettingMenuModal.tsx
+++ b/packages/web/src/components/swap/setting-menu-modal/SettingMenuModal.tsx
@@ -2,15 +2,18 @@ import Button, { ButtonHierarchy } from "@components/common/button/Button";
import IconClose from "@components/common/icons/IconCancel";
import IconInfo from "@components/common/icons/IconInfo";
import Tooltip from "@components/common/tooltip/Tooltip";
-import React, { useCallback, useRef } from "react";
+import React, { useCallback, useRef, useState } from "react";
import {
ModalTooltipWrap,
+ Overlay,
SettingMenuModalWrapper,
} from "./SettingMenuModal.styles";
-import useModalCloseEvent from "@hooks/common/use-modal-close-event";
+import useEscCloseModal from "@hooks/common/use-esc-close-modal";
+import { isAmount } from "@common/utils/data-check-util";
+import { DEFAULT_SLIPPAGE } from "@constants/option.constant";
interface SettingMenuModalProps {
- slippage: number;
+ slippage: string;
changeSlippage: (value: string) => void;
close: () => void;
className?: string;
@@ -22,9 +25,31 @@ const SettingMenuModal: React.FC = ({
close,
className,
}) => {
+ const [previos, setPrevios] = useState(slippage);
const settingMenuRef = useRef(null);
- useModalCloseEvent(settingMenuRef, close);
+ const inputRef = useRef(null);
+ const buttonRef = useRef(null);
+ const wrapperInputRef = useRef(null);
+ const closeRef = useRef(null);
+
+ const handleClose = useCallback(() => {
+ changeSlippage(previos);
+ close();
+ }, [close, changeSlippage, previos]);
+ useEscCloseModal(handleClose);
+ const handleCloseExit = useCallback(() => {
+ if (inputRef && inputRef.current) {
+ if (Number(inputRef.current.value) > 30) {
+ changeSlippage("30");
+ } else {
+ changeSlippage(inputRef.current.value);
+ }
+ }
+ close();
+ }, [close, changeSlippage, previos]);
+ useEscCloseModal(handleClose);
+
const TooltipFloatingContent = (
@@ -39,54 +64,107 @@ const SettingMenuModal: React.FC
= ({
const onChangeSlippage = useCallback((event: React.ChangeEvent) => {
const value = event.target.value;
- changeSlippage(value);
+ if (value !== "" && !isAmount(value)) return;
+ if (/^\d{0,10}(\.\d{0,2})?$/.test(value)) {
+ changeSlippage(value.replace(/^0+(?=\d)|(\.\d*)$/g, "$1"));
+ }
}, [changeSlippage]);
const onClickReset = useCallback(() => {
- changeSlippage("0.5");
+ changeSlippage(DEFAULT_SLIPPAGE);
}, [changeSlippage]);
+
+ const handleClickWrapper = useCallback((event: React.MouseEvent) => {
+ if (buttonRef && buttonRef.current && buttonRef.current.contains(event.target as Node)) {
+ setPrevios(DEFAULT_SLIPPAGE);
+ changeSlippage(DEFAULT_SLIPPAGE);
+ return;
+ }
+ if (closeRef && closeRef.current && closeRef.current.contains(event.target as Node)) {
+ changeSlippage(previos);
+ return;
+ }
+ if (inputRef && inputRef.current && !inputRef.current.contains(event.target as Node)) {
+ const value = inputRef.current.value;
+ if (value === "") {
+ changeSlippage("0");
+ setPrevios("0");
+ } else if (Number(value) > 30) {
+ changeSlippage("30");
+ setPrevios("30");
+ } else {
+ setPrevios(Number(value).toString());
+ changeSlippage(Number(value).toString());
+ }
+ }
+ }, [changeSlippage, setPrevios, previos]);
+ const handleKeyDown = useCallback((event: React.KeyboardEvent) => {
+ if (event.keyCode === 13) {
+ const value = event.currentTarget.value;
+ if (inputRef && inputRef.current) {
+ inputRef.current.blur();
+ }
+ if (value === "") {
+ changeSlippage("0");
+ setPrevios("0");
+ } else if (Number(value) > 30) {
+ changeSlippage("30");
+ setPrevios("30");
+ } else {
+ setPrevios(Number(value).toString());
+ changeSlippage(Number(value).toString());
+ }
+ }
+ }, [changeSlippage, setPrevios]);
+
return (
-
-
-
-
-
Slippage tolerance
-
-
-
+ <>
+
+
+
-
-
-
-
+
+ Slippage tolerance
+
+