* new themes and theme type updates * update theme processing port newer functionality from webapp * update theme UI including new svg-based thumbnail * lint fixes * update snapshots and tests * update theme tile border approach * remove unused path component * remove old variable typo * remove old variable type from theme type * lint and snapshot updates * update snapshots
34 lines
1,017 B
TypeScript
34 lines
1,017 B
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {StyleProp, ViewStyle} from 'react-native';
|
|
import {connect} from 'react-redux';
|
|
|
|
import {getConfig} from '@mm-redux/selectors/entities/general';
|
|
import {getUser} from '@mm-redux/selectors/entities/users';
|
|
|
|
import Avatar from './avatar';
|
|
|
|
import type {Post} from '@mm-redux/types/posts';
|
|
import type {GlobalState} from '@mm-redux/types/store';
|
|
import type {Theme} from '@mm-redux/types/theme';
|
|
|
|
type OwnProps = {
|
|
pendingPostStyle?: StyleProp<ViewStyle>;
|
|
post: Post;
|
|
theme: Theme;
|
|
}
|
|
|
|
function mapStateToProps(state: GlobalState, ownProps: OwnProps) {
|
|
const {post} = ownProps;
|
|
const config = getConfig(state);
|
|
const user = getUser(state, post.user_id);
|
|
|
|
return {
|
|
enablePostIconOverride: config.EnablePostIconOverride === 'true',
|
|
userId: post.user_id,
|
|
isBot: (user ? user.is_bot : false),
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps)(Avatar);
|