-
Notifications
You must be signed in to change notification settings - Fork 1
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 #174 from wizelineacademy/dashboard-ui-fixes
Dashboard UI fixes
- Loading branch information
Showing
8 changed files
with
106 additions
and
15 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React from "react"; | ||
import { Tooltip } from "@mantine/core"; | ||
import InfoIcon from "@/components/icons/InfoIcon"; | ||
|
||
interface InfoToolTipProps { | ||
description: string; | ||
size?: "sm" | "md" | "lg"; | ||
} | ||
|
||
const InfoToolTip = ({ description, size }: InfoToolTipProps) => { | ||
let tooltipWidth; | ||
switch (size) { | ||
case "sm": | ||
tooltipWidth = 220; | ||
break; | ||
case "md": | ||
tooltipWidth = 280; | ||
break; | ||
case "lg": | ||
tooltipWidth = 360; | ||
break; | ||
default: | ||
tooltipWidth = 280; | ||
} | ||
|
||
return ( | ||
<div className="absolute right-6 top-6"> | ||
<Tooltip | ||
label={<span dangerouslySetInnerHTML={{ __html: description }} />} | ||
position="left-start" | ||
multiline | ||
w={tooltipWidth} | ||
transitionProps={{ duration: 200 }} | ||
offset={{ mainAxis: -20, crossAxis: 28 }} | ||
color="gray" | ||
> | ||
<button className="group"> | ||
<InfoIcon | ||
color="text-grayText group-hover:text-black transition-colors duration-200" | ||
size="h-6 w-6" | ||
/> | ||
</button> | ||
</Tooltip> | ||
</div> | ||
); | ||
}; | ||
|
||
export default InfoToolTip; |