mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-18 10:07:46 +00:00
[RN] Add connection indicator
This commit is contained in:
committed by
Zoltan Bettenbuk
parent
3217ef2bb4
commit
2b4ace75ae
53
react/features/base/react/components/native/BaseIndicator.js
Normal file
53
react/features/base/react/components/native/BaseIndicator.js
Normal file
@@ -0,0 +1,53 @@
|
||||
// @flow
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import { View } from 'react-native';
|
||||
|
||||
import { Icon } from '../../../font-icons';
|
||||
import { type StyleType } from '../../../styles';
|
||||
|
||||
import styles from './indicatorstyles';
|
||||
|
||||
type Props = {
|
||||
|
||||
/**
|
||||
* True if a highlighted background has to be applied.
|
||||
*/
|
||||
highlight: boolean,
|
||||
|
||||
/**
|
||||
* The name of the icon to be used as the indicator.
|
||||
*/
|
||||
icon: string,
|
||||
|
||||
/**
|
||||
* Additional style to be applied to the icon element.
|
||||
*/
|
||||
iconStyle: StyleType
|
||||
};
|
||||
|
||||
/**
|
||||
* Implements a base indicator to be reused across all native indicators on
|
||||
* the filmstrip.
|
||||
*/
|
||||
export default class BaseIndicator extends Component<Props> {
|
||||
/**
|
||||
* Implements React's {@link Component#render()}.
|
||||
*
|
||||
* @inheritdoc
|
||||
*/
|
||||
render() {
|
||||
const { highlight, icon, iconStyle } = this.props;
|
||||
|
||||
return (
|
||||
<View style = { highlight ? styles.highlightedIndicator : null }>
|
||||
<Icon
|
||||
name = { icon }
|
||||
style = { [
|
||||
styles.indicator,
|
||||
iconStyle
|
||||
] } />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user