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
31 lines
641 B
TypeScript
31 lines
641 B
TypeScript
import React from 'react';
|
|
|
|
import { useSettingsContext } from 'lib/contexts/settings';
|
|
import { Switch } from 'toolkit/chakra/switch';
|
|
|
|
const SettingsLocalTime = () => {
|
|
const settingsContext = useSettingsContext();
|
|
|
|
if (!settingsContext) {
|
|
return null;
|
|
}
|
|
|
|
const { isLocalTime, toggleIsLocalTime } = settingsContext;
|
|
|
|
return (
|
|
<Switch
|
|
id="local-time"
|
|
defaultChecked={ isLocalTime }
|
|
onChange={ toggleIsLocalTime }
|
|
direction="rtl"
|
|
justifyContent="space-between"
|
|
w="100%"
|
|
minH="34px"
|
|
>
|
|
Local time format
|
|
</Switch>
|
|
);
|
|
};
|
|
|
|
export default React.memo(SettingsLocalTime);
|