Skip to content

Commit

Permalink
Refactor UI layout and fix integration display
Browse files Browse the repository at this point in the history
  • Loading branch information
n4ze3m committed Mar 5, 2024
1 parent 4daf9ba commit 793a7b0
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 42 deletions.
74 changes: 38 additions & 36 deletions app/ui/src/Layout/BotLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,42 +183,7 @@ export default function BotLayout({
</Dialog>
</Transition.Root>

<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 dark:bg-[#171717] dark:border-gray-600">
<div className="mt-14 flex flex-grow flex-col">
<nav className="flex-1 space-y-1 px-2 pb-4">
{navigation.map((item) => (
<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!)
? "bg-gray-100 text-gray-900 dark:bg-[#262626] dark:text-white"
: "text-gray-600 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-200 dark:hover:text-white dark:hover:bg-[#262626]",
"group flex items-center px-2 py-2 text-sm font-medium rounded-md"
)}
>
<item.icon
className={classNames(
location.pathname ===
item.href.replace(":id", params.id!)
? "text-gray-500 dark:text-white"
: "text-gray-400 group-hover:text-gray-500 dark:text-gray-400 dark:group-hover:text-white",
"flex-shrink-0 h-6 w-6"
)}
aria-hidden="true"
/>
{/* {item.name} */}
</Link>
</Tooltip>
))}
</nav>
</div>
</div>
</div>


<div className="flex flex-col">
<div className="sticky top-0 z-[999] flex h-14 bg-white border-b border-gray-200 dark:bg-[#171717] dark:border-gray-600">
Expand Down Expand Up @@ -255,6 +220,43 @@ export default function BotLayout({
</div> */}
</main>
</div>

<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 dark:bg-[#171717] dark:border-gray-600">
<div className="mt-14 flex flex-grow flex-col">
<nav className="flex-1 space-y-1 px-2 pb-4">
{navigation.map((item) => (
<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!)
? "bg-gray-100 text-gray-900 dark:bg-[#262626] dark:text-white"
: "text-gray-600 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-200 dark:hover:text-white dark:hover:bg-[#262626]",
"group flex items-center px-2 py-2 text-sm font-medium rounded-md"
)}
>
<item.icon
className={classNames(
location.pathname ===
item.href.replace(":id", params.id!)
? "text-gray-500 dark:text-white"
: "text-gray-400 group-hover:text-gray-500 dark:text-gray-400 dark:group-hover:text-white",
"flex-shrink-0 h-6 w-6"
)}
aria-hidden="true"
/>
{/* {item.name} */}
</Link>
</Tooltip>
))}
</nav>
</div>
</div>
</div>
</div>
</>
);
Expand Down
10 changes: 5 additions & 5 deletions app/ui/src/components/Bot/Playground/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ import { Skeleton } from "antd";
export const PlaygroundBody = () => {
const { isLoading } = useMessage();
return (
<div className="relative md:ml-14">
<div className=" md:ml-14">
<div className="flex flex-col">
{" "}
<div className="hidden md:block">
<div className="hidden lg:block">
<PlaygroundMenu />
</div>
<div className="flex-grow md:pl-[100px]">
<div className="flex-grow flex-1">
{isLoading ? (
<div className="flex p-12 items-center justify-center h-full">
<Skeleton active paragraph={{ rows: 10 }} />
</div>
) : (
<div>
<div className="md:ml-[150px]">
<div>
<PlaygroundChat />
</div>
<div>
<div className="bottom-0 w-full bg-transparent border-0 fixed pt-2">
<div className="stretch mx-2 flex flex-row gap-3 md:mx-4 lg:mx-auto lg:max-w-2xl xl:max-w-3xl">
<div className="stretch mx-2 flex flex-row gap-3 lg:mx-auto lg:max-w-2xl xl:max-w-3xl md:max-w-3xl md:mx-auto">
<div className="relative flex flex-col h-full flex-1 items-stretch md:flex-col">
<PlaygroundgForm />
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/ui/src/routes/bot/integrations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function BotIntegrationRoot() {
}, [status]);

return (
<div className="mx-auto my-3 w-full max-w-7xl">
<div className="mx-auto my-3 w-full max-w-7xl">
{status === "loading" && <SkeletonLoading className="mt-6" />}
{status === "success" && <IntegrationGrid data={data.data} />}
</div>
Expand Down

0 comments on commit 793a7b0

Please sign in to comment.