feat: Add buildTrigger ShadTooltip

This commit is contained in:
Igor Carvalho 2023-06-17 12:05:58 -03:00
commit 1c55a722fe
3 changed files with 28 additions and 21 deletions

View file

@ -8,6 +8,7 @@ import { useSSE } from "../../../contexts/SSEContext";
import { typesContext } from "../../../contexts/typesContext"; import { typesContext } from "../../../contexts/typesContext";
import { alertContext } from "../../../contexts/alertContext"; import { alertContext } from "../../../contexts/alertContext";
import { postBuildInit } from "../../../controllers/API"; import { postBuildInit } from "../../../controllers/API";
import ShadTooltip from "../../ShadTooltipComponent";
export default function BuildTrigger({ export default function BuildTrigger({
open, open,
@ -135,6 +136,11 @@ export default function BuildTrigger({
leaveTo="translate-y-96" leaveTo="translate-y-96"
> >
<div className={`fixed right-4` + (isBuilt ? " bottom-20" : " bottom-4")}> <div className={`fixed right-4` + (isBuilt ? " bottom-20" : " bottom-4")}>
<ShadTooltip
delayDuration={500}
content="Build Flow"
side="left"
>
<div <div
className="flex justify-center align-center py-1 px-3 w-12 h-12 rounded-full shadow-md hover:shadow-sm shadow-[#00000063] hover:shadow-[#00000063] className="flex justify-center align-center py-1 px-3 w-12 h-12 rounded-full shadow-md hover:shadow-sm shadow-[#00000063] hover:shadow-[#00000063]
bg-[#E2E7EE] dark:border-gray-600 cursor-pointer" bg-[#E2E7EE] dark:border-gray-600 cursor-pointer"
@ -146,13 +152,14 @@ export default function BuildTrigger({
<div className="flex gap-3 items-center"> <div className="flex gap-3 items-center">
{isBuilding ? ( {isBuilding ? (
// Render your loading animation here when isBuilding is true // Render your loading animation here when isBuilding is true
<Loading strokeWidth={1.5} style={{ color: "white" }} /> <Loading strokeWidth={1.5} style={{ color: "#dc735b" }} />
) : ( ) : (
<Zap className="sh-6 w-6 fill-[#dc735b] stroke-1 stroke-[#dc735b]"/> <Zap className="sh-6 w-6 fill-[#dc735b] stroke-1 stroke-[#dc735b]"/>
)} )}
</div> </div>
</button> </button>
</div> </div>
</ShadTooltip>
</div> </div>
</Transition> </Transition>
); );

View file

@ -158,13 +158,13 @@ export default function ExtraSidebar() {
.map((t: string, k) => ( .map((t: string, k) => (
<ShadTooltip <ShadTooltip
content={t} content={t}
delayDuration={1500} delayDuration={500}
side="right" side="right"
> >
<div key={k} data-tooltip-id={t}> <div key={k} data-tooltip-id={t}>
<div <div
draggable draggable
className={" cursor-grab border-l-8 rounded-l-md"} className={"cursor-grab border-l-8 rounded-l-md"}
style={{ style={{
borderLeftColor: borderLeftColor:
nodeColors[d] ?? nodeColors.unknown, nodeColors[d] ?? nodeColors.unknown,

View file

@ -1,5 +1,5 @@
import { useContext, useEffect } from "react"; import { useContext, useEffect } from "react";
import { COLUMN_DIV_STYLE, NAV_DISPLAY_STYLE } from "../../constants"; import { COLUMN_DIV_STYLE, NAV_DISPLAY_STYLE, BUTTON_DIV_STYLE } from "../../constants";
import { Download, Upload, Plus, Home, ExternalLink } from "lucide-react"; import { Download, Upload, Plus, Home, ExternalLink } from "lucide-react";
import { TabsContext } from "../../contexts/tabsContext"; import { TabsContext } from "../../contexts/tabsContext";
@ -20,7 +20,7 @@ import { COLUMN_DIV_STYLE, NAV_DISPLAY_STYLE } from "../../constants";
<Home className=" w-6 " /> <Home className=" w-6 " />
My Projects My Projects
</span> </span>
<div className="hi flex gap-2"> <div className={`${ BUTTON_DIV_STYLE }`}>
<Button <Button
variant="primary" variant="primary"
onClick={() => { onClick={() => {