From a96fc2fc17fb939c653ac09f76ab435cf80540e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Fri, 21 Jan 2022 14:49:01 +0100 Subject: [PATCH] chore(cleanup) delete dead code --- css/premeeting/_lobby.scss | 45 -------- .../components/web/NotificationButton.js | 58 ---------- .../web/NotificationWithParticipants.js | 100 ------------------ .../web/ParticipantNotificationList.js | 82 -------------- 4 files changed, 285 deletions(-) delete mode 100644 react/features/notifications/components/web/NotificationButton.js delete mode 100644 react/features/notifications/components/web/NotificationWithParticipants.js delete mode 100644 react/features/notifications/components/web/ParticipantNotificationList.js diff --git a/css/premeeting/_lobby.scss b/css/premeeting/_lobby.scss index 292086515..99c343921 100644 --- a/css/premeeting/_lobby.scss +++ b/css/premeeting/_lobby.scss @@ -40,48 +40,3 @@ } } } - -.knocking-participants-container { - list-style-type: none; - padding: 0 15px 15px 15px; -} - -.knocking-participant { - align-items: center; - display: flex; - flex-direction: row; - margin: 8px 0; - - .details { - display: flex; - flex: 1; - flex-direction: column; - justify-content: space-evenly; - margin: 0 30px 0 10px; - } - - button { - align-self: unset; - margin: 0 5px; - } -} - -@media (max-width: 300px) { - #knocking-participant-list { - margin: 0; - text-align: center; - width: 100%; - - .avatar { - display: none; - } - } - - .knocking-participant { - flex-direction: column; - - .details { - margin: 0; - } - } -} diff --git a/react/features/notifications/components/web/NotificationButton.js b/react/features/notifications/components/web/NotificationButton.js deleted file mode 100644 index d50523c8d..000000000 --- a/react/features/notifications/components/web/NotificationButton.js +++ /dev/null @@ -1,58 +0,0 @@ -// @flow - -import React, { useCallback } from 'react'; -import { useDispatch } from 'react-redux'; - -type Props = { - - /** - * Action to be dispatched on click. - */ - action: Function, - - /** - * The text of the button. - */ - children: React$Node, - - /** - * CSS class of the button. - */ - className: string, - - /** - * CSS id of the button. - */ - id?: string, - - /** - * The participant. - */ - participant: Object, - - /** - * The `data-testid` used for the button. - */ - testId: string -} - -/** - * Component used to display an approve/reject button. - * - * @returns {React$Element<'button'>} - */ -export default function({ action, children, className, participant, id, testId }: Props) { - const dispatch = useDispatch(); - const onClick = useCallback(() => dispatch(action(participant.id)), [ dispatch, participant ]); - - return ( - - ); -} diff --git a/react/features/notifications/components/web/NotificationWithParticipants.js b/react/features/notifications/components/web/NotificationWithParticipants.js deleted file mode 100644 index f1e65da62..000000000 --- a/react/features/notifications/components/web/NotificationWithParticipants.js +++ /dev/null @@ -1,100 +0,0 @@ -// @flow - -import React from 'react'; - -import { Avatar } from '../../../base/avatar'; -import { HIDDEN_EMAILS } from '../../../lobby/constants'; - -import NotificationButton from './NotificationButton'; - -type Props = { - - /** - * Text used for button which triggeres `onApprove` action. - */ - approveButtonText: string, - - /** - * Callback used when clicking the ok/approve button. - */ - onApprove: Function, - - /** - * Callback used when clicking the reject button. - */ - onReject: Function, - - /** - * Array of participants to be displayed. - */ - participants: Array, - - /** - * Text for button which triggeres the `reject` action. - */ - rejectButtonText: string, - - - /** - * String prefix used for button `test-id`. - */ - testIdPrefix: string -} - -/** - * Component used to display a list of notifications based on a list of participants. - * This is visible only to moderators. - * - * @returns {React$Element<'div'> | null} - */ -export default function({ - approveButtonText, - onApprove, - onReject, - participants, - testIdPrefix, - rejectButtonText -}: Props): React$Element<'ul'> { - return ( - ); -} diff --git a/react/features/notifications/components/web/ParticipantNotificationList.js b/react/features/notifications/components/web/ParticipantNotificationList.js deleted file mode 100644 index 09098d798..000000000 --- a/react/features/notifications/components/web/ParticipantNotificationList.js +++ /dev/null @@ -1,82 +0,0 @@ -// @flow - -import React from 'react'; -import { useTranslation } from 'react-i18next'; - -import { Avatar } from '../../../base/avatar'; -import { HIDDEN_EMAILS } from '../../../lobby/constants'; - -import NotificationButton from './NotificationButton'; - -type Props = { - - /** - * Callback used when clicking the ok/approve button. - */ - onApprove: Function, - - /** - * Callback used when clicking the reject button. - */ - onReject: Function, - - /** - * Array of participants to be displayed. - */ - participants: Array, - - /** - * String prefix used for button `test-id`. - */ - testIdPrefix: string -} - -/** - * Component used to display a list of notifications based on a list of participants. - * This is visible only to moderators. - * - * @returns {React$Element<'div'> | null} - */ -export default function({ onApprove, onReject, participants, testIdPrefix }: Props): React$Element<'ul'> { - const { t } = useTranslation(); - - return ( -
    - { participants.map(p => ( -
  • - - -
    - - { p.name } - - { p.email && !HIDDEN_EMAILS.includes(p.email) && ( - - { p.email } - - ) } -
    - - { t('lobby.allow') } - - - { t('lobby.reject') } - -
  • - )) } -
); -}