Skip to content

Commit

Permalink
refractor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Damola18 committed May 9, 2024
1 parent 1eb494d commit ad21dc4
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,14 @@ const Home: NextPage = () => {
config.treasuryHiIQAddress,
)


const stakeGraphData = stakeData?.map((dt) => ({
amt: parseFloat(dt.amount),
name: new Date(dt.created).toISOString().slice(0, 10),
}))

const { data: iqData } = useGetIqPriceQuery('IQ')
const rate = iqData?.response?.data?.IQ[0]?.quote?.USD?.price || 0.0

const priceChange = {
[GraphPeriod.DAY]: marketData?.percent_change_24h,
[GraphPeriod.WEEK]: marketData?.percent_change_7d,
Expand All @@ -117,19 +116,16 @@ const Home: NextPage = () => {
const isFetchedData = useRef(false)
const { tvl } = useErc20()


const onPieEnter = useCallback<OnPieEnter>(
(_, index) => {
setActiveIndex(index)
},
[setActiveIndex],
)
const {
getRadioProps: getTokenRadioProps,
getRootProps: getTokenRootProps,
} = useRadioGroup({
defaultValue: StakeGraphPeriod['30DAYS'],
})
const { getRadioProps: getTokenRadioProps, getRootProps: getTokenRootProps } =
useRadioGroup({
defaultValue: StakeGraphPeriod['30DAYS'],
})

if (treasuryValue && treasuryGraphData) {
treasuryGraphData[treasuryGraphData.length - 1] = {
Expand Down Expand Up @@ -209,7 +205,6 @@ const Home: NextPage = () => {
const { colorMode } = useColorMode()
const isTokenFetched = useRef(false)


useEffect(() => {
if (!isFetchedData.current) {
isFetchedData.current = true
Expand Down Expand Up @@ -433,8 +428,6 @@ const Home: NextPage = () => {
/>
)
})}


</GraphComponent>
</Box>
</GridItem>
Expand Down

0 comments on commit ad21dc4

Please sign in to comment.