Commit 46d40f16 by Tonk

update smart device card

parent 20376e73
...@@ -12,10 +12,8 @@ const MeterCard = ({ item, onPressEachCard }) => { ...@@ -12,10 +12,8 @@ const MeterCard = ({ item, onPressEachCard }) => {
styles.meterOn, styles.meterOn,
{ backgroundColor: item.breakerStatus === 1 ? 'rgba(65, 204, 0, 0.59)' : 'rgba(223, 0, 0, 0.59)' }, { backgroundColor: item.breakerStatus === 1 ? 'rgba(65, 204, 0, 0.59)' : 'rgba(223, 0, 0, 0.59)' },
]} ]}
> ></View>
<Text style={[theme.description, theme.textWhite]}>{item.breakerStatus === 1 ? 'ON' : 'OFF'}</Text> <View style={[theme.centerContainer, { paddingLeft: 10 }]}>
</View>
<View style={[theme.centerContainer]}>
{item.img ? ( {item.img ? (
<Image source={{ uri: item.img }} style={styles.meterImgStyle} /> <Image source={{ uri: item.img }} style={styles.meterImgStyle} />
) : ( ) : (
...@@ -25,25 +23,15 @@ const MeterCard = ({ item, onPressEachCard }) => { ...@@ -25,25 +23,15 @@ const MeterCard = ({ item, onPressEachCard }) => {
)} )}
</View> </View>
<View style={[theme.containerWithPadding, { flex: 2 }]}> <View style={[theme.containerWithPadding, { flex: 2 }]}>
<Row style={{ alignItems: 'center' }}> <Text style={[theme.smallTitle]}>{item.name}</Text>
<Text style={[theme.smallTitle, { marginRight: 15 }]}>{item.name}</Text> <Text style={[theme.description, theme.mt1]} numberOfLines={2}>
</Row>
<Text style={[theme.description]} numberOfLines={2}>
{item.description} {item.description}
</Text> </Text>
<Row style={{ marginTop: 10 }}>
<View style={[styles.meterIconCover]}>
<Icon name="ios-notifications-outline" style={styles.meterIconStyle} />
</View>
<View style={styles.meterIconCover}>
<Icon name="md-alarm" style={styles.meterIconStyle} />
</View>
</Row>
</View> </View>
<View style={[theme.rowContainer, { position: 'absolute', top: 10, right: 5 }]}> <View style={[theme.rowContainer, { position: 'absolute', top: 10, right: 5 }]}>
<Icon name="wifi" type="FontAwesome" style={styles.iconStyle} />
<Icon name={item.isSharing ? 'users' : 'user'} type="FontAwesome" style={styles.iconStyle} />
<View style={[styles.online, { backgroundColor: item.isOnline ? '#10ca88' : color.primary }]} /> <View style={[styles.online, { backgroundColor: item.isOnline ? '#10ca88' : color.primary }]} />
<Icon name={item.isSharing ? 'users' : 'user'} type="FontAwesome" style={styles.iconStyle} />
<Icon name="wifi" type="FontAwesome" style={styles.iconStyle} />
</View> </View>
</> </>
); );
...@@ -63,14 +51,11 @@ export default MeterCard; ...@@ -63,14 +51,11 @@ export default MeterCard;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
meterOn: { meterOn: {
top: 7, top: 0,
left: 5, left: 0,
width: 35, bottom: 0,
paddingVertical: 1, width: 10,
borderRadius: 9.6,
position: 'absolute', position: 'absolute',
alignItems: 'center',
justifyContent: 'center',
}, },
meterImgStyle: { meterImgStyle: {
width: 50, width: 50,
...@@ -116,5 +101,6 @@ const styles = StyleSheet.create({ ...@@ -116,5 +101,6 @@ const styles = StyleSheet.create({
shadowRadius: 3.84, shadowRadius: 3.84,
elevation: 5, elevation: 5,
backgroundColor: '#fff', backgroundColor: '#fff',
overflow: 'hidden',
}, },
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment