-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚡ [FEAT]: Add swicth in Settings to enable/disable MarketPerformanceW…
…idget
- Loading branch information
1 parent
6701d2f
commit c209fd6
Showing
4 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"ledger-live-desktop": patch | ||
--- | ||
|
||
Add swith in Settings to enable/disable MArketPerformanceWidget" |
28 changes: 28 additions & 0 deletions
28
...r-live-desktop/src/renderer/screens/settings/sections/General/MarketPerformanceWidget.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from "react"; | ||
import Switch from "~/renderer/components/Switch"; | ||
import { useFeatureFlags } from "@ledgerhq/live-common/featureFlags/index"; | ||
import Track from "~/renderer/analytics/Track"; | ||
const MarketPerformanceWidgetRow = () => { | ||
const featureFlagsProvider = useFeatureFlags(); | ||
|
||
const currentValue = Boolean( | ||
featureFlagsProvider.getFeature("marketperformanceWidgetDesktop")?.enabled, | ||
); | ||
|
||
const update = (value: boolean) => { | ||
featureFlagsProvider.overrideFeature("marketperformanceWidgetDesktop", { enabled: value }); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Track | ||
onUpdate | ||
event={ | ||
currentValue ? "MarketPerformanceWidgetEnabled" : "MarketPerformanceWidgetRowDisabled" | ||
} | ||
/> | ||
<Switch isChecked={currentValue} onChange={() => update(!currentValue)} /> | ||
</> | ||
); | ||
}; | ||
export default MarketPerformanceWidgetRow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters