jiti-meet/react/features/base/avatar/components/native/styles.js

85 lines
1.9 KiB
JavaScript
Raw Normal View History

2019-06-26 14:08:23 +00:00
// @flow
import { StyleSheet } from 'react-native';
2019-06-26 14:08:23 +00:00
import { ColorPalette } from '../../../styles';
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
};
},
badge: (size: number = DEFAULT_SIZE, status: string) => {
let color;
switch (status) {
case 'available':
color = PRESENCE_AVAILABLE_COLOR;
break;
case 'away':
color = PRESENCE_AWAY_COLOR;
break;
case 'busy':
color = PRESENCE_BUSY_COLOR;
break;
case 'idle':
color = PRESENCE_IDLE_COLOR;
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 {
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
}
};