forked from Ivasoft/mattermost-mobile
* MM-10193 for landscape Feature Commit for MM-10193 to the landscape feature with latest pull. This is the initial commit with SafeAreaView in place, but should not be merged into master as this is step one and not suitable for production. Another commit will be following with adjustments to allow SafeAreaView to display correctly for users. * MM-10193 for landscape Feature Commit for MM-10193 to the landscape feature with latest pull. This is the initial commit with SafeAreaView in place, but should not be merged into master as this is step one and not suitable for production. Another commit will be following with adjustments to allow SafeAreaView to display correctly for users. * MM-10193 Extend design elements for iPhoneX SafeAreaViews This is the second portion of the MM-10193 changes for the landscape feature. This item was to extend the design elements for the application into the SafeAreaView so the application looks uniform on the iPhoneX. * MM-10193 Patch for Snapshot tests and eslint * MM-10193 Re-Patch These chanbes mistakenly got reverted from last Patch * MM-10193 Updates for PR Fixed the 4 screens from the text box that were missed. Updated the padding to run from a method. * Revert "MM-10193 Updates for PR" This reverts commitfe8d650ce3. * MM-10193 Updates for PR This reverts commit4966d83d54. Applied Updated Snapshots * MM-10193 Updated Modifier for iphone_x_spacing Updated Modifier for iphone_x_spacing * MM-10193 Updates for Review Review changes for Post Textbox and a few states that were unavailable. * MM-10193 Fix Longpress padding Fixed longpress padding for Channel Info and Edit Post views. * MM-10193 Update isLandscape Updated isLandscape to pull directly from dimensions. Updated padding for Recent Mentions and Flagged Posts. * MM-10193 Updates for review longpost Updated for longpost padding. Fixed issue with notifications not padding right correctly. * MM-10193 Update with Cleanup Reverted Cocoapods back to 1.5.3. Cleaned up spacing in two files. * MM-10193 Merge Conflict Updates Updates to resolve merge conflicts
65 lines
2.1 KiB
JavaScript
65 lines
2.1 KiB
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import React, {PureComponent} from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import {ActivityIndicator, View} from 'react-native';
|
|
|
|
import FormattedText from 'app/components/formatted_text';
|
|
import {makeStyleSheetFromTheme, changeOpacity} from 'app/utils/theme';
|
|
import {paddingHorizontal as padding} from 'app/components/safe_area_view/iphone_x_spacing';
|
|
|
|
export default class AutocompleteSectionHeader extends PureComponent {
|
|
static propTypes = {
|
|
defaultMessage: PropTypes.string.isRequired,
|
|
id: PropTypes.string.isRequired,
|
|
loading: PropTypes.bool,
|
|
theme: PropTypes.object.isRequired,
|
|
isLandscape: PropTypes.bool.isRequired,
|
|
};
|
|
|
|
static defaultProps = {
|
|
isLandscape: false,
|
|
};
|
|
|
|
render() {
|
|
const {defaultMessage, id, loading, theme, isLandscape} = this.props;
|
|
const style = getStyleFromTheme(theme);
|
|
|
|
return (
|
|
<View style={style.sectionWrapper}>
|
|
<View style={[style.section, padding(isLandscape)]}>
|
|
<FormattedText
|
|
id={id}
|
|
defaultMessage={defaultMessage}
|
|
style={style.sectionText}
|
|
/>
|
|
{loading && <ActivityIndicator size='small'/>}
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|
|
}
|
|
|
|
const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
|
|
return {
|
|
section: {
|
|
justifyContent: 'center',
|
|
paddingHorizontal: 8,
|
|
backgroundColor: changeOpacity(theme.centerChannelColor, 0.1),
|
|
borderTopWidth: 1,
|
|
borderTopColor: changeOpacity(theme.centerChannelColor, 0.2),
|
|
flexDirection: 'row',
|
|
},
|
|
sectionText: {
|
|
fontSize: 12,
|
|
color: changeOpacity(theme.centerChannelColor, 0.7),
|
|
paddingVertical: 7,
|
|
flex: 1,
|
|
},
|
|
sectionWrapper: {
|
|
backgroundColor: theme.centerChannelBg,
|
|
},
|
|
};
|
|
});
|