* 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
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import React from 'react';
|
|
import {Text, TextStyle} from 'react-native';
|
|
|
|
import FormattedText from '@components/formatted_text';
|
|
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
|
|
|
|
import type {Theme} from '@mm-redux/types/preferences';
|
|
|
|
interface ComponentProps {
|
|
text: string | typeof FormattedText;
|
|
theme: Theme;
|
|
textStyle?: TextStyle;
|
|
ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';
|
|
numberOfLines?: number;
|
|
}
|
|
|
|
const CustomStatusText = ({text, theme, textStyle, ellipsizeMode, numberOfLines}: ComponentProps) => (
|
|
<Text
|
|
style={[getStyleSheet(theme).label, textStyle]}
|
|
ellipsizeMode={ellipsizeMode}
|
|
numberOfLines={numberOfLines}
|
|
>
|
|
{text}
|
|
</Text>
|
|
);
|
|
|
|
export default CustomStatusText;
|
|
|
|
const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => {
|
|
return {
|
|
label: {
|
|
color: changeOpacity(theme.centerChannelColor, 0.5),
|
|
fontSize: 17,
|
|
textAlignVertical: 'center',
|
|
includeFontPadding: false,
|
|
},
|
|
};
|
|
});
|