Pull in prefix settings in apps-config (#2322)

This commit is contained in:
Jaco Greeff 2020-03-02 09:13:22 +01:00 committed by GitHub
parent 2b44a1797a
commit 3d0eb4e8c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 11 deletions

View File

@ -2,10 +2,12 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import availableLanguages from './languages';
import availableEndpoints from './endpoints';
import availableLanguages from './languages';
import availableSs58 from './ss58';
export {
availableEndpoints,
availableLanguages
availableLanguages,
availableSs58
};

View File

@ -18,10 +18,4 @@ export default [
text: '汉语',
value: 'zh'
}
// For ja, we only have the settings page, remove until comprehensive
// ,
// {
// text: '日本語',
// value: 'ja'
// }
] as Option[];
].map((option): Option => ({ ...option, withI18n: false }));

View File

@ -0,0 +1,38 @@
// Copyright 2017-2020 @polkadot/ui-settings authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Option } from './types';
export default [
{
info: 'default',
text: 'Default for the connected node',
value: -1
},
{
info: 'substrate',
text: 'Substrate (generic)',
value: 42
},
{
info: 'polkadot',
text: 'Polkadot (live)',
value: 0
},
{
info: 'kusama',
text: 'Kusama (canary)',
value: 2
},
{
info: 'edgeware',
text: 'Edgeware (live)',
value: 7
},
{
info: 'centrifuge',
text: 'Centrifuge (live)',
value: 36
}
].map((option): Option => ({ ...option, withI18n: true }));

View File

@ -5,7 +5,7 @@
import { Option } from '@polkadot/apps-config/settings/types';
import React, { useEffect, useState, useMemo } from 'react';
import { availableLanguages } from '@polkadot/apps-config/settings';
import { availableLanguages, availableSs58 } from '@polkadot/apps-config/settings';
import { isLedgerCapable } from '@polkadot/react-api';
import { Button, ButtonCancel, Dropdown } from '@polkadot/react-components';
import uiSettings, { SettingsStruct } from '@polkadot/ui-settings';
@ -31,7 +31,7 @@ export default function General ({ className, isModalContent, onClose }: Props):
return uiSettings.availableIcons.map((o): Option => createIdenticon(t, o, ['default']));
}, [t]);
const prefixOptions = useMemo((): Option[] => {
return uiSettings.availablePrefixes.map((o): Option => createOption(t, o, ['default']));
return availableSs58.map((o): Option => createOption(t, o, ['default']));
}, [t]);
const translateLanguages = useMemo((): Option[] => {
return availableLanguages.map(({ text, value, withI18n }) => ({