mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-10-20 18:56:22 +00:00
The address format list had an entry per network, and Pezkuwi, Zagros and Bizinikiwi all use prefix 42, so it showed three options with the same value; choosing one could not be told apart from the others. prefixOptions keeps one option per prefix and lists every network using it in its text. ui-settings gets the tsconfig.spec.json the other packages with specs have, so the build leaves the spec out.
@pezkuwi/ui-settings
Manages app settings including endpoints, themes and prefixes
Usage Examples
User preferences are set as a settings object in the browser's local storage.
import settings from '@pezkuwi/ui-settings';
render () {
// get api endpoint for the selected chain
const WS_URL = settings.apiUrl();
// get the selected il8n language
const language = settings.il8nLang();
// get all available il8n languages
const languages = settings.availableLanguages();
// update settings
const updatedSettings = {
...settings,
i18nLang: 'Arabic'
}
settings.set(updatedSettings);
// NOTE: API currently does not handle hot reconnecting properly,
so you need to manually reload the page after updating settings.
window.location.reload();
}
Used by
Apps that currently use the settings package