diff --git a/src/pages/NotificationCenter/NotificationPreference/index.tsx b/src/pages/NotificationCenter/NotificationPreference/index.tsx index bce84f7a64..153edacb22 100644 --- a/src/pages/NotificationCenter/NotificationPreference/index.tsx +++ b/src/pages/NotificationCenter/NotificationPreference/index.tsx @@ -1,5 +1,6 @@ import { Trans, t } from '@lingui/macro' -import { useCallback, useEffect, useMemo, useState } from 'react' +import { ReactNode, useCallback, useEffect, useMemo, useState } from 'react' +import { useNavigate } from 'react-router-dom' import { Text } from 'rebass' import styled from 'styled-components' @@ -11,12 +12,14 @@ import Loader from 'components/Loader' import Row from 'components/Row' import { MouseoverTooltip } from 'components/Tooltip' import { PRICE_ALERT_TOPIC_ID } from 'constants/env' +import { APP_PATHS } from 'constants/index' import { useActiveWeb3React } from 'hooks' import useMixpanel, { MIXPANEL_TYPE } from 'hooks/useMixpanel' import useNotification, { Topic, TopicType } from 'hooks/useNotification' import useTheme from 'hooks/useTheme' import ActionButtons from 'pages/NotificationCenter/NotificationPreference/ActionButtons' import InputEmail from 'pages/NotificationCenter/NotificationPreference/InputEmail' +import { PROFILE_MANAGE_ROUTES } from 'pages/NotificationCenter/const' import VerifyCodeModal from 'pages/Verify/VerifyCodeModal' import { useNotify } from 'state/application/hooks' import { useSessionInfo } from 'state/authen/hooks' @@ -336,7 +339,7 @@ function NotificationPreference({ toggleModal = noop }: { toggleModal?: () => vo }, [topicGroupsGlobal]) const totalTopic = commons.length + restrict.length - const renderTopic = (topic: Topic, disabled: boolean, disableTooltip?: string) => { + const renderTopic = (topic: Topic, disabled: boolean, disableTooltip?: ReactNode) => { return ( @@ -361,6 +364,7 @@ function NotificationPreference({ toggleModal = noop }: { toggleModal?: () => vo ) } + const navigate = useNavigate() return ( @@ -401,11 +405,33 @@ function NotificationPreference({ toggleModal = noop }: { toggleModal?: () => vo const disableKyberAI = disableCheckbox || !isLogin || !isWhiteList return renderTopic( topic, - (() => (topic.isKyberAI ? disableKyberAI : disableCheckbox || !isLogin))(), - topic.isKyberAI && disableKyberAI - ? t`You must be whitelisted to subscribe/unsubscribe this topic` - : t`These notifications can only be subscribed by a signed-in profile. Go to Profile tab to sign-in with your wallet - `, + topic.isKyberAI ? disableKyberAI : disableCheckbox || !isLogin, + topic.isKyberAI && disableKyberAI ? ( + + Before you can subscribe to KyberAI notifications, you need to be whitelisted. Register for KyberAI{' '} + navigate(APP_PATHS.KYBERAI_ABOUT)} + > + here + + + ) : ( + + Before you can subscribe to this notification, sign-in to a profile first. Go the{' '} + navigate(`${APP_PATHS.PROFILE_MANAGE}${PROFILE_MANAGE_ROUTES.PROFILE}`)} + > + Profile + {' '} + tab to sign-in with your wallet + + ), ) })} diff --git a/src/state/crossChain/reducer.ts b/src/state/crossChain/reducer.ts index 9c8afb9e34..e384548fdd 100644 --- a/src/state/crossChain/reducer.ts +++ b/src/state/crossChain/reducer.ts @@ -77,7 +77,7 @@ const DEFAULT_STATE: CrossChainState = { }, crossChain: { - inputAmount: '', + inputAmount: '1', chains: [], tokens: [], currencyIn: undefined,