From 8aea409ae6056d8125da9f83a403272a86b1b20f Mon Sep 17 00:00:00 2001 From: Chris Duarte Date: Fri, 17 Feb 2017 11:07:52 -0800 Subject: [PATCH] Webhook post override (#273) --- app/components/post/post.js | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/app/components/post/post.js b/app/components/post/post.js index 52ba36a3e..273322e9a 100644 --- a/app/components/post/post.js +++ b/app/components/post/post.js @@ -3,6 +3,7 @@ import React from 'react'; import { + Image, StyleSheet, Text, TouchableHighlight, @@ -78,6 +79,11 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { }, systemMessage: { opacity: 0.5 + }, + webhookMessage: { + color: theme.centerChannelColor, + fontSize: 16, + fontWeight: '600' } }); }); @@ -162,6 +168,7 @@ export default class Post extends React.Component { render() { const style = getStyleSheet(this.props.theme); + const PROFILE_PICTURE_SIZE = 32; let profilePicture; let displayName; @@ -171,8 +178,8 @@ export default class Post extends React.Component { ); @@ -185,11 +192,27 @@ export default class Post extends React.Component { ); messageStyle = [style.message, style.systemMessage]; + } else if (this.props.post.props && this.props.post.props.from_webhook) { + profilePicture = ( + + + + ); + + displayName = this.props.post.props.override_username; + messageStyle = [style.message, style.webhookMessage]; } else { profilePicture = ( );