Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.0.22 #64

Merged
merged 7 commits into from
Aug 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>Dialoqbase</title>
</head>
<body class="h-full">
<div id="root"></div>
<div id="root" class="h-full"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
6 changes: 4 additions & 2 deletions app/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "app",
"private": true,
"version": "0.0.21",
"version": "0.0.22",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -13,6 +13,7 @@
"@ant-design/cssinjs": "^1.11.1",
"@headlessui/react": "^1.7.15",
"@heroicons/react": "^2.0.18",
"@mantine/form": "^6.0.13",
"@tailwindcss/forms": "^0.5.3",
"@tanstack/react-query": "^4.29.12",
"@types/react-syntax-highlighter": "^15.5.7",
Expand All @@ -27,7 +28,8 @@
"react-router-dom": "^6.11.2",
"react-syntax-highlighter": "^15.5.0",
"remark-gfm": "^3.0.1",
"sort-by": "^1.2.0"
"sort-by": "^1.2.0",
"zustand": "^4.3.9"
},
"devDependencies": {
"@types/js-cookie": "^3.0.3",
Expand Down
95 changes: 43 additions & 52 deletions app/ui/src/Layout/BotLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {

import { Link, useParams, useLocation, useNavigate } from "react-router-dom";
import { useAuth } from "../context/AuthContext";
import { Avatar } from "antd";
import { Avatar, Tooltip } from "antd";

const navigation = [
{
Expand Down Expand Up @@ -51,7 +51,6 @@ function classNames(...classes) {

export default function BotLayout({
children,
noPadding,
}: {
children: React.ReactNode;
noPadding?: boolean;
Expand Down Expand Up @@ -179,53 +178,45 @@ export default function BotLayout({
</Dialog>
</Transition.Root>

<div className="hidden md:fixed md:inset-y-0 md:flex md:w-64 md:flex-col">
<div className="hidden md:fixed md:inset-y-0 md:flex md:flex-col">
<div className="flex flex-grow flex-col overflow-y-auto border-r border-gray-200 bg-white pt-5">
<Link
to="/"
className="focus:outline-none focus-visible:ring-2 focus-visible:ring-pink-700 flex items-center px-3"
>
<img className="h-8 w-auto" src="/logo.png" alt="Dialoqbase" />
<span className="ml-1 text-xl font-bold">Dialoqbase</span>
<span className="inline-block flex-shrink-0 rounded-full bg-green-100 px-2 py-0.5 text-xs font-medium text-green-800 ml-2">
{/* @ts-ignore */}
{`v${__APP_VERSION__}`}
</span>
</Link>
<div className="mt-5 flex flex-grow flex-col">
<div className="mt-14 flex flex-grow flex-col">
<nav className="flex-1 space-y-1 px-2 pb-4">
{navigation.map((item) => (
<Link
key={item.name}
to={{
pathname: item.href.replace(":id", params.id!),
}}
className={classNames(
location.pathname === item.href.replace(":id", params.id!)
? "bg-gray-100 text-gray-900"
: "text-gray-600 hover:bg-gray-50 hover:text-gray-900",
"group flex items-center px-2 py-2 text-sm font-medium rounded-md"
)}
>
<item.icon
<Tooltip placement="right" key={item.name} title={item.name}>
<Link
to={{
pathname: item.href.replace(":id", params.id!),
}}
className={classNames(
location.pathname ===
item.href.replace(":id", params.id!)
? "text-gray-500"
: "text-gray-400 group-hover:text-gray-500",
"mr-3 flex-shrink-0 h-6 w-6"
? "bg-gray-100 text-gray-900"
: "text-gray-600 hover:bg-gray-50 hover:text-gray-900",
"group flex items-center px-2 py-2 text-sm font-medium rounded-md"
)}
aria-hidden="true"
/>
{item.name}
</Link>
>
<item.icon
className={classNames(
location.pathname ===
item.href.replace(":id", params.id!)
? "text-gray-500"
: "text-gray-400 group-hover:text-gray-500",
"flex-shrink-0 h-6 w-6"
)}
aria-hidden="true"
/>
{/* {item.name} */}
</Link>
</Tooltip>
))}
</nav>
</div>
</div>
</div>
<div className="flex flex-1 flex-col md:pl-64">
<div className="sticky top-0 z-10 flex h-16 flex-shrink-0 bg-white border-b border-gray-200 ">

<div className="flex flex-col">
<div className="sticky top-0 z-10 flex h-16 bg-white border-b border-gray-200 ">
<button
type="button"
className="border-r border-gray-200 px-4 text-gray-500 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500 md:hidden"
Expand All @@ -234,12 +225,24 @@ export default function BotLayout({
<span className="sr-only">Open sidebar</span>
<Bars3BottomLeftIcon className="h-6 w-6" aria-hidden="true" />
</button>
<Link
to="/"
className="focus:outline-none focus-visible:ring-2 focus-visible:ring-pink-700 flex items-center px-3"
>
<img className="h-8 w-auto" src="/logo.png" alt="Dialoqbase" />
<span className="ml-1 text-xl font-bold">Dialoqbase</span>
<span className="inline-block flex-shrink-0 rounded-full bg-green-100 px-2 py-0.5 text-xs font-medium text-green-800 ml-2">
{/* @ts-ignore */}
{`v${__APP_VERSION__}`}
</span>
</Link>

<div className="flex flex-1 justify-end px-4">
<div className="ml-4 flex items-center md:ml-6">
<Menu as="div" className="relative ml-3">
<div>
<Menu.Button className="flex max-w-xs items-center rounded-full bg-white text-sm">
<span className="sr-only">Open user menu</span>
<span className="sr-only">Open usermenu</span>
<Avatar shape="square">
{profile?.username?.charAt(0).toUpperCase()}
</Avatar>
Expand Down Expand Up @@ -290,23 +293,11 @@ export default function BotLayout({
</div>
</div>
</div>

<main className="flex-1">
<div className="py-6">
<div
className={classNames(
"mx-auto max-w-7xl",
!noPadding && " px-4 sm:px-6 md:px-8"
)}
>
{/* Replace with your content */}
{children}
{/* <div className="py-4">
{children}
{/* <div className="py-4">
<div className="h-96 rounded-lg border-4 border-dashed border-gray-200" />
</div> */}
{/* /End replace */}
</div>
</div>
</main>
</div>
</div>
Expand Down
Loading