* Add linter rules for import order and type member delimiters * Remove unneeded group * Group all app/* imports before the internal imports * Move app/ imports before parent imports * Separate @node_modules imports into a different group * Substitute app paths by aliases * Fix @node_modules import order and add test related modules * Add aliases for types and test, and group import types
58 lines
1.7 KiB
JavaScript
58 lines
1.7 KiB
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import PropTypes from 'prop-types';
|
|
import React, {PureComponent} from 'react';
|
|
import {View} from 'react-native';
|
|
|
|
import Markdown from '@components/markdown';
|
|
import {getMarkdownTextStyles, getMarkdownBlockStyles} from '@utils/markdown';
|
|
import {makeStyleSheetFromTheme} from '@utils/theme';
|
|
|
|
export default class DialogIntroductionText extends PureComponent {
|
|
static propTypes = {
|
|
value: PropTypes.string.isRequired,
|
|
theme: PropTypes.object.isRequired,
|
|
};
|
|
|
|
render() {
|
|
const {
|
|
value,
|
|
theme,
|
|
} = this.props;
|
|
|
|
if (value) {
|
|
const style = getStyleFromTheme(theme);
|
|
const blockStyles = getMarkdownBlockStyles(theme);
|
|
const textStyles = getMarkdownTextStyles(theme);
|
|
|
|
return (
|
|
<View style={style.introductionTextView}>
|
|
<Markdown
|
|
baseTextStyle={style.introductionText}
|
|
disableGallery={true}
|
|
textStyles={textStyles}
|
|
blockStyles={blockStyles}
|
|
value={value}
|
|
disableHashtags={true}
|
|
disableAtMentions={true}
|
|
disableChannelLink={true}
|
|
/>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
|
|
const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
|
|
return {
|
|
introductionTextView: {
|
|
marginHorizontal: 15,
|
|
},
|
|
introductionText: {
|
|
color: theme.centerChannelColor,
|
|
},
|
|
};
|
|
});
|