-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add basic title bar * add title bar actions * fix layout * update title bar * update layout * fix title bar for macOS * UI * setup menu for macOS * fix title bar logo
- Loading branch information
Showing
27 changed files
with
771 additions
and
277 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
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
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,2 @@ | ||
export * from "./layout"; | ||
export * from "./title-bar"; |
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,66 @@ | ||
import { Outlet } from "react-router-dom"; | ||
import { | ||
AppSettingsProviderContext, | ||
CopilotProviderContext, | ||
} from "@renderer/context"; | ||
import { useContext } from "react"; | ||
import { CopilotSession, TitleBar, Sidebar } from "@renderer/components"; | ||
import { | ||
ResizableHandle, | ||
ResizablePanel, | ||
ResizablePanelGroup, | ||
} from "@renderer/components/ui"; | ||
|
||
export const Layout = () => { | ||
const { initialized } = useContext(AppSettingsProviderContext); | ||
const { active, setActive } = useContext(CopilotProviderContext); | ||
|
||
if (initialized) { | ||
return ( | ||
<div className="h-screen flex flex-col"> | ||
<TitleBar /> | ||
<ResizablePanelGroup | ||
direction="horizontal" | ||
className="flex-1 h-full w-full" | ||
data-testid="layout-home" | ||
> | ||
<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)]"> | ||
<Outlet /> | ||
</div> | ||
</div> | ||
</ResizablePanel> | ||
{active && ( | ||
<> | ||
<ResizableHandle /> | ||
<ResizablePanel | ||
id="copilot-panel" | ||
order={2} | ||
collapsible={true} | ||
defaultSize={30} | ||
maxSize={50} | ||
minSize={15} | ||
onCollapse={() => setActive(false)} | ||
> | ||
<div className="h-[calc(100vh-2rem)]"> | ||
<CopilotSession /> | ||
</div> | ||
</ResizablePanel> | ||
</> | ||
)} | ||
</ResizablePanelGroup> | ||
</div> | ||
); | ||
} else { | ||
return ( | ||
<div className="h-screen flex flex-col w-full"> | ||
<TitleBar /> | ||
<div className="flex-1 h-[calc(100vh-2rem)] overflow-y-auto"> | ||
<Outlet /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
}; |
Oops, something went wrong.