From 3cebdef0bbab7ed39ce27089ed99d873c924343c Mon Sep 17 00:00:00 2001 From: uncoolzero <107518216+uncoolzero@users.noreply.github.com> Date: Tue, 15 Aug 2023 12:56:09 -0300 Subject: [PATCH] Added more data to Price Button --- .../components/Nav/Buttons/PriceButton.tsx | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/projects/ui/src/components/Nav/Buttons/PriceButton.tsx b/projects/ui/src/components/Nav/Buttons/PriceButton.tsx index f538ddfa4f..ae2cad3fb8 100644 --- a/projects/ui/src/components/Nav/Buttons/PriceButton.tsx +++ b/projects/ui/src/components/Nav/Buttons/PriceButton.tsx @@ -17,6 +17,7 @@ import FolderMenu from '../FolderMenu'; // ------------------------------------------------------------ import { FC } from '~/types'; +import useDataFeedTokenPrices from '~/hooks/beanstalk/useDataFeedTokenPrices'; const PriceButton: FC = ({ ...props }) => { // Data @@ -26,9 +27,10 @@ const PriceButton: FC = ({ ...props }) => { const beanPools = useSelector( (state) => state._bean.pools ); - // const beanTokenData = useSelector( - // (state) => state._bean.token - // ); + const beanTokenData = useSelector( + (state) => state._bean.token + ); + const tokenPrices = useDataFeedTokenPrices(); const [_refetchPools] = useFetchPools(); const refetchPools = useMemo( () => throttle(_refetchPools, 10_000), @@ -63,9 +65,19 @@ const PriceButton: FC = ({ ...props }) => { /> ))}
- -
Combined deltaB:
-
{combinedDeltaB.gte(0) && '+'}{displayBN(combinedDeltaB, true)}
+ + +
Cumulative Instantaneous deltaB:
+
{combinedDeltaB.gte(0) && '+'}{displayBN(combinedDeltaB, true)}
+
+ +
Cumulative Time-Weighted deltaB:
+
{beanTokenData.deltaB.gte(0) && '+'}{displayBN(beanTokenData.deltaB, true)}
+
+ +
ETH Price:
+
${tokenPrices.eth?.toFixed(2) || 0}
+