Skip to content

Commit

Permalink
update chain bridge assets links (#2213)
Browse files Browse the repository at this point in the history
* update chain bridge assets links

* update icon

* fix animating number in basic chart got all zero on initial
  • Loading branch information
XiaoYhun committed Sep 7, 2023
1 parent b4a7aaa commit ad3eab6
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 34 deletions.
15 changes: 11 additions & 4 deletions src/components/LiveChart/AnimatingNumber.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { motion } from 'framer-motion'
import { useRef } from 'react'
import { useCallback, useState } from 'react'
import { Flex, Text } from 'rebass'
import styled from 'styled-components'

Expand Down Expand Up @@ -50,11 +50,18 @@ const TickerColumn = styled(motion.div)`
`

function NumberColumn({ digit, fontSize }: { digit: number; fontSize: number }) {
const columnContainer = useRef<HTMLDivElement>()
const y = (columnContainer.current?.clientHeight || 0) * digit ?? 0
const [clientHeight, setClientHeight] = useState(0)

const columnContainerRef = useCallback((node: HTMLDivElement) => {
if (node !== null) {
setClientHeight(node.clientHeight)
}
}, [])

const y = (clientHeight || 0) * digit ?? 0

return (
<Container ref={columnContainer as any} fontSize={fontSize}>
<Container ref={columnContainerRef} fontSize={fontSize}>
<TickerColumn animate={{ y }} transition={{ type: 'spring', stiffness: 400, damping: 25 }}>
{[9, 8, 7, 6, 5, 4, 3, 2, 1, 0].map(num => (
<TickerDigit key={num}>{num}</TickerDigit>
Expand Down
16 changes: 3 additions & 13 deletions src/components/Menu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
import { Trans, t } from '@lingui/macro'
import { useEffect, useState } from 'react'
import { isMobile } from 'react-device-detect'
import {
Award,
BookOpen,
ChevronDown,
Edit,
FileText,
HelpCircle,
Info,
MessageCircle,
PieChart,
Share2,
} from 'react-feather'
import { Award, BookOpen, ChevronDown, Edit, FileText, HelpCircle, Info, MessageCircle, PieChart } from 'react-feather'
import { NavLink, useLocation, useNavigate } from 'react-router-dom'
import { useMedia } from 'react-use'
import { Text } from 'rebass'
import styled, { css } from 'styled-components'

import { ReactComponent as MenuIcon } from 'assets/svg/all_icon.svg'
import { ReactComponent as BlogIcon } from 'assets/svg/blog.svg'
import { ReactComponent as BridgeIcon } from 'assets/svg/bridge_icon.svg'
import { ReactComponent as LightIcon } from 'assets/svg/light.svg'
import { ReactComponent as RoadMapIcon } from 'assets/svg/roadmap.svg'
import { ButtonEmpty, ButtonPrimary } from 'components/Button'
Expand Down Expand Up @@ -332,7 +322,7 @@ export default function Menu() {
{bridgeLink && (
<MenuItem>
<ExternalLink href={bridgeLink}>
<Share2 />
<BridgeIcon />
<Trans>Bridge Assets</Trans>
</ExternalLink>
</MenuItem>
Expand Down
3 changes: 1 addition & 2 deletions src/constants/networks/arbitrum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import EthereumLogo from 'assets/images/ethereum-logo.png'
import ARBITRUM from 'assets/networks/arbitrum-network.svg'
import { EVMNetworkInfo } from 'constants/networks/type'

const EMPTY = ''
const EMPTY_ARRAY: any[] = []
const NOT_SUPPORT = null

Expand All @@ -23,7 +22,7 @@ const arbitrumInfo: EVMNetworkInfo = {
defaultBlockSubgraph: 'https://api.thegraph.com/subgraphs/name/kybernetwork/arbitrum-blocks',
etherscanUrl: 'https://arbiscan.io',
etherscanName: 'Arbiscan',
bridgeURL: EMPTY,
bridgeURL: 'https://bridge.arbitrum.io/',
nativeToken: {
symbol: 'ETH',
name: 'ETH',
Expand Down
3 changes: 1 addition & 2 deletions src/constants/networks/avax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ChainId } from '@kyberswap/ks-sdk-core'

import { EVMNetworkInfo } from 'constants/networks/type'

const EMPTY = ''
const NOT_SUPPORT = null

const avaxInfo: EVMNetworkInfo = {
Expand All @@ -20,7 +19,7 @@ const avaxInfo: EVMNetworkInfo = {
defaultBlockSubgraph: 'https://api.thegraph.com/subgraphs/name/ducquangkstn/avalache-blocks',
etherscanUrl: 'https://snowtrace.io',
etherscanName: 'Snowtrace',
bridgeURL: EMPTY,
bridgeURL: 'https://core.app/bridge',
nativeToken: {
symbol: 'AVAX',
name: 'AVAX',
Expand Down
3 changes: 1 addition & 2 deletions src/constants/networks/bnb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { ChainId } from '@kyberswap/ks-sdk-core'
import BnbLogo from 'assets/images/bnb-logo.png'
import { EVMNetworkInfo } from 'constants/networks/type'

const EMPTY = ''
const NOT_SUPPORT = null

const bnbInfo: EVMNetworkInfo = {
Expand All @@ -21,7 +20,7 @@ const bnbInfo: EVMNetworkInfo = {
defaultBlockSubgraph: 'https://api.thegraph.com/subgraphs/name/dynamic-amm/ethereum-blocks-bsc',
etherscanUrl: 'https://bscscan.com',
etherscanName: 'BscScan',
bridgeURL: EMPTY,
bridgeURL: 'https://www.bnbchain.org/en/bridge',
nativeToken: {
symbol: 'BNB',
name: 'BNB',
Expand Down
2 changes: 1 addition & 1 deletion src/constants/networks/bttc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const bttcInfo: EVMNetworkInfo = {
defaultBlockSubgraph: 'https://bttc-graph.kyberengineering.io/subgraphs/name/kybernetwork/bttc-blocks',
etherscanUrl: 'https://bttcscan.com',
etherscanName: 'Bttcscan',
bridgeURL: EMPTY,
bridgeURL: 'https://bttc.bittorrent.com/bridge/',
nativeToken: {
symbol: 'BTT',
name: 'BTT',
Expand Down
3 changes: 1 addition & 2 deletions src/constants/networks/cronos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import CRONOS from 'assets/networks/cronos-network.svg'
import CronosLogo from 'assets/svg/cronos-token-logo.svg'
import { EVMNetworkInfo } from 'constants/networks/type'

const EMPTY = ''
const EMPTY_ARRAY: any[] = []
const NOT_SUPPORT = null

Expand All @@ -24,7 +23,7 @@ const cronosInfo: EVMNetworkInfo = {
defaultBlockSubgraph: 'https://cronos-graph.kyberengineering.io/subgraphs/name/kybernetwork/cronos-blocks',
etherscanUrl: 'https://cronoscan.com',
etherscanName: 'Cronos explorer',
bridgeURL: EMPTY,
bridgeURL: 'https://cronos.org/bridge/',
nativeToken: {
symbol: 'CRO',
name: 'CRO',
Expand Down
2 changes: 1 addition & 1 deletion src/constants/networks/linea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const lineaInfo: EVMNetworkInfo = {
defaultBlockSubgraph: 'https://graph-query.linea.build/subgraphs/name/kybernetwork/linea-blocks',
etherscanUrl: 'https://lineascan.build',
etherscanName: 'Linea Explorer',
bridgeURL: EMPTY,
bridgeURL: 'https://bridge.linea.build/',
nativeToken: {
symbol: 'ETH',
name: 'LineaETH',
Expand Down
3 changes: 1 addition & 2 deletions src/constants/networks/matic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ChainId } from '@kyberswap/ks-sdk-core'

import { EVMNetworkInfo } from 'constants/networks/type'

const EMPTY = ''
const NOT_SUPPORT = null

const maticInfo: EVMNetworkInfo = {
Expand All @@ -20,7 +19,7 @@ const maticInfo: EVMNetworkInfo = {
defaultBlockSubgraph: 'https://api.thegraph.com/subgraphs/name/dynamic-amm/ethereum-blocks-polygon',
etherscanUrl: 'https://polygonscan.com',
etherscanName: 'Polygonscan',
bridgeURL: EMPTY,
bridgeURL: 'https://wallet.polygon.technology/',
nativeToken: {
symbol: 'MATIC',
name: 'Polygon',
Expand Down
3 changes: 1 addition & 2 deletions src/constants/networks/optimism.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import EthereumLogo from 'assets/images/ethereum-logo.png'
import OPTIMISM from 'assets/networks/optimism-network.svg'
import { EVMNetworkInfo } from 'constants/networks/type'

const EMPTY = ''
const EMPTY_ARRAY: any[] = []
const NOT_SUPPORT = null

Expand All @@ -23,7 +22,7 @@ const optimismInfo: EVMNetworkInfo = {
defaultBlockSubgraph: 'https://api.thegraph.com/subgraphs/name/ianlapham/uni-testing-subgraph',
etherscanUrl: 'https://optimistic.etherscan.io',
etherscanName: 'Optimistic Ethereum Explorer',
bridgeURL: EMPTY,
bridgeURL: 'https://app.optimism.io/bridge/deposit',
nativeToken: {
symbol: 'ETH',
name: 'ETH',
Expand Down
2 changes: 1 addition & 1 deletion src/constants/networks/zkevm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const zkEvm: EVMNetworkInfo = {
'https://polygon-zkevm-graph.kyberengineering.io/subgraphs/name/kybernetwork/polygon-zkevm-blocks',
etherscanUrl: 'https://zkevm.polygonscan.com',
etherscanName: 'Polygon zkEVM Explorer',
bridgeURL: EMPTY,
bridgeURL: 'https://wallet.polygon.technology/',
nativeToken: {
symbol: 'ETH',
name: 'ETH',
Expand Down
3 changes: 1 addition & 2 deletions src/constants/networks/zksync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { ChainId } from '@kyberswap/ks-sdk-core'
import EthereumLogo from 'assets/images/ethereum-logo.png'
import { EVMNetworkInfo } from 'constants/networks/type'

const EMPTY = ''
const EMPTY_ARRAY: any[] = []
const NOT_SUPPORT = null

Expand All @@ -24,7 +23,7 @@ const zkSyncInfo: EVMNetworkInfo = {
defaultBlockSubgraph: 'https://zksync-graph.kyberengineering.io/subgraphs/name/kybernetwork/zksync-blocks',
etherscanUrl: 'https://explorer.zksync.io',
etherscanName: 'zkSync Era Explorer',
bridgeURL: EMPTY,
bridgeURL: 'https://portal.zksync.io/bridge/',
nativeToken: {
symbol: 'ETH',
name: 'ETH',
Expand Down

0 comments on commit ad3eab6

Please sign in to comment.