Settings for icon (#206)

This commit is contained in:
Jaco Greeff
2019-09-13 13:58:26 +02:00
committed by GitHub
parent 209cb4d815
commit 3f253ddbe1
8 changed files with 112 additions and 48 deletions
+3 -35
View File
@@ -7,7 +7,7 @@ import { Option } from '../types';
import { CRYPTOS } from './crypto';
import { ENDPOINTS, ENDPOINT_DEFAULT } from './endpoints';
import { PREFIXES, PREFIX_DEFAULT } from './ss58';
import { isPolkadot } from './type';
import { ICON_DEFAULT, ICONS, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES } from './ui';
const LANGUAGE_DEFAULT = 'default';
@@ -34,44 +34,12 @@ const LOCKING: Option[] = [
}
];
const UIMODE_DEFAULT = !isPolkadot && typeof window !== 'undefined' && window.location.host.includes('ui-light')
? 'light'
: 'full';
const UIMODES: Option[] = [
{
info: 'full',
text: 'Fully featured',
value: 'full'
},
{
info: 'light',
text: 'Basic features only',
value: 'light'
}
];
const UITHEME_DEFAULT = isPolkadot
? 'polkadot'
: 'substrate';
const UITHEMES: Option[] = [
{
info: 'polkadot',
text: 'Polkadot',
value: 'polkadot'
},
{
info: 'substrate',
text: 'Substrate',
value: 'substrate'
}
];
export {
CRYPTOS,
ENDPOINT_DEFAULT,
ENDPOINTS,
ICON_DEFAULT,
ICONS,
LANGUAGE_DEFAULT,
LANGUAGES,
LOCKING_DEFAULT,
+80
View File
@@ -0,0 +1,80 @@
// Copyright 2017-2019 @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';
import { isPolkadot } from './type';
const LANGUAGE_DEFAULT = 'default';
const UIMODE_DEFAULT = !isPolkadot && typeof window !== 'undefined' && window.location.host.includes('ui-light')
? 'light'
: 'full';
const UIMODES: Option[] = [
{
info: 'full',
text: 'Fully featured',
value: 'full'
},
{
info: 'light',
text: 'Basic features only',
value: 'light'
}
];
const UITHEME_DEFAULT = isPolkadot
? 'polkadot'
: 'substrate';
const UITHEMES: Option[] = [
{
info: 'polkadot',
text: 'Polkadot',
value: 'polkadot'
},
{
info: 'substrate',
text: 'Substrate',
value: 'substrate'
}
];
const ICON_DEFAULT = isPolkadot
? 'polkadot'
: 'substrate';
const ICONS: Option[] = [
{
info: 'default',
text: 'Default for the connected node',
value: -1
},
{
info: 'polkadot',
text: 'Polkadot',
value: 'polkadot'
},
{
info: 'substrate',
text: 'Substrate',
value: 'substrate'
},
{
info: 'beachball',
text: 'Beachball',
value: 'beachball'
}
];
export {
ICON_DEFAULT,
ICONS,
LANGUAGE_DEFAULT,
UIMODE_DEFAULT,
UIMODES,
UITHEME_DEFAULT,
UITHEMES
};