2020-05-18 12:07:09 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import Tooltip from '@atlaskit/tooltip';
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { translate } from '../../../base/i18n';
|
2022-11-11 07:58:55 +00:00
|
|
|
import { IconExclamationTriangle } from '../../../base/icons/svg';
|
2021-04-08 08:35:26 +00:00
|
|
|
import { Label } from '../../../base/label';
|
2021-09-29 12:06:03 +00:00
|
|
|
import { COLORS } from '../../../base/label/constants';
|
2020-05-18 12:07:09 +00:00
|
|
|
import { connect } from '../../../base/redux';
|
|
|
|
import AbstractInsecureRoomNameLabel, { _mapStateToProps } from '../AbstractInsecureRoomNameLabel';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders a label indicating that we are in a room with an insecure name.
|
|
|
|
*/
|
|
|
|
class InsecureRoomNameLabel extends AbstractInsecureRoomNameLabel {
|
|
|
|
/**
|
2021-03-16 15:59:33 +00:00
|
|
|
* Renders the platform dependent content.
|
2020-05-18 12:07:09 +00:00
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
_render() {
|
|
|
|
return (
|
|
|
|
<Tooltip
|
|
|
|
content = { this.props.t('security.insecureRoomNameWarning') }
|
2021-04-08 08:35:26 +00:00
|
|
|
position = 'bottom'>
|
|
|
|
<Label
|
2021-09-29 12:06:03 +00:00
|
|
|
color = { COLORS.red }
|
2022-11-11 07:58:55 +00:00
|
|
|
icon = { IconExclamationTriangle } />
|
2020-05-18 12:07:09 +00:00
|
|
|
</Tooltip>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default translate(connect(_mapStateToProps)(InsecureRoomNameLabel));
|