Files
tom goriunovandGitHub 1c025b26fb Add possibility to change timestamp format (#3201)
* 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
2026-01-05 13:19:47 +01:00

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);