Skip to content

Commit

Permalink
fix: small issue with effect in builder (keephq#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
talboren authored Jun 14, 2023
1 parent 0bcf128 commit 9d79613
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 11 deletions.
12 changes: 7 additions & 5 deletions keep-ui/app/builder/builder-card.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ExclamationCircleIcon } from "@heroicons/react/24/outline";
import { Card, Callout } from "@tremor/react";
import dynamic from "next/dynamic";
import { useState } from "react";
import { useEffect, useState } from "react";
import useSWR from "swr";
import { getApiURL } from "../../utils/apiUrl";
import Loader from "./loader";
Expand Down Expand Up @@ -36,10 +36,12 @@ export function BuilderCard({
fetcher(url, accessToken)
);

if (data && !providers) {
setProviders(data.providers);
enableButtons();
}
useEffect(() => {
if (data && !providers) {
setProviders(data.providers);
enableButtons();
}
}, [data, providers, enableButtons]);

return (
<Card
Expand Down
18 changes: 17 additions & 1 deletion keep-ui/app/builder/page.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
PlusIcon,
ArrowDownOnSquareIcon,
BoltIcon,
ArrowUpOnSquareIcon,
} from "@heroicons/react/20/solid";
import { useSession } from "../../utils/customAuth";
import { BuilderCard } from "./builder-card";
Expand Down Expand Up @@ -41,7 +42,12 @@ export default function PageClient() {
};
reader.readAsText(file);
}
if (status === "loading") return <div><Loading/></div>;
if (status === "loading")
return (
<div>
<Loading />
</div>
);
if (status === "unauthenticated") return <div>Unauthenticated...</div>;

return (
Expand All @@ -63,6 +69,16 @@ export default function PageClient() {
>
New
</Button>
<Button
color="orange"
size="md"
className="mr-2"
variant="secondary"
icon={ArrowUpOnSquareIcon}
disabled={true}
>
Save 👷‍♀️
</Button>
<Button
color="orange"
size="md"
Expand Down
6 changes: 6 additions & 0 deletions keep-ui/app/builder/page.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@
.sqd-toolbox-item-text {
text-transform: capitalize;
}

.tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black; /* If you want dots under the hoverable text */
}
8 changes: 4 additions & 4 deletions keep-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion keep-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@headlessui/react": "^1.7.14",
"@heroicons/react": "^2.0.18",
"@svgr/webpack": "^8.0.1",
"@tremor/react": "^2.7.0",
"@tremor/react": "^2.11.0",
"acorn": "^8.8.2",
"acorn-jsx": "^5.3.2",
"add": "^2.0.6",
Expand Down

0 comments on commit 9d79613

Please sign in to comment.