-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #342 from kreneskyp/left_sidebar
Left sidebar
- Loading branch information
Showing
20 changed files
with
264 additions
and
218 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,18 @@ | ||
import React from "react"; | ||
import { Link } from "react-router-dom"; | ||
import { IconButton } from "@chakra-ui/react"; | ||
import { useColorMode } from "@chakra-ui/color-mode"; | ||
import { Tooltip } from "@chakra-ui/react"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import { faDiagramProject } from "@fortawesome/free-solid-svg-icons"; | ||
import { MenuItem } from "site/MenuItem"; | ||
|
||
export const NewAgentButton = () => { | ||
const { colorMode } = useColorMode(); | ||
|
||
return ( | ||
<Link to="/chains/new"> | ||
<IconButton | ||
width="100%" | ||
border="1px solid" | ||
borderColor={colorMode === "light" ? "gray.300" : "whiteAlpha.50"} | ||
icon={<FontAwesomeIcon icon={faDiagramProject} />} | ||
title={"New Agent or Chain"} | ||
> | ||
New Agent | ||
</IconButton> | ||
</Link> | ||
<Tooltip label="New Agent" aria-label="New Agent"> | ||
<Link to="/chains/new"> | ||
<MenuItem title={"New Agent"}> | ||
<FontAwesomeIcon icon={faDiagramProject} /> | ||
</MenuItem> | ||
</Link> | ||
</Tooltip> | ||
); | ||
}; |
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 |
---|---|---|
@@ -1,71 +1,31 @@ | ||
import React from "react"; | ||
import { | ||
IconButton, | ||
Popover, | ||
PopoverArrow, | ||
PopoverCloseButton, | ||
PopoverContent, | ||
PopoverHeader, | ||
PopoverTrigger, | ||
useDisclosure, | ||
} from "@chakra-ui/react"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import { faUsers } from "@fortawesome/free-solid-svg-icons"; | ||
import { useColorMode } from "@chakra-ui/color-mode"; | ||
import SideBarAgentList from "chat/sidebar/SideBarAgentList"; | ||
import { MenuItem } from "site/MenuItem"; | ||
import { | ||
LeftMenuPopover, | ||
LeftSidebarPopupContent, | ||
LeftSidebarPopupHeader, | ||
LeftSidebarPopupIcon, | ||
} from "site/LeftMenuPopover"; | ||
|
||
export const ChatMembersButton = ({ graph, onUpdateAgents, agentPage }) => { | ||
const { isOpen, onToggle, onClose } = useDisclosure(); | ||
|
||
const { colorMode } = useColorMode(); | ||
const style = | ||
colorMode === "light" | ||
? { | ||
border: "1px solid", | ||
borderColor: "gray.300", | ||
} | ||
: { | ||
border: "1px solid", | ||
borderColor: "whiteAlpha.50", | ||
}; | ||
const highlightColor = colorMode === "light" ? "blue.500" : "blue.400"; | ||
const color = colorMode === "light" ? "gray.800" : "white"; | ||
|
||
return ( | ||
<Popover | ||
isOpen={isOpen} | ||
onClose={onClose} | ||
placement={"right-start"} | ||
closeOnBlur={false} | ||
> | ||
<PopoverTrigger> | ||
<IconButton | ||
icon={<FontAwesomeIcon size={"lg"} icon={faUsers} />} | ||
{...style} | ||
onClick={onToggle} | ||
title={"Chat members"} | ||
/> | ||
</PopoverTrigger> | ||
<PopoverContent | ||
zIndex={99998} | ||
pb={2} | ||
boxShadow="0px 0px 10px 0px rgba(0,0,0,0.15)" | ||
> | ||
<PopoverHeader | ||
borderBottom="2px solid" | ||
borderColor={highlightColor} | ||
color={color} | ||
> | ||
Assistants | ||
</PopoverHeader> | ||
<PopoverArrow /> | ||
<PopoverCloseButton /> | ||
<LeftMenuPopover> | ||
<LeftSidebarPopupIcon> | ||
<MenuItem title="Secrets"> | ||
<FontAwesomeIcon icon={faUsers} /> | ||
</MenuItem> | ||
</LeftSidebarPopupIcon> | ||
<LeftSidebarPopupHeader>Assistants</LeftSidebarPopupHeader> | ||
<LeftSidebarPopupContent> | ||
<SideBarAgentList | ||
graph={graph} | ||
onUpdateAgents={onUpdateAgents} | ||
agentPage={agentPage} | ||
/> | ||
</PopoverContent> | ||
</Popover> | ||
</LeftSidebarPopupContent> | ||
</LeftMenuPopover> | ||
); | ||
}; |
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 |
---|---|---|
@@ -1,36 +1,18 @@ | ||
import React from "react"; | ||
import { useColorMode } from "@chakra-ui/color-mode"; | ||
import { Button, IconButton } from "@chakra-ui/react"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import { faMoon } from "@fortawesome/free-solid-svg-icons"; | ||
import { faSun } from "@fortawesome/free-regular-svg-icons"; | ||
import { MenuItem } from "site/MenuItem"; | ||
|
||
export const ColorModeButton = () => { | ||
const { colorMode, toggleColorMode } = useColorMode(); | ||
const style = | ||
colorMode === "light" | ||
? { | ||
text: "Dark Mode", | ||
border: "1px solid", | ||
borderColor: "gray.300", | ||
} | ||
: { | ||
title: "Light Mode", | ||
border: "1px solid", | ||
borderColor: "whiteAlpha.50", | ||
}; | ||
|
||
const icon = colorMode === "light" ? faMoon : faSun; | ||
const title = colorMode === "light" ? "Dark Mode" : "Light Mode"; | ||
return ( | ||
<header> | ||
<IconButton | ||
{...style} | ||
icon={<FontAwesomeIcon icon={icon} />} | ||
onClick={toggleColorMode} | ||
> | ||
Toggle {colorMode === "light" ? "Dark" : "Light"} | ||
</IconButton> | ||
</header> | ||
<MenuItem title={title} onClick={toggleColorMode}> | ||
<FontAwesomeIcon icon={icon} /> | ||
</MenuItem> | ||
); | ||
}; |
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.