Files
jitsi-meet/react/features/speaker-stats/components/SpeakerStatsItem.js
Steffen Kolmer e9675453e1 feat: Make Jitsi WCAG 2.1 compliant (#8921)
* Make Jitsi WCAG 2.1 compliant

* Fixed password form keypress handling

* Added keypress handler to name form

* Removed unneccessary dom query

* Fixed mouse hove style

* Removed obsolete css rules

* accessibilty background feature

* Merge remote-tracking branch 'upstream/master' into nic/fix/merge-conflicts

* fix error

* add german translation

* Fixed merge issue

* Add id prop back to device selection

* Fixed lockfile

Co-authored-by: AHMAD KADRI <52747422+ahmadkadri@users.noreply.github.com>
2021-06-10 07:48:44 -05:00

82 lines
2.1 KiB
JavaScript

/* @flow */
import React, { Component } from 'react';
import { translate } from '../../base/i18n';
import TimeElapsed from './TimeElapsed';
/**
* The type of the React {@code Component} props of {@link SpeakerStatsItem}.
*/
type Props = {
/**
* The name of the participant.
*/
displayName: string,
/**
* The total milliseconds the participant has been dominant speaker.
*/
dominantSpeakerTime: number,
/**
* True if the participant is no longer in the meeting.
*/
hasLeft: boolean,
/**
* True if the participant is currently the dominant speaker.
*/
isDominantSpeaker: boolean,
/**
* Invoked to obtain translated strings.
*/
t: Function
};
/**
* React component for display an individual user's speaker stats.
*
* @extends Component
*/
class SpeakerStatsItem extends Component<Props> {
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
* @returns {ReactElement}
*/
render() {
const hasLeftClass = this.props.hasLeft ? 'status-user-left' : '';
const rowDisplayClass = `speaker-stats-item ${hasLeftClass}`;
const dotClass = this.props.isDominantSpeaker
? 'status-active' : 'status-inactive';
const speakerStatusClass = `speaker-stats-item__status-dot ${dotClass}`;
return (
<div className = { rowDisplayClass }>
<div className = 'speaker-stats-item__status'>
<span className = { speakerStatusClass } />
</div>
<div
aria-label = { this.props.t('speakerStats.speakerStats') }
className = 'speaker-stats-item__name'>
{ this.props.displayName }
</div>
<div
aria-label = { this.props.t('speakerStats.speakerTime') }
className = 'speaker-stats-item__time'>
<TimeElapsed
time = { this.props.dominantSpeakerTime } />
</div>
</div>
);
}
}
export default translate(SpeakerStatsItem);