-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from filipepacheco/feat/change-verified-badge-…
…color feat: change verified badge color, position and added tooltip
- Loading branch information
Showing
5 changed files
with
71 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { BadgeCheck } from 'lucide-react'; | ||
import WithTooltip from '@/components/ui/with-tooltip.tsx'; | ||
|
||
const VerifiedBadge = () => { | ||
return ( | ||
<WithTooltip content="Abrigo verificado"> | ||
<BadgeCheck className="h-5 w-5 stroke-white" fill="#1D61C8" /> | ||
</WithTooltip> | ||
) | ||
} | ||
|
||
export { VerifiedBadge }; |
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 * as Tooltip from '@radix-ui/react-tooltip'; | ||
import { useState, ReactNode } from 'react'; | ||
|
||
interface WithTooltipProps { | ||
children: ReactNode; | ||
content: string; | ||
} | ||
|
||
const WithTooltip = ({ children, content }: WithTooltipProps) => { | ||
const [open, setOpen] = useState(false); | ||
|
||
return ( | ||
<Tooltip.Provider> | ||
<Tooltip.Root open={open} onOpenChange={setOpen}> | ||
<Tooltip.Trigger asChild onClick={() => setOpen(!open)}> | ||
{children} | ||
</Tooltip.Trigger> | ||
<Tooltip.Portal> | ||
<Tooltip.Content className="text-white bg-gray-950 data-[state=delayed-open]:data-[side=top]:animate-slideDownAndFade data-[state=delayed-open]:data-[side=right]:animate-slideLeftAndFade data-[state=delayed-open]:data-[side=left]:animate-slideRightAndFade data-[state=delayed-open]:data-[side=bottom]:animate-slideUpAndFade text-violet11 select-none rounded-[4px] px-[15px] py-[10px] text-[12px] leading-none shadow-[hsl(206_22%_7%_/_35%)_0px_10px_38px_-10px,_hsl(206_22%_7%_/_20%)_0px_10px_20px_-15px] will-change-[transform,opacity]"> | ||
{content} | ||
</Tooltip.Content> | ||
</Tooltip.Portal> | ||
</Tooltip.Root> | ||
</Tooltip.Provider> | ||
); | ||
}; | ||
|
||
export default WithTooltip; |
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