fix: blocked list overflow by setting parent width correctly

pull/3131/head
Audric Ackermann 9 months ago
parent 4152e4a59d
commit 4b0b813362

@ -952,7 +952,7 @@
.module-left-pane { .module-left-pane {
display: inline-flex; display: inline-flex;
flex-direction: column; flex-direction: column;
width: 380px; width: var(--left-panel-width);
height: 100%; height: 100%;
} }

@ -503,7 +503,7 @@ label {
} }
.session-settings { .session-settings {
width: 100%; width: var(--main-panel-content-width);
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;

@ -53,7 +53,7 @@
flex-grow: 1; flex-grow: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
max-width: calc(100vw - 380px); width: var(--main-panel-content-width);
height: 100%; height: 100%;
.selection-mode { .selection-mode {

@ -76,7 +76,6 @@ export const MemberListItem = (props: {
isZombie?: boolean; isZombie?: boolean;
inMentions?: boolean; // set to true if we are rendering members but in the Mentions picker inMentions?: boolean; // set to true if we are rendering members but in the Mentions picker
disableBg?: boolean; disableBg?: boolean;
maxNameWidth?: string;
isAdmin?: boolean; // if true, we add a small crown on top of their avatar isAdmin?: boolean; // if true, we add a small crown on top of their avatar
onSelect?: (pubkey: string) => void; onSelect?: (pubkey: string) => void;
onUnselect?: (pubkey: string) => void; onUnselect?: (pubkey: string) => void;
@ -91,7 +90,6 @@ export const MemberListItem = (props: {
onUnselect, onUnselect,
inMentions, inMentions,
disableBg, disableBg,
maxNameWidth,
dataTestId, dataTestId,
} = props; } = props;
@ -118,7 +116,7 @@ export const MemberListItem = (props: {
> >
<StyledInfo> <StyledInfo>
<AvatarItem memberPubkey={pubkey} isAdmin={isAdmin || false} /> <AvatarItem memberPubkey={pubkey} isAdmin={isAdmin || false} />
<StyledName maxWidth={maxNameWidth}>{memberName}</StyledName> <StyledName>{memberName}</StyledName>
</StyledInfo> </StyledInfo>
{!inMentions && ( {!inMentions && (

@ -52,7 +52,7 @@ function makeLookup<T>(items: Array<T>, key: string): { [key: string]: T } {
moment.locale((window.i18n as any).getLocale()); moment.locale((window.i18n as any).getLocale());
const StyledGutter = styled.div` const StyledGutter = styled.div`
width: 380px !important; width: var(--left-panel-width) !important;
transition: none; transition: none;
`; `;

@ -1,7 +1,7 @@
import styled from 'styled-components'; import styled from 'styled-components';
export const LeftPaneSectionContainer = styled.div` export const LeftPaneSectionContainer = styled.div`
width: 80px; width: var(--actions-panel-width);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;

@ -63,7 +63,6 @@ const BlockedEntries = (props: {
onSelect={addToSelected} onSelect={addToSelected}
onUnselect={removeFromSelected} onUnselect={removeFromSelected}
disableBg={true} disableBg={true}
maxNameWidth={'33vw'}
/> />
); );
})} })}

@ -3,7 +3,7 @@ import { hexColorToRGB } from '../util/hexColorToRGB';
import { COLORS } from './constants/colors'; import { COLORS } from './constants/colors';
// These variables are independent of the current theme // These variables are independent of the current theme
export type ThemeGlobals = { type ThemeGlobals = {
/* Fonts */ /* Fonts */
'--font-default': string; '--font-default': string;
'--font-accent': string; '--font-accent': string;
@ -92,6 +92,15 @@ export type ThemeGlobals = {
'--right-panel-height': string; '--right-panel-height': string;
'--right-panel-attachment-width': string; '--right-panel-attachment-width': string;
'--right-panel-attachment-height': string; '--right-panel-attachment-height': string;
/* Left Panel */
'--left-panel-width': string;
/* Actions panel (the 80px of the 380px of the left pane) */
'--actions-panel-width': string;
/* Main panel */
'--main-panel-content-width': string;
}; };
// These are only set once in the global style (at root). // These are only set once in the global style (at root).
@ -166,6 +175,10 @@ export const THEME_GLOBALS: ThemeGlobals = {
'--right-panel-attachment-width': 'calc(var(--right-panel-width) - 2 * var(--margins-2xl) - 7px)', '--right-panel-attachment-width': 'calc(var(--right-panel-width) - 2 * var(--margins-2xl) - 7px)',
'--right-panel-attachment-height': '--right-panel-attachment-height':
'calc(var(--right-panel-height) - 2 * var(--margins-2xl) -7px)', 'calc(var(--right-panel-height) - 2 * var(--margins-2xl) -7px)',
'--left-panel-width': '380px',
'--actions-panel-width': '80px',
'--main-panel-content-width': 'calc(100vw - var(--left-panel-width))',
}; };
// These should only be needed for the global style (at root). // These should only be needed for the global style (at root).

Loading…
Cancel
Save