Skip to content

Commit

Permalink
open kyberAI (#2056)
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoaidanh authored Jul 10, 2023
1 parent f671435 commit 4beb76a
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 73 deletions.
75 changes: 36 additions & 39 deletions src/components/Header/KyberAINavItem.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import { Trans, t } from '@lingui/macro'
import { Trans } from '@lingui/macro'
import { darken } from 'polished'
import { useLocation } from 'react-router-dom'
import styled from 'styled-components'

import Column from 'components/Column'
import ApeIcon from 'components/Icons/ApeIcon'
import { RowFit } from 'components/Row'
import { MouseoverTooltip } from 'components/Tooltip'
import Icon from 'components/Icons/Icon'
import Row, { RowFit } from 'components/Row'
import { TutorialIds } from 'components/Tutorial/TutorialSwap/constant'
import { APP_PATHS } from 'constants/index'
import useTheme from 'hooks/useTheme'
import { useIsWhiteListKyberAI } from 'state/user/hooks'

import SlideToUnlock from './SlideToUnlock'
import NavGroup from './groups/NavGroup'
import { DropdownTextAnchor } from './styleds'
import { DropdownTextAnchor, StyledNavLink } from './styleds'

const CustomSlideToUnlock = styled(SlideToUnlock)`
background: linear-gradient(
Expand Down Expand Up @@ -69,60 +71,55 @@ const BetaTag = () => {
marginTop: '-16px',
}}
>
Beta
beta
</RowFit>
)
}

const KyberAINavItem = () => {
const { pathname } = useLocation()
const isActive = pathname.includes(APP_PATHS.KYBERAI)
// const { isWhiteList } = useIsWhiteListKyberAI()

// const dropdownContent = (
// <Column>
// <StyledNavLink id="kyberai_about" to={APP_PATHS.KYBERAI_ABOUT}>
// <Row gap="12px">
// <Icon id="info" size={16} />
// <Trans>About</Trans>
// </Row>
// </StyledNavLink>
// <StyledNavLink id="kyberai_ranking" to={APP_PATHS.KYBERAI_RANKINGS} $disabled={!isWhiteList}>
// <Row gap="12px">
// <Icon id="leaderboard" size={16} />
// <Trans>Rankings</Trans>
// </Row>
// </StyledNavLink>
//
// <StyledNavLink id="kyberai_explore" to={APP_PATHS.KYBERAI_EXPLORE} $disabled={!isWhiteList}>
// <Row gap="12px">
// <Icon id="truesight-v2" size={16} />
// <Trans>Explore</Trans>
// </Row>
// </StyledNavLink>
// </Column>
// )

const { isWhiteList } = useIsWhiteListKyberAI()
return (
<KyberAIWrapper
id={TutorialIds.DISCOVER_LINK}
isActive={isActive}
anchor={
<DropdownTextAnchor>
<MouseoverTooltip text={t`KyberAI is currently under maintenance. We'll notify you once its back online`}>
<RowFit style={{ cursor: 'not-allowed' }}>
{/*<CustomSlideToUnlock data-active={isActive}>*/}
<RowFit>
<CustomSlideToUnlock data-active={isActive}>
<RowFit gap="4px">
<ApeIcon />
<Trans>KyberAI</Trans>
</RowFit>
{/*</CustomSlideToUnlock>*/}
<BetaTag />
</RowFit>
</MouseoverTooltip>
</CustomSlideToUnlock>
<BetaTag />
</RowFit>
</DropdownTextAnchor>
}
dropdownContent={null}
dropdownContent={
<Column>
<StyledNavLink id="kyberai_about" to={APP_PATHS.KYBERAI_ABOUT}>
<Row gap="12px">
<Icon id="info" size={16} />
<Trans>About</Trans>
</Row>
</StyledNavLink>
<StyledNavLink id="kyberai_ranking" to={APP_PATHS.KYBERAI_RANKINGS} $disabled={!isWhiteList}>
<Row gap="12px">
<Icon id="leaderboard" size={16} />
<Trans>Rankings</Trans>
</Row>
</StyledNavLink>

<StyledNavLink id="kyberai_explore" to={APP_PATHS.KYBERAI_EXPLORE} $disabled={!isWhiteList}>
<Row gap="12px">
<Icon id="truesight-v2" size={16} />
<Trans>Explore</Trans>
</Row>
</StyledNavLink>
</Column>
}
/>
)
}
Expand Down
71 changes: 37 additions & 34 deletions src/pages/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Footer from 'components/Footer/Footer'
import Header from 'components/Header'
import Loader from 'components/LocalLoader'
import Modal from 'components/Modal'
import ProtectedRoute from 'components/ProtectedRoute'
import ProtectedRoute, { ProtectedRouteKyberAI } from 'components/ProtectedRoute'
import Snowfall from 'components/Snowflake/Snowfall'
import Web3ReactManager from 'components/Web3ReactManager'
import { ENV_LEVEL } from 'constants/env'
Expand All @@ -34,7 +34,9 @@ import useSessionExpiredGlobal from 'hooks/useSessionExpire'
import useTheme from 'hooks/useTheme'
import { useSyncNetworkParamWithStore } from 'hooks/web3/useSyncNetworkParamWithStore'
import { RedirectPathToSwapV3Network } from 'pages/SwapV3/redirects'
import KyberAIExplore from 'pages/TrueSightV2'
import TruesightFooter from 'pages/TrueSightV2/components/TruesightFooter'
import KyberAILandingPage from 'pages/TrueSightV2/pages/LandingPage'
import Verify from 'pages/Verify'
import { useHolidayMode } from 'state/user/hooks'
import DarkModeQueryParamReader from 'theme/DarkModeQueryParamReader'
Expand Down Expand Up @@ -358,39 +360,40 @@ export default function App() {
<Route path={`${APP_PATHS.KYBERDAO_VOTE}`} element={<KyberDAOVote />} />
<Route path={`${APP_PATHS.ABOUT}/kyberswap`} element={<AboutKyberSwap />} />
<Route path={`${APP_PATHS.ABOUT}/knc`} element={<AboutKNC />} />
{/*<Route path={`${APP_PATHS.KYBERAI}`} element={<Navigate to={APP_PATHS.KYBERAI_ABOUT} replace />} />*/}
{/*<Route*/}
{/* path={`${APP_PATHS.KYBERAI_ABOUT}`}*/}
{/* element={*/}
{/* <ProtectedRouteKyberAI waitUtilAuthenEndOnly>*/}
{/* <KyberAILandingPage />*/}
{/* </ProtectedRouteKyberAI>*/}
{/* }*/}
{/*/>*/}
{/*<Route*/}
{/* path={`${APP_PATHS.KYBERAI_RANKINGS}`}*/}
{/* element={*/}
{/* <ProtectedRouteKyberAI redirectUrl={APP_PATHS.KYBERAI_ABOUT}>*/}
{/* <KyberAIExplore />*/}
{/* </ProtectedRouteKyberAI>*/}
{/* }*/}
{/*/>*/}
{/*<Route*/}
{/* path={`${APP_PATHS.KYBERAI_EXPLORE}`}*/}
{/* element={*/}
{/* <ProtectedRouteKyberAI redirectUrl={APP_PATHS.KYBERAI_ABOUT}>*/}
{/* <KyberAIExplore />*/}
{/* </ProtectedRouteKyberAI>*/}
{/* }*/}
{/*/>*/}
{/*<Route*/}
{/* path={`${APP_PATHS.KYBERAI_EXPLORE}/:chain/:address`}*/}
{/* element={*/}
{/* <ProtectedRouteKyberAI redirectUrl={APP_PATHS.KYBERAI_ABOUT}>*/}
{/* <KyberAIExplore />*/}
{/* </ProtectedRouteKyberAI>*/}
{/* }*/}
{/*/>*/}
<Route path={`${APP_PATHS.KYBERAI}`} element={<Navigate to={APP_PATHS.KYBERAI_ABOUT} replace />} />
<Route path={`${APP_PATHS.KYBERAI}`} element={<Navigate to={APP_PATHS.KYBERAI_ABOUT} replace />} />
<Route
path={`${APP_PATHS.KYBERAI_ABOUT}`}
element={
<ProtectedRouteKyberAI waitUtilAuthenEndOnly>
<KyberAILandingPage />
</ProtectedRouteKyberAI>
}
/>
<Route
path={`${APP_PATHS.KYBERAI_RANKINGS}`}
element={
<ProtectedRouteKyberAI redirectUrl={APP_PATHS.KYBERAI_ABOUT}>
<KyberAIExplore />
</ProtectedRouteKyberAI>
}
/>
<Route
path={`${APP_PATHS.KYBERAI_EXPLORE}`}
element={
<ProtectedRouteKyberAI redirectUrl={APP_PATHS.KYBERAI_ABOUT}>
<KyberAIExplore />
</ProtectedRouteKyberAI>
}
/>
<Route
path={`${APP_PATHS.KYBERAI_EXPLORE}/:chain/:address`}
element={
<ProtectedRouteKyberAI redirectUrl={APP_PATHS.KYBERAI_ABOUT}>
<KyberAIExplore />
</ProtectedRouteKyberAI>
}
/>
<Route path={`${APP_PATHS.BUY_CRYPTO}`} element={<BuyCrypto />} />
<Route path={`${APP_PATHS.CAMPAIGN}`} element={<Campaign />} />
<Route path={`${APP_PATHS.CAMPAIGN}/:slug`} element={<Campaign />} />
Expand Down

0 comments on commit 4beb76a

Please sign in to comment.