mattermost-mobile/app/components/post_list/post/avatar/index.ts
Dean Whillier fb8238ab0b
[MM-37553] Update default themes (#5648)
* 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
2021-09-03 10:50:24 -04:00

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);