Skip to content
Snippets Groups Projects
Select Git revision
  • c745c11c43ca2ebdebd4945d452a4a4a7a69d03b
  • master default protected
  • v3-modify-mail
  • snyk-fix-207483a1e839c807f95a55077e86527d
  • translations_3b5aa4f3c755059914cfa23d7d2edcde_ru
  • translations_6e4a5e377a3e50f17e6402264fdbfcc6_ru
  • translations_3b5aa4f3c755059914cfa23d7d2edcde_fa_IR
  • translations_en-yml--master_fa_IR
  • snyk-fix-7d634f2eb65555f41bf06d6af930e812
  • translations_en-yml--master_ar
  • translations_3b5aa4f3c755059914cfa23d7d2edcde_el
  • jfederico-patch-1
  • v2
  • v3
  • v1
  • release-3.1.0.2
  • release-3.1.0.1
  • release-3.1.0
  • release-2.14.8.4
  • release-3.0.9.1
  • release-3.0.9
  • release-3.0.8.1
  • release-2.14.8.3
  • release-3.0.8
  • release-3.0.7.1
  • release-2.14.8.2
  • release-3.0.7
  • release-3.0.6.1
  • release-3.0.6
  • release-3.0.5.4
  • release-3.0.5.3
  • release-2.14.8.1
  • release-3.0.5.2
  • release-3.0.5.1
  • release-3.0.5
35 results

esbuild.mjs

Blame
  • Room.jsx 4.23 KiB
    // BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.
    //
    // Copyright (c) 2022 BigBlueButton Inc. and by respective authors (see below).
    //
    // This program is free software; you can redistribute it and/or modify it under the
    // terms of the GNU Lesser General Public License as published by the Free Software
    // Foundation; either version 3.0 of the License, or (at your option) any later
    // version.
    //
    // Greenlight is distributed in the hope that it will be useful, but WITHOUT ANY
    // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    // PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    //
    // You should have received a copy of the GNU Lesser General Public License along
    // with Greenlight; if not, see <http://www.gnu.org/licenses/>.
    
    import React from 'react';
    import {
      Stack, Button, Col, Row,
    } from 'react-bootstrap';
    import { Link, useParams } from 'react-router-dom';
    import { HomeIcon, Square2StackIcon } from '@heroicons/react/24/outline';
    import { toast } from 'react-toastify';
    import { useTranslation } from 'react-i18next';
    import { useAuth } from '../../../contexts/auth/AuthProvider';
    import { localizeDayDateTimeString } from '../../../helpers/DateTimeHelper';
    import FeatureTabs from './FeatureTabs';
    import Spinner from '../../shared_components/utilities/Spinner';
    import useRoom from '../../../hooks/queries/rooms/useRoom';
    import useStartMeeting from '../../../hooks/mutations/rooms/useStartMeeting';
    import MeetingBadges from '../MeetingBadges';
    import SharedBadge from './SharedBadge';
    import RoomNamePlaceHolder from './RoomNamePlaceHolder';
    import Title from '../../shared_components/utilities/Title';
    
    export default function Room() {
      const { t } = useTranslation();
      const { friendlyId } = useParams();
      const {
        isLoading: isRoomLoading, data: room,
      } = useRoom(friendlyId);
      const startMeeting = useStartMeeting(friendlyId);
      const currentUser = useAuth();
      const localizedTime = localizeDayDateTimeString(room?.last_session, currentUser?.language);
    
      function copyInvite() {
        navigator.clipboard.writeText(`${window.location}/join`);
        toast.success(t('toast.success.room.copied_meeting_url'));
      }
    
      return (
        <>
          <Title>{room?.name}</Title>
          <div className="wide-white">
            <Row className="pt-4">
              <Col>
                <Link to="/rooms">
                  <HomeIcon className="hi-m text-brand" />
                </Link>
              </Col>
            </Row>
            <Row className="py-5">
              <Col className="col-xxl-8">
                {
                    isRoomLoading
                      ? (
                        <RoomNamePlaceHolder />
                      ) : (
                        <Stack className="room-header-wrapper">
                          <Stack direction="horizontal" gap={2}>
                            <h1>{room?.name}</h1>
                            <Stack direction="horizontal" className="mb-1">
                              { room?.online
                                && <MeetingBadges count={room?.participants} />}
                              { room?.shared && <SharedBadge ownerName={room?.owner_name} /> }
                            </Stack>
                          </Stack>
                          { room?.last_session ? (
                            <span className="text-muted"> { t('room.last_session', { localizedTime }) }  </span>
                          ) : (
                            <span className="text-muted"> { t('room.no_last_session') } </span>
                          )}
                        </Stack>
                      )
                  }
              </Col>
              <Col>
                <Button variant="brand" className="start-meeting-btn mt-1 mx-2 float-end" onClick={startMeeting.mutate} disabled={startMeeting.isLoading}>
                  {startMeeting.isLoading && <Spinner className="me-2" />}
                  { room?.online ? (
                    t('room.meeting.join_meeting')
                  ) : (
                    t('room.meeting.start_meeting')
                  )}
                </Button>
                <Button variant="brand-outline" className="mt-1 mx-2 float-end" onClick={() => copyInvite()}>
                  <Square2StackIcon className="hi-s me-1" />
                  { t('copy') }
                </Button>
              </Col>
            </Row>
          </div>
    
          <FeatureTabs />
        </>
      );
    }