Skip to content

Commit

Permalink
Clean up width of elements
Browse files Browse the repository at this point in the history
  • Loading branch information
havfo committed Mar 14, 2024
1 parent 18e73bd commit fae3891
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 54 deletions.
4 changes: 2 additions & 2 deletions src/components/democratic/Democratic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const DemocraticDiv = styled(Box)<DemocraticDivProps>(({
horizontal,
spotlights,
}) => ({
width: horizontal ? '25%' : '100%',
height: headless ? `calc(${horizontal || !spotlights ? '100' : '25'}% - 8px)` : `calc(${horizontal || !spotlights ? '100' : '25'}% - 64px)`,
width: horizontal ? '25rem' : '100%',
height: headless ? `calc(${horizontal || !spotlights ? '100%' : '25rem'} - 8px)` : `calc(${horizontal || !spotlights ? '100%' : '25rem'} - 64px)`,
marginBottom: headless ? 0 : 64,
display: 'flex',
flexDirection: 'row',
Expand Down
45 changes: 1 addition & 44 deletions src/components/maincontent/MainContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,60 +41,19 @@ const MainContainer = styled(Box)<MainContainerProps>(({ theme, horizontal }) =>

interface SideContentProps {
verticaldivide?: number;
dynamicwidth?: number;
bothopen?: number;
}

const SideContent = styled(Box)<SideContentProps>(({
theme,
verticaldivide,
dynamicwidth,
bothopen,
}) => ({
height: '100%',
display: 'flex',
flexDirection: verticaldivide ? 'column' : 'row',
gap: theme.spacing(0.5),
...(dynamicwidth && {
width: '40vw',
[theme.breakpoints.down('xl')]: {
width: '50vw'
},
[theme.breakpoints.down('lg')]: {
width: '60vw'
},
[theme.breakpoints.down('md')]: {
width: '70vw'
},
[theme.breakpoints.down('sm')]: {
width: '80vw'
},
...(!verticaldivide && {
...(bothopen ? {
width: '60vw',
[theme.breakpoints.down('xl')]: {
width: '70vw'
},
[theme.breakpoints.down('lg')]: {
width: '80vw'
},
[theme.breakpoints.down('md')]: {
width: '90vw'
},
} : {
width: '30vw',
[theme.breakpoints.down('xl')]: {
width: '40vw'
},
[theme.breakpoints.down('lg')]: {
width: '50vw'
},
[theme.breakpoints.down('md')]: {
width: '60vw'
},
}),
})
}),
width: bothopen && !verticaldivide ? '60rem' : '30rem',
}));

interface SideContainerProps {
Expand Down Expand Up @@ -123,7 +82,6 @@ const MainContent = (): JSX.Element => {
const eitherOpen = chatOpen || participantListOpen;
const bothOpen = chatOpen && participantListOpen;
const verticalDivide = useAppSelector((state) => state.settings.verticalDivide);
const dynamicWidth = useAppSelector((state) => state.settings.dynamicWidth);
const headless = useAppSelector((state) => state.room.headless);
const spotlightsVisible = useAppSelector(selectedVideoBoxesSelector) > 0;
const videosVisible = useAppSelector(videoBoxesSelector) > 0;
Expand Down Expand Up @@ -165,7 +123,6 @@ const MainContent = (): JSX.Element => {
{ !isMobile && eitherOpen &&
<SideContent
verticaldivide={verticalDivide ? 1 : 0}
dynamicwidth={dynamicWidth ? 1 : 0}
bothopen={bothOpen ? 1 : 0}
>
{ participantListOpen && <SideContainer height={height} width='100%'><ParticipantList /></SideContainer> }
Expand Down
4 changes: 2 additions & 2 deletions src/components/spotlights/Spotlights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const SpotlightsDiv = styled(Box)<SpotlightsDivProps>(({
horizontal,
videos,
}) => ({
width: horizontal ? '75%' : '100%',
height: headless || (!horizontal && videos) ? `calc(${horizontal || !videos ? '100' : '75'}% - 8px)` : `calc(${horizontal || !videos ? '100' : '75'}% - 64px)`,
width: '100%',
height: headless || (!horizontal && videos) ? 'calc(100% - 8px)' : 'calc(100% - 64px)',
marginBottom: headless || !horizontal ? 0 : 64,
display: 'flex',
flexDirection: 'row',
Expand Down
7 changes: 1 addition & 6 deletions src/store/slices/settingsSlice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export interface SettingsState {
hideNonVideo: boolean;
hideSelfView: boolean;
verticalDivide: boolean;
dynamicWidth: boolean;
aspectRatio: number;
selectedAudioDevice?: string;
selectedAudioOutputDevice?: string;
Expand Down Expand Up @@ -53,7 +52,6 @@ const initialState: SettingsState = {
hideNonVideo: edumeetConfig.hideNonVideo,
hideSelfView: false,
verticalDivide: true,
dynamicWidth: true,
aspectRatio: edumeetConfig.aspectRatio,
audioPreset: edumeetConfig.audioPreset,
audioPresets: edumeetConfig.audioPresets,
Expand Down Expand Up @@ -99,9 +97,6 @@ const settingsSlice = createSlice({
setVerticalDivide: ((state, action: PayloadAction<boolean>) => {
state.verticalDivide = action.payload;
}),
setDynamicWidth: ((state, action: PayloadAction<boolean>) => {
state.dynamicWidth = action.payload;
}),
setAspectRatio: ((state, action: PayloadAction<number>) => {
state.aspectRatio = action.payload;
}),
Expand Down Expand Up @@ -181,4 +176,4 @@ const settingsSlice = createSlice({
});

export const settingsActions = settingsSlice.actions;
export default settingsSlice;
export default settingsSlice;

0 comments on commit fae3891

Please sign in to comment.