added button to open crisp chat from the chat menu
This commit is contained in:
parent
c79c6baa1f
commit
baf59a2b78
9 changed files with 183 additions and 29 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { ChevronRight } from "@mui/icons-material";
|
||||
import { Avatar, Box, Drawer, IconButton, Theme, Typography } from "@mui/material";
|
||||
import { Avatar, Box, Divider, Drawer, IconButton, Theme, Typography } from "@mui/material";
|
||||
import { makeStyles } from "@mui/styles";
|
||||
import { useMobile } from "hooks";
|
||||
import { Team } from "models";
|
||||
|
|
@ -7,6 +7,8 @@ import Chat from "./Chat";
|
|||
import { pond } from "protobuf-ts/pond";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useTeamAPI } from "providers";
|
||||
import { openCrispChat } from './CrispChat';
|
||||
import RobotIcon from "products/CommonIcons/robotIcon";
|
||||
|
||||
const useStyles = makeStyles<Theme>((theme: Theme) => ({
|
||||
chatDrawer: {
|
||||
|
|
@ -60,6 +62,11 @@ export function ChatDrawer(props: Props) {
|
|||
})
|
||||
}, [teamAPI])
|
||||
|
||||
const openCrisp = () => {
|
||||
openCrispChat()
|
||||
onClose()
|
||||
}
|
||||
|
||||
return (
|
||||
<Drawer
|
||||
open={open}
|
||||
|
|
@ -93,6 +100,12 @@ export function ChatDrawer(props: Props) {
|
|||
>
|
||||
<Avatar src={team.settings.avatar} />
|
||||
</IconButton>
|
||||
<IconButton
|
||||
onClick={openCrisp}
|
||||
>
|
||||
<RobotIcon />
|
||||
</IconButton>
|
||||
<Box width={"100%"} borderBottom={"1px solid grey"} />
|
||||
{teams.map((t, i)=> {
|
||||
if (t.settings?.key === team.key()) return null;
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue