-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created navbar element, designed the website better. Added colours
- Loading branch information
1 parent
42ad1d4
commit cd8262b
Showing
8 changed files
with
134 additions
and
105 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + React + TS</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + React + TS</title> | ||
</head> | ||
|
||
<body class="bg-amber-50"> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
|
||
</html> |
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,76 @@ | ||
import { applicationState, chatState } from "@/atoms/state"; | ||
import { | ||
Dialog, | ||
DialogContent, | ||
DialogDescription, | ||
DialogFooter, | ||
DialogHeader, | ||
DialogTitle, | ||
DialogTrigger, | ||
} from "@/components/ui/dialog"; | ||
import jsPDF from "jspdf"; | ||
import { LucideDownload, LucideSettings, LucideTrash } from "lucide-react"; | ||
import { useState } from "react"; | ||
import { useRecoilState } from "recoil"; | ||
import { Button } from "./ui/button"; | ||
|
||
export const Navbar = () => { | ||
const [, setAppState] = useRecoilState(applicationState); | ||
const [, setChats] = useRecoilState(chatState); | ||
const [openDialog, setOpenDialog] = useState(false); | ||
|
||
const downloadChat = () => { | ||
const doc = new jsPDF({ | ||
orientation: "portrait", | ||
unit: "mm", | ||
format: [210, 297], | ||
}); | ||
|
||
doc.html(`<div>Hi</div>`, { | ||
async callback(doc) { | ||
doc.save("pdf_name"); | ||
}, | ||
}); | ||
}; | ||
|
||
const cleanChat = () => { | ||
setChats({ chats: [] }); | ||
setOpenDialog(false); | ||
}; | ||
|
||
return ( | ||
<div className="container flex justify-between"> | ||
<div className="flex gap-x-4"> | ||
<h1>Mukalma</h1> | ||
<p>Talk to yourself</p> | ||
</div> | ||
<div className="flex gap-x-4"> | ||
<LucideDownload onClick={downloadChat} /> | ||
|
||
<Dialog open={openDialog} onOpenChange={setOpenDialog}> | ||
<DialogTrigger> | ||
<LucideTrash /> | ||
</DialogTrigger> | ||
<DialogContent> | ||
<DialogHeader> | ||
<DialogTitle>Are you absolutely sure?</DialogTitle> | ||
<DialogDescription> | ||
This action cannot be undone. This will permanently delete your | ||
account and remove your data from our servers. | ||
</DialogDescription> | ||
</DialogHeader> | ||
<DialogFooter> | ||
<Button onClick={cleanChat}>Confirm</Button> | ||
</DialogFooter> | ||
</DialogContent> | ||
</Dialog> | ||
|
||
<LucideSettings | ||
onClick={() => | ||
setAppState((prev) => ({ ...prev, isChatScreen: false })) | ||
} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; |
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