-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dApp: Your balance - tooltip for in progress deposits (#908)
Closes: AENG-47 ### Changes - `useActivities` hook: added status whether at least one of activity is pending - `PositionDetails` component: depending on the activities status conditionally rendered the tooltip - `Tooltip` component: added `wrapperProps` prop to provide more control over styling of the component
- Loading branch information
Showing
10 changed files
with
57 additions
and
28 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import React, { useState } from "react" | ||
import { Box, Tooltip as ChakraTooltip, TooltipProps } from "@chakra-ui/react" | ||
import { Tooltip as ChakraTooltip, TooltipProps, Flex } from "@chakra-ui/react" | ||
|
||
export default function Tooltip(props: TooltipProps) { | ||
const { children, ...restProps } = props | ||
const [isOpen, setIsOpen] = useState(false) | ||
|
||
return ( | ||
<ChakraTooltip isOpen={isOpen} {...restProps}> | ||
<Box | ||
<Flex | ||
onMouseEnter={() => setIsOpen(true)} | ||
onMouseLeave={() => setIsOpen(false)} | ||
onClick={() => setIsOpen(true)} | ||
> | ||
{children} | ||
</Box> | ||
</Flex> | ||
</ChakraTooltip> | ||
) | ||
} |
13 changes: 9 additions & 4 deletions
13
dapp/src/components/shared/InfoTooltip.tsx → dapp/src/components/shared/TooltipIcon.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
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
import { selectActivities } from "#/store/wallet" | ||
import { selectActivities, selectHasPendingActivities } from "#/store/wallet" | ||
import { useAppSelector } from "./useAppSelector" | ||
|
||
export default function useActivities() { | ||
return useAppSelector(selectActivities) | ||
const activities = useAppSelector(selectActivities) | ||
const hasPendingActivities = useAppSelector(selectHasPendingActivities) | ||
|
||
return { activities, hasPendingActivities } | ||
} |
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
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
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