mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-11-25 18:26:28 -05:00
Reduce final useAppSelector((s) => s.settings.X) to useSettings((s) => s.X) (#390)
This commit is contained in:
parent
430a22fbf6
commit
8aad1bdf75
2 changed files with 4 additions and 6 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import { Tooltip } from "@mui/material";
|
import { Tooltip } from "@mui/material";
|
||||||
import { useAppSelector } from "store/hooks";
|
import { useAppSelector, useSettings } from "store/hooks";
|
||||||
import { getMarkup, piconerosToXmr, satsToBtc } from "utils/conversionUtils";
|
import { getMarkup, piconerosToXmr, satsToBtc } from "utils/conversionUtils";
|
||||||
|
|
||||||
type Amount = number | null | undefined;
|
type Amount = number | null | undefined;
|
||||||
|
|
@ -17,10 +17,9 @@ export function AmountWithUnit({
|
||||||
exchangeRate?: Amount;
|
exchangeRate?: Amount;
|
||||||
parenthesisText?: string;
|
parenthesisText?: string;
|
||||||
}) {
|
}) {
|
||||||
const fetchFiatPrices = useAppSelector(
|
const [fetchFiatPrices, fiatCurrency] = useSettings(
|
||||||
(state) => state.settings.fetchFiatPrices,
|
(settings) => [settings.fetchFiatPrices, settings.fiatCurrency],
|
||||||
);
|
);
|
||||||
const fiatCurrency = useAppSelector((state) => state.settings.fiatCurrency);
|
|
||||||
const title =
|
const title =
|
||||||
fetchFiatPrices &&
|
fetchFiatPrices &&
|
||||||
exchangeRate != null &&
|
exchangeRate != null &&
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ import {
|
||||||
} from "store/features/settingsSlice";
|
} from "store/features/settingsSlice";
|
||||||
import {
|
import {
|
||||||
useAppDispatch,
|
useAppDispatch,
|
||||||
useAppSelector,
|
|
||||||
useNodes,
|
useNodes,
|
||||||
useSettings,
|
useSettings,
|
||||||
} from "store/hooks";
|
} from "store/hooks";
|
||||||
|
|
@ -329,7 +328,7 @@ function MoneroNodeUrlSetting() {
|
||||||
* A setting that allows you to select the theme of the GUI.
|
* A setting that allows you to select the theme of the GUI.
|
||||||
*/
|
*/
|
||||||
function ThemeSetting() {
|
function ThemeSetting() {
|
||||||
const theme = useAppSelector((s) => s.settings.theme);
|
const theme = useSettings((s) => s.theme);
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue