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

38 lines
858 B
JavaScript
Raw Normal View History

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: React.PropTypes.string,
/**
* The 2-letter country code.
*/
countryCode: React.PropTypes.string
};
2017-05-19 15:12:24 +00:00
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
* @returns {ReactElement}
*/
render() {
const iconClassName
2017-06-07 16:45:04 +00:00
= `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 } />;
}
}