Skip to content

Commit

Permalink
Merge pull request #473 from tanyas-codes/feature/tooltip
Browse files Browse the repository at this point in the history
added a  tooltip for fingertip duration for off-chain groups
  • Loading branch information
vplasencia authored Apr 4, 2024
2 parents 4afe4a0 + da919ab commit 367f7c6
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useState } from "react"
import {
Button,
HStack,
Expand All @@ -11,11 +12,22 @@ import {
Tag,
TagLabel,
Text,
VStack
VStack,
Box,
ChakraProvider,
extendTheme,
Tooltip
} from "@chakra-ui/react"
import { useState } from "react"
import { FiHardDrive, FiZap } from "react-icons/fi"
import { FaInfoCircle } from "react-icons/fa"
import capitalize from "../../utils/capitalize"
import { tooltipTheme } from "../../styles/components/tooltip"

const theme = extendTheme({
components: {
Tooltip: tooltipTheme
}
})

const groupTypes = ["off-chain", "on-chain"]

Expand Down Expand Up @@ -161,7 +173,34 @@ export default function GeneralInfoStep({
</VStack>

<VStack align="left" pt="20px">
<Text>Fingerprint duration</Text>
<span style={{ display: "flex", alignItems: "center" }}>
<Text marginRight="2">Fingerprint duration</Text>
<ChakraProvider theme={theme}>
<Tooltip
label={
<Box>
<Text>
A <b>fingerprint </b>is a unique
identifier for a group, changing
with any group modification.
</Text>
<Text>
The <b>fingerprint duration</b>{" "}
specifies how long old
fingerprints remain valid for
successful proof verification.
</Text>
</Box>
}
fontSize="md"
style={tooltipTheme.baseStyle}
>
<span>
<FaInfoCircle />
</span>
</Tooltip>
</ChakraProvider>
</span>

<NumberInput
min={0}
Expand Down
13 changes: 13 additions & 0 deletions apps/dashboard/src/styles/components/tooltip.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineStyleConfig } from "@chakra-ui/react"
import colors from "../colors"

const baseStyle = {
borderRadius: "md",
fontWeight: "normal",
border: "1px solid",
backgroundColor: colors.classicRose[50],
color: colors.sunsetOrange[500],
boxShadow: `0px 2px 4px ${colors.classicRose[300]}`
}

export const tooltipTheme = defineStyleConfig({ baseStyle })

0 comments on commit 367f7c6

Please sign in to comment.