Skip to content

Commit 4a57977

Browse files
committed
chore: update submodule and add AiChatModal export
- Updated submodule reference for autokitteh. - Added export for AiChatModal in modals index. - Replaced ChatbotIframe with AiChatModal in AiLandingPage component. - Introduced aiChat enum value in modal enum.
1 parent 47612ce commit 4a57977

File tree

6 files changed

+74
-48
lines changed

6 files changed

+74
-48
lines changed

src/assets/index.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,21 @@ a {
139139
animation-play-state: running;
140140
}
141141

142+
@keyframes fadeIn {
143+
from {
144+
opacity: 0;
145+
transform: translateY(-10px);
146+
}
147+
to {
148+
opacity: 1;
149+
transform: translateY(0);
150+
}
151+
}
152+
153+
.animate-fade-in {
154+
animation: fadeIn 0.3s ease-out forwards;
155+
}
156+
142157
ul {
143158
font-size: 15px;
144159
@apply ml-6;

src/autokitteh

Submodule autokitteh updated 73 files
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import React from "react";
2+
3+
import { useTranslation } from "react-i18next";
4+
5+
import { ModalName } from "@enums/components";
6+
7+
import { Button } from "@components/atoms";
8+
import { Modal } from "@components/molecules";
9+
import { ChatbotIframe } from "@components/organisms/chatbotIframe/chatbotIframe";
10+
11+
type AiChatModalProps = {
12+
isOpen: boolean;
13+
onClose: () => void;
14+
onConnect?: () => void;
15+
};
16+
17+
export const AiChatModal = ({ isOpen, onClose, onConnect }: AiChatModalProps) => {
18+
const { t: tAi } = useTranslation("dashboard", { keyPrefix: "ai" });
19+
20+
return (
21+
<Modal
22+
className="relative size-full border-none bg-black p-0"
23+
closeButtonClass="hidden"
24+
forceOpen={isOpen}
25+
hideCloseButton
26+
name={ModalName.aiChat}
27+
onCloseCallbackOverride={onClose}
28+
wrapperClass="p-2"
29+
>
30+
<Button
31+
aria-label={tAi("modal.closeLabel")}
32+
className="absolute right-3 top-3 z-10 bg-transparent p-1.5 hover:bg-gray-700 sm:right-6 sm:top-6"
33+
onClick={onClose}
34+
>
35+
<svg
36+
className="size-4 text-white sm:size-5"
37+
fill="none"
38+
stroke="currentColor"
39+
viewBox="0 0 24 24"
40+
xmlns="http://www.w3.org/2000/svg"
41+
>
42+
<path d="M6 18L18 6M6 6l12 12" strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} />
43+
</svg>
44+
</Button>
45+
<ChatbotIframe
46+
className="size-full"
47+
hideCloseButton
48+
onConnect={onConnect}
49+
padded
50+
title={tAi("modal.assistantTitle")}
51+
/>
52+
</Modal>
53+
);
54+
};

src/components/organisms/modals/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export { AiChatModal } from "@components/organisms/modals/aiChatModal";
12
export { DeleteProjectModal } from "@components/organisms/modals/deleteProjectModal";
23
export { ImportProjectModal } from "@components/organisms/modals/importProjectModal";
34
export { NewProjectModal } from "@components/organisms/modals/newProjectModal";

src/components/pages/aiLandingPage.tsx

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { cn, navigateToProject } from "@src/utilities";
1313

1414
import { AiTextArea, Button, Loader, Typography } from "@components/atoms";
1515
import { ImportProjectModal, NewProjectModal } from "@components/organisms";
16-
import { ChatbotIframe } from "@components/organisms/chatbotIframe/chatbotIframe";
16+
import { AiChatModal } from "@components/organisms/modals";
1717

1818
const pillsPerPage = 5;
1919

@@ -256,52 +256,7 @@ export const AiLandingPage = () => {
256256
</main>
257257
<NewProjectModal />
258258
<ImportProjectModal />
259-
{isModalOpen ? (
260-
<div className="fixed inset-0 z-[99] flex items-center justify-center bg-black/60 p-2 sm:p-4">
261-
<div className="relative h-[95vh] w-full bg-black sm:h-[90vh] sm:w-[90vw] md:h-[85vh] md:w-[85vw]">
262-
<Button
263-
aria-label={tAi("modal.closeLabel")}
264-
className="absolute right-3 top-3 z-10 bg-transparent p-1.5 hover:bg-gray-200 sm:right-6 sm:top-6"
265-
onClick={handleCloseModal}
266-
>
267-
<svg
268-
className="size-4 text-gray-600 sm:size-5"
269-
fill="none"
270-
stroke="currentColor"
271-
viewBox="0 0 24 24"
272-
xmlns="http://www.w3.org/2000/svg"
273-
>
274-
<path
275-
d="M6 18L18 6M6 6l12 12"
276-
strokeLinecap="round"
277-
strokeLinejoin="round"
278-
strokeWidth={2}
279-
/>
280-
</svg>
281-
</Button>
282-
<ChatbotIframe
283-
className="size-full"
284-
hideCloseButton
285-
onConnect={handleIframeConnect}
286-
padded
287-
title={tAi("modal.assistantTitle")}
288-
/>
289-
</div>
290-
</div>
291-
) : null}
292-
293-
<style>{`
294-
@keyframes fadeIn {
295-
from {
296-
opacity: 0;
297-
transform: translateY(-10px);
298-
}
299-
to {
300-
opacity: 1;
301-
transform: translateY(0);
302-
}
303-
}
304-
`}</style>
259+
<AiChatModal isOpen={isModalOpen} onClose={handleCloseModal} onConnect={handleIframeConnect} />
305260
</div>
306261
</div>
307262
);

src/enums/components/modal.enum.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export enum ModalName {
2+
aiChat = "aiChat",
23
addConnection = "addConnection",
34
editConnection = "editConnection",
45
addFile = "addFile",

0 commit comments

Comments
 (0)