mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* add global setting to change between local and utc time * add control to change time format on detailed views * tweaks * adapt uptime graphs to work with utc time from settings * fix tests * add maxDiffPixels for SearchResults test * fix test
33 lines
894 B
TypeScript
33 lines
894 B
TypeScript
import React from 'react';
|
|
|
|
import config from 'configs/app';
|
|
import { BECH_32_SEPARATOR } from 'lib/address/bech32';
|
|
import { useSettingsContext } from 'lib/contexts/settings';
|
|
import { Switch } from 'toolkit/chakra/switch';
|
|
|
|
const SettingsAddressFormat = () => {
|
|
const settingsContext = useSettingsContext();
|
|
|
|
if (!settingsContext || config.UI.views.address.hashFormat.availableFormats.length < 2) {
|
|
return null;
|
|
}
|
|
|
|
const { addressFormat, toggleAddressFormat } = settingsContext;
|
|
|
|
return (
|
|
<Switch
|
|
id="address-format"
|
|
defaultChecked={ addressFormat === 'bech32' }
|
|
onChange={ toggleAddressFormat }
|
|
mt={ 4 }
|
|
direction="rtl"
|
|
justifyContent="space-between"
|
|
w="100%"
|
|
>
|
|
Show { config.UI.views.address.hashFormat.bech32Prefix }{ BECH_32_SEPARATOR } format
|
|
</Switch>
|
|
);
|
|
};
|
|
|
|
export default React.memo(SettingsAddressFormat);
|