2019-06-26 14:08:23 +00:00
|
|
|
// @flow
|
|
|
|
|
2019-12-06 15:02:51 +00:00
|
|
|
import { StyleSheet } from 'react-native';
|
|
|
|
|
2019-06-26 14:08:23 +00:00
|
|
|
import { ColorPalette } from '../../../styles';
|
2022-03-15 10:27:40 +00:00
|
|
|
import { PRESENCE_AVAILABLE_COLOR, PRESENCE_AWAY_COLOR, PRESENCE_BUSY_COLOR, PRESENCE_IDLE_COLOR } from '../styles';
|
2019-06-26 14:08:23 +00:00
|
|
|
|
2019-07-03 15:39:39 +00:00
|
|
|
const DEFAULT_SIZE = 65;
|
|
|
|
|
2019-06-26 14:08:23 +00:00
|
|
|
/**
|
|
|
|
* The styles of the feature base/participants.
|
|
|
|
*/
|
|
|
|
export default {
|
|
|
|
|
2019-07-03 15:39:39 +00:00
|
|
|
avatarContainer: (size: number = DEFAULT_SIZE) => {
|
2019-06-26 14:08:23 +00:00
|
|
|
return {
|
|
|
|
alignItems: 'center',
|
|
|
|
borderRadius: size / 2,
|
|
|
|
height: size,
|
|
|
|
justifyContent: 'center',
|
|
|
|
overflow: 'hidden',
|
|
|
|
width: size
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
2019-07-03 15:39:39 +00:00
|
|
|
avatarContent: (size: number = DEFAULT_SIZE) => {
|
2019-06-26 14:08:23 +00:00
|
|
|
return {
|
|
|
|
height: size,
|
|
|
|
width: size
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
2019-12-06 15:02:51 +00:00
|
|
|
badge: (size: number = DEFAULT_SIZE, status: string) => {
|
|
|
|
let color;
|
|
|
|
|
|
|
|
switch (status) {
|
|
|
|
case 'available':
|
2022-03-15 10:27:40 +00:00
|
|
|
color = PRESENCE_AVAILABLE_COLOR;
|
2019-12-06 15:02:51 +00:00
|
|
|
break;
|
|
|
|
case 'away':
|
2022-03-15 10:27:40 +00:00
|
|
|
color = PRESENCE_AWAY_COLOR;
|
2019-12-06 15:02:51 +00:00
|
|
|
break;
|
|
|
|
case 'busy':
|
2022-03-15 10:27:40 +00:00
|
|
|
color = PRESENCE_BUSY_COLOR;
|
2019-12-06 15:02:51 +00:00
|
|
|
break;
|
|
|
|
case 'idle':
|
2022-03-15 10:27:40 +00:00
|
|
|
color = PRESENCE_IDLE_COLOR;
|
2019-12-06 15:02:51 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
backgroundColor: color,
|
|
|
|
borderRadius: size / 2,
|
|
|
|
bottom: 0,
|
|
|
|
height: size * 0.3,
|
|
|
|
position: 'absolute',
|
|
|
|
width: size * 0.3
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
badgeContainer: {
|
|
|
|
...StyleSheet.absoluteFillObject
|
|
|
|
},
|
|
|
|
|
2019-06-26 14:08:23 +00:00
|
|
|
initialsContainer: {
|
|
|
|
alignItems: 'center',
|
|
|
|
alignSelf: 'stretch',
|
|
|
|
flex: 1,
|
|
|
|
justifyContent: 'center'
|
|
|
|
},
|
|
|
|
|
2019-07-03 15:39:39 +00:00
|
|
|
initialsText: (size: number = DEFAULT_SIZE) => {
|
2019-06-26 14:08:23 +00:00
|
|
|
return {
|
2020-04-15 13:13:43 +00:00
|
|
|
color: 'white',
|
2019-07-09 11:44:12 +00:00
|
|
|
fontSize: size * 0.45,
|
2019-06-26 14:08:23 +00:00
|
|
|
fontWeight: '100'
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
staticAvatar: {
|
|
|
|
backgroundColor: ColorPalette.lightGrey,
|
|
|
|
opacity: 0.4
|
|
|
|
}
|
|
|
|
};
|