jiti-meet/react/features/dial-out/components/CountryIcon.js

40 lines
899 B
JavaScript
Raw Normal View History

import PropTypes from 'prop-types';
2017-05-19 15:12:24 +00:00
import React, { Component } from 'react';
/**
2017-06-07 16:45:04 +00:00
* Implements a React {@link Component} to render a country flag icon.
2017-05-19 15:12:24 +00:00
*/
2017-06-07 16:45:04 +00:00
export default class CountryIcon extends Component {
2017-05-19 15:12:24 +00:00
/**
* {@code CountryIcon}'s property types.
*
* @static
*/
static propTypes = {
/**
* The css style class name.
*/
className: PropTypes.string,
2017-05-19 15:12:24 +00:00
/**
* The 2-letter country code.
*/
countryCode: PropTypes.string
};
2017-05-19 15:12:24 +00:00
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
* @returns {ReactElement}
*/
render() {
const iconClassName
= `flag-icon flag-icon-${
this.props.countryCode} flag-icon-squared ${
this.props.className}`;
2017-05-19 15:12:24 +00:00
return <span className = { iconClassName } />;
}
}