-
-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Testing New Layout * Improve Header; Light Mode * Scrollbar on Text Editor Always Available * Fix Theme Tab Scrolling * Add spacing between doc and graph * Mobile working * Dark Mode * Adding Secondary Elements * Remove unused * Fix fullscreen page * Link Icon
- Loading branch information
1 parent
af6b2f9
commit bf65a6f
Showing
32 changed files
with
424 additions
and
372 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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { useEffect, useState } from "react"; | ||
|
||
import { useIsProUser } from "../lib/hooks"; | ||
import { ImportDataDialog } from "./ImportDataDialog"; | ||
import { ImportDataUnauthenticatedDialog } from "./ImportDataUnauthenticatedDialog"; | ||
import { LearnSyntaxDialog } from "./LearnSyntaxDialog"; | ||
import { LoadTemplateDialog } from "./LoadTemplateDialog"; | ||
import { LoadFileButton } from "./LoadFileButton"; | ||
import { useLocation } from "react-router-dom"; | ||
import * as DropdownMenu from "@radix-ui/react-dropdown-menu"; | ||
import { Sliders } from "phosphor-react"; | ||
|
||
export function Actions() { | ||
const isProUser = useIsProUser(); | ||
const isSandbox = useLocation().pathname === "/"; | ||
const [open, setOpen] = useState(false); | ||
useEffect(() => { | ||
// when open, bind a listener to the window that catches clicks which bubble up from the editor-options dropdown | ||
if (!open) return; | ||
const listener = (e: MouseEvent) => { | ||
const target = e.target as HTMLElement; | ||
if (target.closest("#editor-options")) { | ||
// debugger; | ||
// setOpen(false); | ||
} | ||
}; | ||
|
||
window.addEventListener("click", listener); | ||
|
||
return () => { | ||
window.removeEventListener("click", listener); | ||
}; | ||
}, [setOpen, open]); | ||
return ( | ||
<> | ||
<div className="hidden md:flex justify-start w-full gap-x-2 items-center whitespace-nowrap flex-wrap py-2"> | ||
<LoadTemplateDialog /> | ||
<LearnSyntaxDialog /> | ||
{isSandbox ? <LoadFileButton /> : null} | ||
{isProUser ? <ImportDataDialog /> : <ImportDataUnauthenticatedDialog />} | ||
</div> | ||
<DropdownMenu.Root open={open} onOpenChange={setOpen}> | ||
<DropdownMenu.Trigger asChild> | ||
<button className="md:hidden mr-1 rounded flex self-center items-center justify-center w-8 h-8 bg-neutral-300 hover:bg-neutral-400 focus:outline-none"> | ||
<Sliders size={24} /> | ||
</button> | ||
</DropdownMenu.Trigger> | ||
<DropdownMenu.Content | ||
align="end" | ||
className="min-w-[220px] bg-white rounded-md shadow-xl select-none p-2" | ||
id="editor-options" | ||
> | ||
<LoadTemplateDialog /> | ||
<LearnSyntaxDialog /> | ||
{isSandbox ? <LoadFileButton /> : null} | ||
{isProUser ? ( | ||
<ImportDataDialog /> | ||
) : ( | ||
<ImportDataUnauthenticatedDialog /> | ||
)} | ||
</DropdownMenu.Content> | ||
</DropdownMenu.Root> | ||
</> | ||
); | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
.HeaderTitle button:first-child h1 { | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
width: 100%; | ||
overflow: hidden; | ||
} |
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,7 @@ | ||
export function FlowchartLayout({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<div className="h-full w-full md:px-8 md:pt-4 lg:pt-6 bg-[#f6f5f6] grid grid-rows-[auto_minmax(0,1fr)] 2xl:px-16 dark:bg-[#0c0c0c]"> | ||
{children} | ||
</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
Oops, something went wrong.