Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/components/ParticipantInfo/ParticipantInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import usePublications from '../../hooks/usePublications/usePublications';
import useTrack from '../../hooks/useTrack/useTrack';
import useParticipantIsReconnecting from '../../hooks/useParticipantIsReconnecting/useParticipantIsReconnecting';

const BORDER_SIZE = 2;

const useStyles = makeStyles((theme: Theme) =>
createStyles({
container: {
Expand All @@ -31,8 +29,8 @@ const useStyles = makeStyles((theme: Theme) =>
objectFit: 'contain !important',
},
borderRadius: '4px',
border: `${BORDER_SIZE}px solid rgb(245, 248, 255)`,
paddingTop: `calc(${(9 / 16) * 100}% - ${BORDER_SIZE}px)`,
border: `${theme.participantBorderWidth}px solid rgb(245, 248, 255)`,
paddingTop: `calc(${(9 / 16) * 100}% - ${theme.participantBorderWidth}px)`,
background: 'black',
[theme.breakpoints.down('sm')]: {
height: theme.sidebarMobileHeight,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ParticipantList/ParticipantList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const useStyles = makeStyles((theme: Theme) =>
overflowY: 'initial',
overflowX: 'auto',
display: 'flex',
padding: '8px',
padding: `${theme.sidebarMobilePadding}px`,
},
},
transparentBackground: {
Expand Down
28 changes: 17 additions & 11 deletions src/components/Room/Room.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@ import ParticipantList from '../ParticipantList/ParticipantList';
import { styled } from '@material-ui/core/styles';
import MainParticipant from '../MainParticipant/MainParticipant';

const Container = styled('div')(({ theme }) => ({
position: 'relative',
height: '100%',
display: 'grid',
gridTemplateColumns: `1fr ${theme.sidebarWidth}px`,
gridTemplateRows: '100%',
[theme.breakpoints.down('sm')]: {
gridTemplateColumns: `100%`,
gridTemplateRows: `1fr ${theme.sidebarMobileHeight + 16}px`,
},
}));
const Container = styled('div')(({ theme }) => {
const totalMobileSidebarHeight = `${theme.sidebarMobileHeight +
theme.sidebarMobilePadding * 2 +
theme.participantBorderWidth}px`;

return {
position: 'relative',
height: '100%',
display: 'grid',
gridTemplateColumns: `1fr ${theme.sidebarWidth}px`,
gridTemplateRows: '100%',
[theme.breakpoints.down('sm')]: {
gridTemplateColumns: `100%`,
gridTemplateRows: `calc(100% - ${totalMobileSidebarHeight}) ${totalMobileSidebarHeight}`,
},
};
});

export default function Room() {
return (
Expand Down
6 changes: 6 additions & 0 deletions src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ declare module '@material-ui/core/styles/createMuiTheme' {
footerHeight: number;
mobileTopBarHeight: number;
mobileFooterHeight: number;
sidebarMobilePadding: number;
participantBorderWidth: number;
}

// allow configuration using `createMuiTheme`
Expand All @@ -18,6 +20,8 @@ declare module '@material-ui/core/styles/createMuiTheme' {
footerHeight: number;
mobileTopBarHeight: number;
mobileFooterHeight: number;
sidebarMobilePadding: number;
participantBorderWidth: number;
}
}

Expand Down Expand Up @@ -114,5 +118,7 @@ export default createMuiTheme({
mobileFooterHeight: 56,
sidebarWidth: 355,
sidebarMobileHeight: 90,
sidebarMobilePadding: 8,
participantBorderWidth: 2,
mobileTopBarHeight: 52,
});