Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pagination&&grid): update design and logic for pagination and layout for grid [WPB-423] #18389

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from
Draft
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
3 changes: 3 additions & 0 deletions src/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@
"callReactionButtonsAriaLabel": "Emoji selection bar",
"callReactions": "Reactions",
"callReactionsAriaLabel": "Emoji {{emoji}} from {{from}}",
"callMenuMoreInteractions": "More settings",
"callMenuMoreButtonAriaLabel": "Select setting: {{setting}}",
"callMenuMoreButtonsAriaLabel": "More settings selection bar",
"callStateCbr": "Constant Bit Rate",
"callStateConnecting": "Connecting…",
"callStateIncoming": "Calling…",
Expand Down
10 changes: 7 additions & 3 deletions src/script/calling/Call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ import type {MediaDevicesHandler} from '../media/MediaDevicesHandler';

export type SerializedConversationId = string;

const NUMBER_OF_PARTICIPANTS_IN_ONE_PAGE = 9;

interface ActiveSpeaker {
clientId: string;
levelNow: number;
Expand All @@ -60,6 +58,7 @@ export class Call {
public blockMessages: boolean = false;
public currentPage: ko.Observable<number> = ko.observable(0);
public pages: ko.ObservableArray<Participant[]> = ko.observableArray();
public numberOfParticipantsInOnePage: number = 9;
readonly maximizedParticipant: ko.Observable<Participant | null>;
public readonly isActive: ko.PureComputed<boolean>;

Expand Down Expand Up @@ -215,6 +214,11 @@ export class Call {
return this.participants().filter(({user, clientId}) => !user.isMe || this.selfClientId !== clientId);
}

setNumberOfParticipantsInOnePage(participantsInOnePage: number): void {
this.numberOfParticipantsInOnePage = participantsInOnePage;
this.updatePages();
}

updatePages() {
const selfParticipant = this.getSelfParticipant();
const remoteParticipants = this.getRemoteParticipants().sort((p1, p2) => sortUsersByPriority(p1.user, p2.user));
Expand All @@ -223,7 +227,7 @@ export class Call {

const newPages = chunk<Participant>(
[selfParticipant, ...withVideo, ...withoutVideo].filter(Boolean),
NUMBER_OF_PARTICIPANTS_IN_ONE_PAGE,
this.numberOfParticipantsInOnePage,
);

this.currentPage(Math.min(this.currentPage(), newPages.length - 1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ export const CallingCell = ({
minimized
maximizedParticipant={maximizedParticipant}
selfParticipant={selfParticipant}
call={call}
setMaximizedParticipant={setMaximizedParticipant}
/>

Expand Down
53 changes: 0 additions & 53 deletions src/script/components/calling/FullscreenVideoCall.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,6 @@ export const classifiedBarStyles: CSSObject = {
display: 'flex',
};

export const videoControlActiveStyles = css`
background-color: var(--main-color);
border: 1px solid var(--main-color);
svg,
svg > path {
fill: var(--app-bg-secondary);
}
&:hover {
background-color: var(--background);
}
&:active {
background-color: var(--accent-color-highlight-inversed);
border: 1px solid var(--accent-color-focus);
}
`;

export const videoControlInActiveStyles = css`
background-color: var(--inactive-call-button-bg);
border: 1px solid var(--inactive-call-button-border);
Expand All @@ -57,37 +41,6 @@ export const videoControlInActiveStyles = css`
}
`;

export const videoControlDisabledStyles = css`
background-color: var(--disabled-call-button-bg);
border: 1px solid var(--disabled-call-button-border);
cursor: default;
svg {
fill: var(--disabled-call-button-svg);
}
`;

export const paginationButtonStyles: CSSObject = {
['& svg > path']: {
fill: 'var(--main-color)',
},
['&:focus-visible']: {
['& svg > path']: {
fill: 'var(--accent-color)',
},
outline: '1px solid var(--accent-color-focus)',
},
['&:not([disabled]):hover svg > path']: {
fill: 'var(--accent-color)',
},
['&:disabled svg > path']: {
fill: 'var(--disabled-call-button-svg)',
},
display: 'flex',
alignItems: 'center',
cursor: 'pointer',
height: '100%',
};

export const videoTopBarStyles: CSSObject = {
display: 'grid',
gridTemplateColumns: '1fr auto 1fr',
Expand All @@ -103,9 +56,3 @@ export const headerActionsWrapperStyles: CSSObject = {
marginLeft: 'auto',
padding: '0 6px',
};

export const paginationWrapperStyles: CSSObject = {
display: 'flex',
alignItems: 'center',
gap: '10px',
};
Loading
Loading