added column on the left side of the chat drawer for team icons

This commit is contained in:
Carter 2026-02-24 12:58:35 -06:00
parent 2413cc36d1
commit 98d87ed8f7
2 changed files with 73 additions and 42 deletions

View file

@ -162,10 +162,7 @@ export default function UserWrapper(props: Props) {
document.head.appendChild(style); document.head.appendChild(style);
} }
console.log(isMobile)
if (isMobile) { if (isMobile) {
console.log("isMobile")
style.textContent = ` style.textContent = `
#crisp-chatbox [aria-label="Open chat"] { #crisp-chatbox [aria-label="Open chat"] {
bottom: 6em !important; bottom: 6em !important;

View file

@ -1,16 +1,15 @@
import { ChevronRight } from "@mui/icons-material"; import { ChevronRight } from "@mui/icons-material";
import { Box, Drawer, IconButton, Theme, Typography } from "@mui/material"; import { Avatar, Box, Drawer, IconButton, Theme, Typography } from "@mui/material";
import { makeStyles } from "@mui/styles"; import { makeStyles } from "@mui/styles";
import { useMobile } from "hooks"; import { useMobile } from "hooks";
import { Team } from "models"; import { Team } from "models";
import Chat from "./Chat"; import Chat from "./Chat";
import { pond } from "protobuf-ts/pond"; import { pond } from "protobuf-ts/pond";
const useStyles = makeStyles((theme: Theme) => { const useStyles = makeStyles<Theme>((theme: Theme) => ({
return ({
chatDrawer: { chatDrawer: {
display: "flex", display: "flex",
flexDirection: "column", // Arrange children vertically flexDirection: "column",
backgroundColor: theme.palette.background.default, backgroundColor: theme.palette.background.default,
height: "100%", height: "100%",
maxHeight: "100%", maxHeight: "100%",
@ -25,17 +24,16 @@ const useStyles = makeStyles((theme: Theme) => {
chatDrawerMobile: { chatDrawerMobile: {
backgroundColor: theme.palette.background.default, backgroundColor: theme.palette.background.default,
height: "auto", height: "auto",
width: "100%" width: "100%",
}, },
drawerHeader: { drawerHeader: {
display: "flex", display: "flex",
alignItems: "center", alignItems: "center",
padding: theme.spacing(1), padding: theme.spacing(1),
...theme.mixins.toolbar, ...theme.mixins.toolbar,
justifyContent: "flex-start" justifyContent: "flex-start",
} },
}); }));
});
interface Props { interface Props {
open: boolean; open: boolean;
@ -48,8 +46,43 @@ export function ChatDrawer(props: Props) {
const isMobile = useMobile(); const isMobile = useMobile();
const classes = useStyles() const classes = useStyles()
console.log(team.settings.avatar)
return ( return (
<Drawer open={open} onClose={onClose} anchor="right" > <Drawer
open={open}
onClose={onClose}
anchor="right"
slotProps={{
paper: {
sx: isMobile ? { width: "100%" } : undefined,
},
}}
>
<Box display="flex" flexDirection="row" height="100%">
{/* Side icon column */}
<Box
display="flex"
flexDirection="column"
alignItems="center"
padding={1}
gap={1}
sx={(theme: Theme) => ({
backgroundColor: theme.palette.background.paper,
borderRight: `1px solid ${theme.palette.divider}`,
})}
>
{/* Add your icons here */}
<IconButton >
{/* <SomeIcon /> */}
<Avatar src={team.settings.avatar} />
</IconButton>
<IconButton>
{/* <AnotherIcon /> */}
</IconButton>
</Box>
{/* Main chat area */}
<Box className={isMobile ? classes.chatDrawerMobile : classes.chatDrawer}> <Box className={isMobile ? classes.chatDrawerMobile : classes.chatDrawer}>
<Box className={classes.drawerHeader}> <Box className={classes.drawerHeader}>
<IconButton onClick={onClose}> <IconButton onClick={onClose}>
@ -58,7 +91,8 @@ export function ChatDrawer(props: Props) {
<Typography>{team.name()} Chat</Typography> <Typography>{team.name()} Chat</Typography>
</Box> </Box>
<Box className={classes.chatContainer}> <Box className={classes.chatContainer}>
<Chat objectKey={team.settings.key} type={pond.NoteType.NOTE_TYPE_TEAM}/> <Chat objectKey={team.settings.key} type={pond.NoteType.NOTE_TYPE_TEAM} />
</Box>
</Box> </Box>
</Box> </Box>
</Drawer> </Drawer>