Add dnslink entry for Rococo (#3343)

This commit is contained in:
Jaco Greeff 2020-08-05 13:09:47 +02:00 committed by GitHub
parent eafba6df38
commit bb9bdc690a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 5 deletions

View File

@ -94,6 +94,7 @@ function createTest (t: TFunction): LinkOption[] {
value: 'wss://westend-rpc.polkadot.io'
},
{
dnslink: 'rococo',
info: 'rococo',
text: t<string>('rpc.rococo', 'Rococo (Polkadot Testnet, hosted by Parity)', { ns: 'apps-config' }),
value: 'wss://rococo-rpc.polkadot.io'

View File

@ -37,10 +37,12 @@ function ChainInfo ({ className = '', isToggled, onClick }: Props): React.ReactE
)}
<BestNumber label='#' />
</div>
<Icon
className='dropdown'
icon={isToggled ? 'caret-right' : 'caret-down'}
/>
{onClick && (
<Icon
className='dropdown'
icon={isToggled ? 'caret-right' : 'caret-down'}
/>
)}
</div>
</div>
);

View File

@ -8,6 +8,7 @@ import React, { useCallback, useMemo, useState } from 'react';
import styled from 'styled-components';
import createRoutes from '@polkadot/apps-routing';
import { Button, ChainImg, Icon, Menu, media } from '@polkadot/react-components';
import { useIpfs } from '@polkadot/react-hooks';
import { SIDEBAR_MENU_THRESHOLD } from '../constants';
import { useTranslation } from '../translate';
@ -31,6 +32,7 @@ const MENU_WIDTH_EXPANDED = '12rem';
function AppsSidebar ({ className = '', collapse, handleResize, isCollapsed, isMenuOpen, toggleMenu }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const { ipnsChain } = useIpfs();
const [modals, setModals] = useState<Record<string, boolean>>(
createRoutes(t).reduce((result: Record<string, boolean>, route): Record<string, boolean> => {
if (route && route.Modal) {
@ -87,7 +89,11 @@ function AppsSidebar ({ className = '', collapse, handleResize, isCollapsed, isM
<div className='apps--SideBar-Scroll'>
<ChainInfo
isToggled={modals.network}
onClick={_toggleModal('network')}
onClick={
ipnsChain
? undefined
: _toggleModal('network')
}
/>
{routing.map((route, index): React.ReactNode => (
route