2019-01-13 19:34:38 +00:00
|
|
|
// @flow
|
|
|
|
|
2019-10-15 14:08:23 +00:00
|
|
|
import { ColorSchemeRegistry, schemeColor } from '../../../base/color-scheme';
|
2019-04-25 13:17:49 +00:00
|
|
|
import { BoxModel, ColorPalette } from '../../../base/styles';
|
2019-01-13 19:34:38 +00:00
|
|
|
|
2019-10-15 14:08:23 +00:00
|
|
|
const BUBBLE_RADIUS = 8;
|
|
|
|
|
2019-01-13 19:34:38 +00:00
|
|
|
/**
|
|
|
|
* The styles of the feature chat.
|
|
|
|
*
|
|
|
|
* NOTE: Sizes and colors come from the 8x8 guidelines. This is the first
|
|
|
|
* component to receive this treating, if others happen to have similar, we
|
|
|
|
* need to extract the brand colors and sizes into a branding feature (planned
|
|
|
|
* for the future).
|
|
|
|
*/
|
2019-03-20 21:23:19 +00:00
|
|
|
export default {
|
2019-01-13 19:34:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Wrapper View for the avatar.
|
|
|
|
*/
|
|
|
|
avatarWrapper: {
|
2019-05-06 18:21:41 +00:00
|
|
|
marginRight: 8,
|
|
|
|
width: 32
|
2019-01-13 19:34:38 +00:00
|
|
|
},
|
|
|
|
|
2019-08-05 10:46:10 +00:00
|
|
|
chatLink: {
|
|
|
|
color: ColorPalette.blue
|
|
|
|
},
|
|
|
|
|
2019-01-13 19:34:38 +00:00
|
|
|
/**
|
|
|
|
* Wrapper for the details together, such as name, message and time.
|
|
|
|
*/
|
|
|
|
detailsWrapper: {
|
|
|
|
alignItems: 'flex-start',
|
|
|
|
flex: 1,
|
|
|
|
flexDirection: 'column'
|
|
|
|
},
|
|
|
|
|
2019-11-21 14:26:57 +00:00
|
|
|
emptyComponentWrapper: {
|
|
|
|
alignSelf: 'center',
|
|
|
|
flex: 1,
|
|
|
|
padding: BoxModel.padding,
|
|
|
|
paddingTop: '10%'
|
|
|
|
},
|
|
|
|
|
2019-04-25 13:17:49 +00:00
|
|
|
/**
|
|
|
|
* A special padding to avoid issues on some devices (such as Android devices with custom suggestions bar).
|
|
|
|
*/
|
|
|
|
extraBarPadding: {
|
|
|
|
paddingBottom: 30
|
|
|
|
},
|
|
|
|
|
|
|
|
inputBar: {
|
2019-08-21 15:47:08 +00:00
|
|
|
alignItems: 'center',
|
2019-04-25 13:17:49 +00:00
|
|
|
borderTopColor: 'rgb(209, 219, 231)',
|
|
|
|
borderTopWidth: 1,
|
|
|
|
flexDirection: 'row',
|
|
|
|
paddingHorizontal: BoxModel.padding
|
|
|
|
},
|
|
|
|
|
|
|
|
inputField: {
|
2019-04-26 16:36:41 +00:00
|
|
|
color: 'rgb(28, 32, 37)',
|
2019-04-25 13:17:49 +00:00
|
|
|
flex: 1,
|
|
|
|
height: 48
|
|
|
|
},
|
|
|
|
|
2019-10-15 14:08:23 +00:00
|
|
|
messageBubble: {
|
2019-10-07 12:35:04 +00:00
|
|
|
alignItems: 'center',
|
2019-10-15 14:08:23 +00:00
|
|
|
borderRadius: BUBBLE_RADIUS,
|
|
|
|
flexDirection: 'row'
|
2019-10-07 12:35:04 +00:00
|
|
|
},
|
|
|
|
|
2019-10-15 14:08:23 +00:00
|
|
|
messageContainer: {
|
2019-10-07 12:35:04 +00:00
|
|
|
flex: 1
|
|
|
|
},
|
|
|
|
|
2019-01-13 19:34:38 +00:00
|
|
|
/**
|
|
|
|
* Wrapper View for the entire block.
|
|
|
|
*/
|
|
|
|
messageWrapper: {
|
|
|
|
alignItems: 'flex-start',
|
|
|
|
flex: 1,
|
|
|
|
flexDirection: 'row',
|
|
|
|
marginHorizontal: 17,
|
|
|
|
marginVertical: 4
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Style modifier for the {@code detailsWrapper} for own messages.
|
|
|
|
*/
|
|
|
|
ownMessageDetailsWrapper: {
|
|
|
|
alignItems: 'flex-end'
|
|
|
|
},
|
|
|
|
|
2019-10-07 12:35:04 +00:00
|
|
|
replyWrapper: {
|
|
|
|
alignItems: 'center',
|
|
|
|
flexDirection: 'row'
|
|
|
|
},
|
|
|
|
|
2019-08-21 15:47:08 +00:00
|
|
|
sendButtonIcon: {
|
|
|
|
color: ColorPalette.darkGrey,
|
|
|
|
fontSize: 22
|
|
|
|
},
|
|
|
|
|
2019-01-13 19:34:38 +00:00
|
|
|
/**
|
|
|
|
* Style modifier for system (error) messages.
|
|
|
|
*/
|
2019-10-15 14:08:23 +00:00
|
|
|
systemMessageBubble: {
|
2019-01-13 19:34:38 +00:00
|
|
|
backgroundColor: 'rgb(247, 215, 215)'
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Wrapper for the name and the message text.
|
|
|
|
*/
|
|
|
|
textWrapper: {
|
|
|
|
alignItems: 'flex-start',
|
|
|
|
flexDirection: 'column',
|
|
|
|
padding: 9
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Text node for the timestamp.
|
|
|
|
*/
|
|
|
|
timeText: {
|
2019-03-20 21:23:19 +00:00
|
|
|
color: 'rgb(164, 184, 209)',
|
2019-01-13 19:34:38 +00:00
|
|
|
fontSize: 13
|
|
|
|
}
|
2019-03-20 21:23:19 +00:00
|
|
|
};
|
2019-10-15 14:08:23 +00:00
|
|
|
|
|
|
|
ColorSchemeRegistry.register('Chat', {
|
|
|
|
/**
|
|
|
|
* Background of the chat screen.
|
|
|
|
*/
|
|
|
|
backdrop: {
|
|
|
|
backgroundColor: schemeColor('background'),
|
|
|
|
flex: 1
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The text node for the display name.
|
|
|
|
*/
|
|
|
|
displayName: {
|
|
|
|
color: schemeColor('displayName'),
|
|
|
|
fontSize: 13
|
|
|
|
},
|
|
|
|
|
2019-11-21 14:26:57 +00:00
|
|
|
emptyComponentText: {
|
|
|
|
color: schemeColor('displayName'),
|
|
|
|
textAlign: 'center'
|
|
|
|
},
|
|
|
|
|
2019-10-15 14:08:23 +00:00
|
|
|
localMessageBubble: {
|
|
|
|
backgroundColor: schemeColor('localMsgBackground'),
|
|
|
|
borderTopRightRadius: 0
|
|
|
|
},
|
|
|
|
|
|
|
|
messageRecipientCancelIcon: {
|
|
|
|
color: schemeColor('icon'),
|
|
|
|
fontSize: 18
|
|
|
|
},
|
|
|
|
|
|
|
|
messageRecipientContainer: {
|
|
|
|
alignItems: 'center',
|
|
|
|
backgroundColor: schemeColor('privateMsgBackground'),
|
|
|
|
flexDirection: 'row',
|
|
|
|
padding: BoxModel.padding
|
|
|
|
},
|
|
|
|
|
|
|
|
messageRecipientText: {
|
|
|
|
color: schemeColor('text'),
|
|
|
|
flex: 1
|
|
|
|
},
|
|
|
|
|
|
|
|
privateNotice: {
|
|
|
|
color: schemeColor('privateMsgNotice'),
|
|
|
|
fontSize: 11,
|
|
|
|
marginTop: 6
|
|
|
|
},
|
|
|
|
|
|
|
|
privateMessageBubble: {
|
|
|
|
backgroundColor: schemeColor('privateMsgBackground')
|
|
|
|
},
|
|
|
|
|
|
|
|
remoteMessageBubble: {
|
|
|
|
backgroundColor: schemeColor('remoteMsgBackground'),
|
|
|
|
borderTopLeftRadius: 0
|
|
|
|
},
|
|
|
|
|
|
|
|
replyContainer: {
|
|
|
|
alignSelf: 'stretch',
|
|
|
|
borderLeftColor: schemeColor('replyBorder'),
|
|
|
|
borderLeftWidth: 1,
|
|
|
|
justifyContent: 'center'
|
|
|
|
},
|
|
|
|
|
|
|
|
replyStyles: {
|
|
|
|
iconStyle: {
|
|
|
|
color: schemeColor('replyIcon'),
|
|
|
|
fontSize: 22,
|
|
|
|
padding: 8
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|