diff --git a/src/components/ChatTranscript/ChatTranscript.tsx b/src/components/ChatTranscript/ChatTranscript.tsx index 5dca9c365..6b7327c87 100644 --- a/src/components/ChatTranscript/ChatTranscript.tsx +++ b/src/components/ChatTranscript/ChatTranscript.tsx @@ -1,10 +1,11 @@ -import { HTMLAttributes, useRef, useEffect, useState } from 'react' +import { HTMLAttributes, useRef, useEffect, useState, useContext } from 'react' import cx from 'classnames' import Box from '@mui/material/Box' +import useTheme from '@mui/material/styles/useTheme' import { Message as IMessage, InlineMedia } from 'models/chat' import { Message } from 'components/Message' -import useTheme from '@mui/material/styles/useTheme' +import { ShellContext } from 'contexts/ShellContext' export interface ChatTranscriptProps extends HTMLAttributes { messageLog: Array @@ -16,6 +17,7 @@ export const ChatTranscript = ({ messageLog, userId, }: ChatTranscriptProps) => { + const { showRoomControls } = useContext(ShellContext) const theme = useTheme() const boxRef = useRef(null) const [previousMessageLogLength, setPreviousMessageLogLength] = useState(0) @@ -69,7 +71,9 @@ export const ChatTranscript = ({ display: 'flex', flexDirection: 'column', py: transcriptMinPadding, + pt: showRoomControls ? theme.spacing(10) : theme.spacing(2), px: `max(${transcriptPaddingX}, ${transcriptMinPadding})`, + transition: `padding-top ${theme.transitions.duration.short}ms ${theme.transitions.easing.easeInOut}`, width: '100%', }} > diff --git a/src/components/Room/Room.tsx b/src/components/Room/Room.tsx index 0d385fc04..1086aa9ab 100644 --- a/src/components/Room/Room.tsx +++ b/src/components/Room/Room.tsx @@ -1,9 +1,9 @@ import { useContext } from 'react' import { useWindowSize } from '@react-hook/window-size' -import Collapse from '@mui/material/Collapse' import Zoom from '@mui/material/Zoom' import Box from '@mui/material/Box' import Divider from '@mui/material/Divider' +import useTheme from '@mui/material/styles/useTheme' import { v4 as uuid } from 'uuid' import { rtcConfig } from 'config/rtcConfig' @@ -40,6 +40,7 @@ export function Room({ password, userId, }: RoomProps) { + const theme = useTheme() const settingsContext = useContext(SettingsContext) const { showActiveTypingStatus } = settingsContext.getUserSettings() const { @@ -96,14 +97,16 @@ export function Room({ overflow: 'auto', }} > - + @@ -120,7 +123,7 @@ export function Room({ - +