Skip to content

Commit 6ebebfe

Browse files
committed
Rename useCurrentChainSymbolicName to useCurrentChainKey
1 parent 7a60e3c commit 6ebebfe

30 files changed

+104
-117
lines changed

src/components/ActionBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import Tabs, { Tab } from '~/shared/components/Tabs'
2020
import { useWalletAccount } from '~/shared/stores/wallet'
2121
import { TheGraph } from '~/shared/types'
2222
import { ProjectFilter } from '~/types'
23-
import { useCurrentChainSymbolicName } from '~/utils/chains'
23+
import { useCurrentChainKey } from '~/utils/chains'
2424
import { Route as R, routeOptions } from '~/utils/routes'
2525

2626
export enum TabOption {
@@ -73,7 +73,7 @@ const UnstyledActionBar = ({
7373

7474
const navigate = useNavigate()
7575

76-
const chainName = useCurrentChainSymbolicName()
76+
const chainName = useCurrentChainKey()
7777

7878
return (
7979
<ActionBarContainer {...props}>

src/components/ActionBars/AboutSponsorship.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { SponsorshipPaymentTokenName } from '~/components/SponsorshipPaymentToke
1414
import { ExternalLinkIcon } from '~/icons'
1515
import { Sponsorship } from '~/parsers/Sponsorship'
1616
import { truncateStreamName } from '~/shared/utils/text'
17-
import { useCurrentChainSymbolicName } from '~/utils/chains'
17+
import { useCurrentChainKey } from '~/utils/chains'
1818
import { Route as R, routeOptions } from '~/utils/routes'
1919

2020
interface AboutSponsorshipProps {
@@ -24,7 +24,7 @@ interface AboutSponsorshipProps {
2424
export function AboutSponsorship({ sponsorship }: AboutSponsorshipProps) {
2525
const { streamId } = sponsorship
2626

27-
const chainName = useCurrentChainSymbolicName()
27+
const chainName = useCurrentChainKey()
2828

2929
return (
3030
<DefaultSimpleDropdownMenu>

src/components/ActionBars/SponsorshipActionBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import SvgIcon from '~/shared/components/SvgIcon'
2626
import { useWalletAccount } from '~/shared/stores/wallet'
2727
import { COLORS } from '~/shared/utils/styled'
2828
import { truncate, truncateStreamName } from '~/shared/utils/text'
29-
import { useCurrentChainId, useCurrentChainSymbolicName } from '~/utils/chains'
29+
import { useCurrentChainId, useCurrentChainKey } from '~/utils/chains'
3030
import { Route as R, routeOptions } from '~/utils/routes'
3131
import { isSponsorshipFundedByOperator } from '~/utils/sponsorships'
3232
import { AbstractActionBar } from './AbstractActionBar'
@@ -73,7 +73,7 @@ export function SponsorshipActionBar({ sponsorship }: SponsorshipActionBarProps)
7373

7474
const chainId = useCurrentChainId()
7575

76-
const chainName = useCurrentChainSymbolicName()
76+
const chainName = useCurrentChainKey()
7777

7878
return (
7979
<AbstractActionBar

src/components/Footer.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import React from 'react'
2-
import styled from 'styled-components'
31
import {
4-
Footer as UnstyledLayoutFooter,
52
FooterColumn,
3+
SocialChannels,
64
FooterColumns as UnstyledFooterColumns,
5+
Footer as UnstyledLayoutFooter,
76
MadeBy as UnstyledMadeBy,
8-
SocialChannels,
97
} from '@streamr/streamr-layout'
8+
import React from 'react'
9+
import styled from 'styled-components'
1010
import { COLORS } from '~/shared/utils/styled'
11+
import { useCurrentChainKey } from '~/utils/chains'
1112
import { Route as R, routeOptions } from '~/utils/routes'
12-
import { useCurrentChainSymbolicName } from '~/utils/chains'
1313

1414
const MadeBy = styled(UnstyledMadeBy)`
1515
padding: 0 0 32px;
@@ -30,7 +30,7 @@ const FooterColumns = styled(UnstyledFooterColumns)`
3030
`
3131

3232
const Footer = ({ topBorder = false }) => {
33-
const chainName = useCurrentChainSymbolicName()
33+
const chainName = useCurrentChainKey()
3434

3535
return (
3636
<LayoutFooter>

src/components/Nav/NetworkAccordion.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Link, useLocation } from 'react-router-dom'
33
import styled, { css } from 'styled-components'
44
import SvgIcon from '~/shared/components/SvgIcon'
55
import { COLORS, MEDIUM, REGULAR } from '~/shared/utils/styled'
6+
import { useCurrentChainKey } from '~/utils/chains'
67
import { Route as R, routeOptions } from '~/utils/routes'
7-
import { useCurrentChainSymbolicName } from '~/utils/chains'
88
import { NavLink, NavbarLinkMobile } from './Nav.styles'
99
import { NetworkNavItems, isNetworkTabActive } from './NetworkDropdown'
1010

@@ -13,7 +13,7 @@ export function NetworkAccordion() {
1313

1414
const [isOpen, toggle] = useReducer((x) => !x, false)
1515

16-
const chainName = useCurrentChainSymbolicName()
16+
const chainName = useCurrentChainKey()
1717

1818
return (
1919
<>

src/components/Nav/NetworkDropdown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { NavLink, NavbarLinkDesktop } from '~/components/Nav/Nav.styles'
55
import { DefaultSimpleDropdownMenu, SimpleDropdown } from '~/components/SimpleDropdown'
66
import SvgIcon from '~/shared/components/SvgIcon'
77
import { COLORS } from '~/shared/utils/styled'
8-
import { useCurrentChainSymbolicName } from '~/utils/chains'
8+
import { useCurrentChainKey } from '~/utils/chains'
99
import { Route as R, routeOptions } from '~/utils/routes'
1010

1111
export function Dropdown() {
@@ -39,7 +39,7 @@ export function Dropdown() {
3939
}, 250)
4040
}
4141

42-
const chainName = useCurrentChainSymbolicName()
42+
const chainName = useCurrentChainKey()
4343

4444
return (
4545
<NavbarLinkDesktop highlight={isOpen || isNetworkTabActive(pathname)}>

src/components/Nav/index.tsx

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1+
import { Button, HamburgerButton, Logo, NavOverlay } from '@streamr/streamr-layout'
12
import React, { FunctionComponent, HTMLAttributes } from 'react'
3+
import { Link, useLocation, useNavigate } from 'react-router-dom'
24
import styled from 'styled-components'
3-
import { useLocation, Link, useNavigate } from 'react-router-dom'
4-
import { Button, HamburgerButton, Logo, NavOverlay } from '@streamr/streamr-layout'
5-
import { DESKTOP, TABLET } from '~/shared/utils/styled'
6-
import SvgIcon from '~/shared/components/SvgIcon'
7-
import { truncate } from '~/shared/utils/text'
5+
import { ChainSelector as UnstyledChainSelector } from '~/components/ChainSelector'
6+
import { useMediaQuery } from '~/hooks'
7+
import { useOperatorForWalletQuery } from '~/hooks/operators'
88
import { connectModal } from '~/modals/ConnectModal'
9+
import SvgIcon from '~/shared/components/SvgIcon'
910
import { useEns, useWalletAccount } from '~/shared/stores/wallet'
10-
import toast from '~/utils/toast'
11-
import { useOperatorForWalletQuery } from '~/hooks/operators'
11+
import { DESKTOP, TABLET } from '~/shared/utils/styled'
12+
import { truncate } from '~/shared/utils/text'
1213
import { saveOperator } from '~/utils'
13-
import { useMediaQuery } from '~/hooks'
14-
import { ChainSelector as UnstyledChainSelector } from '~/components/ChainSelector'
15-
import { useCurrentChainId } from '~/utils/chains'
14+
import { useCurrentChainId, useCurrentChainKey } from '~/utils/chains'
1615
import { Route as R, routeOptions } from '~/utils/routes'
17-
import { useCurrentChainSymbolicName } from '~/utils/chains'
18-
import { Avatarless, Name, Username } from './User'
16+
import toast from '~/utils/toast'
1917
import {
2018
Avatar,
2119
LogoLink,
@@ -36,8 +34,9 @@ import {
3634
UserInfoMobile,
3735
WalletAddress,
3836
} from './Nav.styles'
39-
import { Dropdown } from './NetworkDropdown'
4037
import { NetworkAccordion } from './NetworkAccordion'
38+
import { Dropdown } from './NetworkDropdown'
39+
import { Avatarless, Name, Username } from './User'
4140

4241
const UnstyledDesktopNav: FunctionComponent = (props) => {
4342
const { pathname } = useLocation()
@@ -56,7 +55,7 @@ const UnstyledDesktopNav: FunctionComponent = (props) => {
5655

5756
const chainId = useCurrentChainId()
5857

59-
const chainName = useCurrentChainSymbolicName()
58+
const chainName = useCurrentChainKey()
6059

6160
return (
6261
<div {...props} data-testid={'desktop-nav'}>
@@ -202,7 +201,7 @@ const UnstyledMobileNav: FunctionComponent<{ className?: string }> = ({ classNam
202201

203202
const { pathname } = useLocation()
204203

205-
const chainName = useCurrentChainSymbolicName()
204+
const chainName = useCurrentChainKey()
206205

207206
return (
208207
<NavOverlay className={className}>

src/components/QueriedSponsorshipsTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { Sponsorship } from '~/parsers/Sponsorship'
2020
import { ScrollTableCore } from '~/shared/components/ScrollTable/ScrollTable'
2121
import { useWalletAccount } from '~/shared/stores/wallet'
2222
import { OrderDirection } from '~/types'
23-
import { useCurrentChainId, useCurrentChainSymbolicName } from '~/utils/chains'
23+
import { useCurrentChainId, useCurrentChainKey } from '~/utils/chains'
2424
import { Route as R, routeOptions } from '~/utils/routes'
2525
import { isSponsorshipFundedByOperator } from '~/utils/sponsorships'
2626

@@ -53,7 +53,7 @@ export function QueriedSponsorshipsTable({
5353

5454
const chainId = useCurrentChainId()
5555

56-
const chainName = useCurrentChainSymbolicName()
56+
const chainName = useCurrentChainKey()
5757

5858
const fundSponsorship = useFundSponsorshipCallback()
5959

src/components/QueriedStreamsTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from '~/hooks/streams'
1313
import { ScrollTableCore } from '~/shared/components/ScrollTable/ScrollTable'
1414
import { OrderDirection } from '~/types'
15-
import { useCurrentChainId, useCurrentChainSymbolicName } from '~/utils/chains'
15+
import { useCurrentChainId, useCurrentChainKey } from '~/utils/chains'
1616
import { Route as R, routeOptions } from '~/utils/routes'
1717

1818
interface Props {
@@ -42,7 +42,7 @@ export function QueriedStreamsTable({
4242

4343
const chainId = useCurrentChainId()
4444

45-
const chainName = useCurrentChainSymbolicName()
45+
const chainName = useCurrentChainKey()
4646

4747
const indexerQueryErrored = query.isError && isIndexerColumn(chainId, orderBy)
4848

src/marketplace/components/ProjectTypeChooser/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import SvgIcon from '~/shared/components/SvgIcon'
1515
import { useWalletAccount } from '~/shared/stores/wallet'
1616
import { ProjectType } from '~/shared/types'
1717
import { COLORS, DESKTOP, REGULAR } from '~/shared/utils/styled'
18-
import { useCurrentChainId, useCurrentChainSymbolicName } from '~/utils/chains'
18+
import { useCurrentChainId, useCurrentChainKey } from '~/utils/chains'
1919
import { Route as R, routeOptions } from '~/utils/routes'
2020

2121
const Root = styled.div`
@@ -176,7 +176,7 @@ export const ProjectTypeChooser: FunctionComponent<{
176176
}> = ({ className, onClose }) => {
177177
const [selectedProductType, setSelectedProductType] = useState<ProjectType>()
178178

179-
const chainName = useCurrentChainSymbolicName()
179+
const chainName = useCurrentChainKey()
180180

181181
const link = useMemo<string | null>(() => {
182182
if (!selectedProductType) {

0 commit comments

Comments
 (0)