Skip to content

Commit

Permalink
Fix layout (#1191)
Browse files Browse the repository at this point in the history
* fix layout

* fix layout
  • Loading branch information
an-lee authored Nov 20, 2024
1 parent 58a6c34 commit 6c2dec5
Show file tree
Hide file tree
Showing 26 changed files with 43 additions and 43 deletions.
4 changes: 2 additions & 2 deletions enjoy/src/renderer/components/chats/chat-session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ export const ChatSession = (props: {

if (!chatId) {
return (
<div className="flex items-center justify-center h-[calc(100vh-2rem)]">
<div className="flex items-center justify-center h-content">
<span className="text-muted-foreground">{t("noChatSelected")}</span>
</div>
);
}

return (
<ScrollArea className="h-[calc(100vh-2rem)] relative">
<ScrollArea className="h-content relative">
<ChatSessionProvider chatId={chatId}>
<ChatHeader
sidePanelCollapsed={sidePanelCollapsed}
Expand Down
2 changes: 1 addition & 1 deletion enjoy/src/renderer/components/copilots/copilot-session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const CopilotSession = () => {
const { currentChat } = useContext(CopilotProviderContext);

return (
<ScrollArea className="h-[calc(100vh-2rem)] relative">
<ScrollArea className="h-content relative">
{currentChat?.id ? (
<ChatSessionProvider chatId={currentChat.id}>
<CopilotHeader />
Expand Down
6 changes: 3 additions & 3 deletions enjoy/src/renderer/components/layouts/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const Layout = () => {
<ResizablePanel id="main-panel" order={1} minSize={50}>
<div className="flex flex-start">
<Sidebar />
<div className="flex-1 border-l overflow-x-hidden overflow-y-auto h-[calc(100vh-2rem)]">
<div className="flex-1 border-l overflow-x-hidden overflow-y-auto h-content">
<Outlet />
</div>
</div>
Expand All @@ -44,7 +44,7 @@ export const Layout = () => {
minSize={15}
onCollapse={() => setActive(false)}
>
<div className="h-[calc(100vh-2rem)]">
<div className="h-content">
<CopilotSession />
</div>
</ResizablePanel>
Expand All @@ -57,7 +57,7 @@ export const Layout = () => {
return (
<div className="h-screen flex flex-col w-full">
<TitleBar />
<div className="flex-1 h-[calc(100vh-2rem)] overflow-y-auto">
<div className="flex-1 h-content overflow-y-auto">
<Outlet />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion enjoy/src/renderer/components/layouts/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const Sidebar = () => {

return (
<div
className={`h-[calc(100vh-2rem)] pt-8 transition-all relative draggable-region ${
className={`h-content pt-8 transition-all relative draggable-region ${
isCollapsed ? "w-12" : "w-48"
}`}
data-testid="sidebar"
Expand Down
7 changes: 2 additions & 5 deletions enjoy/src/renderer/components/layouts/title-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
AppSettingsProviderContext,
CopilotProviderContext,
} from "@/renderer/context";
import { ChevronRightIcon } from "@radix-ui/react-icons";
import {
AlertDialog,
AlertDialogHeader,
Expand Down Expand Up @@ -78,7 +77,7 @@ export const TitleBar = () => {
}, []);

return (
<div className="z-50 h-8 w-full bg-muted draggable-region flex items-center justify-between border-b">
<div className="z-[100] h-8 w-full bg-muted draggable-region flex items-center justify-between border-b">
<div className="flex items-center px-2">
{platform === "darwin" && !isFullScreen && <div className="w-16"></div>}
<DropdownMenu>
Expand Down Expand Up @@ -150,9 +149,7 @@ export const TitleBar = () => {
<DropdownMenuGroup>
<DropdownMenuSub>
<DropdownMenuSubTrigger className="non-draggable-region">
<span className="capitalize">
{t("feedback")}
</span>
<span className="capitalize">{t("feedback")}</span>
</DropdownMenuSubTrigger>
<DropdownMenuPortal>
<DropdownMenuSubContent>
Expand Down
2 changes: 1 addition & 1 deletion enjoy/src/renderer/components/login/bandu-login-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const BanduLoginButton = () => {
</SheetTrigger>
<SheetContent
side="bottom"
className="h-screen"
className="h-content"
aria-describedby={undefined}
>
<SheetHeader>
Expand Down
2 changes: 1 addition & 1 deletion enjoy/src/renderer/components/login/github-login-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const GithubLoginButton = () => {
</SheetTrigger>
<SheetContent
side="bottom"
className="h-screen"
className="h-content"
aria-describedby={undefined}
>
<div className="w-full h-full flex">
Expand Down
2 changes: 1 addition & 1 deletion enjoy/src/renderer/components/login/mixin-login-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const MixinLoginButton = () => {
</SheetTrigger>
<SheetContent
side="bottom"
className="h-screen"
className="h-content"
aria-describedby={undefined}
>
<SheetHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ export const MediaCurrentRecording = () => {
<SheetContent
aria-describedby={undefined}
side="bottom"
className="rounded-t-2xl shadow-lg max-h-screen overflow-y-scroll"
className="rounded-t-2xl shadow-lg max-h-content overflow-y-scroll"
displayClose={false}
>
<SheetHeader className="flex items-center justify-center -mt-4 mb-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ const TranscriptionRecordingsList = () => {
<SheetContent
aria-describedby={undefined}
side="bottom"
className="rounded-t-2xl shadow-lg max-h-screen overflow-y-scroll"
className="rounded-t-2xl shadow-lg max-h-content overflow-y-scroll"
displayClose={false}
>
<SheetHeader className="flex items-center justify-center -mt-4 mb-2">
Expand Down
4 changes: 2 additions & 2 deletions enjoy/src/renderer/components/messages/assistant-message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,12 @@ export const AssistantMessageComponent = (props: {
<SheetContent
aria-describedby={undefined}
side="bottom"
className="h-screen p-0 flex flex-col"
className="h-content p-0 flex flex-col gap-0"
displayClose={false}
onPointerDownOutside={(event) => event.preventDefault()}
onInteractOutside={(event) => event.preventDefault()}
>
<SheetHeader className="flex items-center justify-center">
<SheetHeader className="flex items-center justify-center space-y-0 py-1">
<SheetTitle className="sr-only">{t("shadow")}</SheetTitle>
<SheetClose>
<ChevronDownIcon />
Expand Down
2 changes: 1 addition & 1 deletion enjoy/src/renderer/components/ui/toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const ToastViewport = React.forwardRef<
<ToastPrimitives.Viewport
ref={ref}
className={cn(
"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
"fixed top-0 z-[100] flex max-h-content w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
className
)}
{...props}
Expand Down
6 changes: 3 additions & 3 deletions enjoy/src/renderer/context/chat-session-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -482,12 +482,12 @@ export const ChatSessionProvider = ({
>
<SheetContent
side="bottom"
className="h-screen p-0 flex flex-col"
className="h-content p-0 flex flex-col gap-0"
displayClose={false}
onPointerDownOutside={(event) => event.preventDefault()}
onInteractOutside={(event) => event.preventDefault()}
>
<SheetHeader className="flex items-center justify-center">
<SheetHeader className="flex items-center justify-center space-y-0 py-1">
<SheetTitle className="sr-only">Shadow</SheetTitle>
<SheetDescription className="sr-only"></SheetDescription>
<SheetClose>
Expand All @@ -508,7 +508,7 @@ export const ChatSessionProvider = ({
<SheetContent
aria-describedby={undefined}
side="bottom"
className="rounded-t-2xl shadow-lg max-h-screen overflow-y-scroll"
className="rounded-t-2xl shadow-lg max-h-content overflow-y-scroll"
displayClose={false}
>
<SheetHeader className="flex items-center justify-center -mt-4 mb-2">
Expand Down
6 changes: 3 additions & 3 deletions enjoy/src/renderer/context/course-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,20 @@ export const CourseProvider = ({
>
<SheetContent
side="bottom"
className="h-screen p-0 flex flex-col"
className="h-content p-0 flex flex-col gap-0"
displayClose={false}
onPointerDownOutside={(event) => event.preventDefault()}
onInteractOutside={(event) => event.preventDefault()}
>
<SheetHeader className="flex items-center justify-center">
<SheetHeader className="flex items-center justify-center space-y-0 py-1">
<SheetTitle className="sr-only">Shadow</SheetTitle>
<SheetDescription className="sr-only"></SheetDescription>
<SheetClose>
<ChevronDownIcon />
</SheetClose>
</SheetHeader>

<AudioPlayer id={shadowing?.id} />
{shadowing && <AudioPlayer id={shadowing.id} />}
</SheetContent>
</Sheet>
</MediaShadowProvider>
Expand Down
2 changes: 1 addition & 1 deletion enjoy/src/renderer/pages/audio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default () => {
const navigate = useNavigate();

return (
<div className="h-[calc(100vh-2rem)] flex flex-col relative">
<div className="h-content flex flex-col relative">
<Breadcrumb className="px-4 pt-3 pb-2">
<BreadcrumbList>
<BreadcrumbItem>
Expand Down
2 changes: 1 addition & 1 deletion enjoy/src/renderer/pages/chats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function Chats() {
}, [currentChat]);

return (
<ResizablePanelGroup direction="horizontal" className="h-screen">
<ResizablePanelGroup direction="horizontal" className="h-content">
{!sidePanelCollapsed && (
<>
<ResizablePanel
Expand Down
6 changes: 3 additions & 3 deletions enjoy/src/renderer/pages/conversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export default () => {
return (
<div
data-testid="conversation-page"
className="h-[calc(100vh-2rem)] px-4 py-4 lg:px-8 flex flex-col"
className="h-content px-4 py-4 lg:px-8 flex flex-col"
>
<div className="h-[calc(100vh-5rem)] relative w-full max-w-screen-md mx-auto flex flex-col">
<div className="flex items-center justify-center py-2 relative">
Expand All @@ -249,13 +249,13 @@ export default () => {
</div>
</SheetTrigger>

<SheetContent className="p-0" aria-describedby={undefined}>
<SheetContent className="p-0 pt-8" aria-describedby={undefined}>
<SheetHeader>
<SheetTitle className="sr-only">
{t("editConversation")}
</SheetTitle>
</SheetHeader>
<div className="h-screen">
<div className="h-content">
<ConversationForm
conversation={conversation}
onFinish={() => {
Expand Down
6 changes: 3 additions & 3 deletions enjoy/src/renderer/pages/conversations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from "@renderer/components/ui";
import { ConversationCard, ConversationForm } from "@renderer/components";
import { useState, useEffect, useContext, useReducer } from "react";
import { ChevronLeftIcon, LoaderIcon } from "lucide-react";
import { LoaderIcon } from "lucide-react";
import { Link, useNavigate, useSearchParams } from "react-router-dom";
import {
DbProviderContext,
Expand Down Expand Up @@ -292,13 +292,13 @@ export default () => {
</Dialog>

<Sheet open={creating} onOpenChange={(value) => setCreating(value)}>
<SheetContent className="p-0" aria-describedby={undefined}>
<SheetContent className="p-0 pt-8" aria-describedby={undefined}>
<SheetHeader>
<SheetTitle className="sr-only">
{t("startConversation")}
</SheetTitle>
</SheetHeader>
<div className="h-screen relative">
<div className="h-content relative">
<ConversationForm
conversation={preset}
onFinish={() => setCreating(false)}
Expand Down
4 changes: 2 additions & 2 deletions enjoy/src/renderer/pages/courses/chapter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default () => {

return (
<CourseProvider id={id}>
<div className="flex flex-col h-screen px-4 xl:px-6 py-6">
<div className="flex flex-col h-content px-4 xl:px-6 py-4">
<Breadcrumb className="mb-4">
<BreadcrumbList>
<BreadcrumbItem>
Expand All @@ -58,7 +58,7 @@ export default () => {
<BreadcrumbPage>{chapter?.title || sequence}</BreadcrumbPage>
</BreadcrumbList>
</Breadcrumb>
<div className="flex-1 h-[calc(100vh-5.75rem)] border rounded-lg">
<div className="flex-1 h-[calc(100vh-7.75rem)] border rounded-lg">
<ResizablePanelGroup direction="horizontal">
<ResizablePanel defaultSize={50}>
<ScrollArea className="px-4 py-3 h-full relative bg-muted">
Expand Down
4 changes: 2 additions & 2 deletions enjoy/src/renderer/pages/document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ const DocumentComponent = () => {

if (!document) {
return (
<div className="h-screen flex flex-col justify-center items-center relative">
<div className="h-content flex flex-col justify-center items-center relative">
<LoaderSpin />
</div>
);
}

return (
<div className="h-[calc(100vh-2rem)] flex flex-col relative">
<div className="h-content flex flex-col relative">
<Breadcrumb className="px-4 pt-3 pb-2">
<BreadcrumbList>
<BreadcrumbItem>
Expand Down
2 changes: 1 addition & 1 deletion enjoy/src/renderer/pages/error-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default () => {
console.error(error);

return (
<div className="h-screen px-4 py-6 lg:px-8">
<div className="h-content px-4 py-6 lg:px-8">
<PagePlaceholder
placeholder={t("somethingWentWrong")}
extra={error ? (error as Error).message : ""}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export default () => {
<SheetContent
aria-describedby={undefined}
side="bottom"
className="rounded-t-2xl shadow-lg max-h-screen overflow-y-scroll"
className="rounded-t-2xl shadow-lg max-h-content overflow-y-scroll"
displayClose={false}
>
<SheetHeader className="flex items-center justify-center -mt-4 mb-2">
Expand Down
2 changes: 1 addition & 1 deletion enjoy/src/renderer/pages/story-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export default () => {
}, [readable, loading]);

return (
<div className="h-screen w-full flex flex-col bg-muted">
<div className="h-content w-full flex flex-col bg-muted">
{(loading || !readable) && (
<div className="h-12 flex items-center space-x-2 px-4 border-b shadow">
<Button
Expand Down
2 changes: 1 addition & 1 deletion enjoy/src/renderer/pages/story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export default () => {

return (
<>
<ScrollArea className="h-screen w-full bg-muted">
<ScrollArea className="h-content w-full bg-muted">
<StoryToolbar
marked={marked}
toggleMarked={() => setMarked(!marked)}
Expand Down
2 changes: 1 addition & 1 deletion enjoy/src/renderer/pages/video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default () => {
const navigate = useNavigate();

return (
<div className="h-[calc(100vh-2rem)] flex flex-col relative">
<div className="h-content flex flex-col relative">
<Breadcrumb className="px-4 pt-3 pb-2">
<BreadcrumbList>
<BreadcrumbItem>
Expand Down
3 changes: 3 additions & 0 deletions enjoy/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ module.exports = {
},
},
extend: {
height: {
content: "calc(100vh - 2rem)",
},
fontSize: {
xxs: "0.625rem",
xxxs: "0.5rem",
Expand Down

0 comments on commit 6c2dec5

Please sign in to comment.