Commit 78369df1 by Tonk

update

parent 9c6f7442
...@@ -20,7 +20,7 @@ export default class NotificationScreen extends React.Component { ...@@ -20,7 +20,7 @@ export default class NotificationScreen extends React.Component {
static navigationOptions = ({ navigation }) => ({ static navigationOptions = ({ navigation }) => ({
title: 'Notifications', title: 'Notifications',
headerLeft: ( headerLeft: (
<TouchableOpacity onPress={() => console.log('Home')}> <TouchableOpacity onPress={() => navigation.navigate('Home')}>
<View style={{ marginLeft: 17 }}> <View style={{ marginLeft: 17 }}>
<Icon name="home" type="SimpleLineIcons" style={{ color: color.white, fontSize: 16 }} /> <Icon name="home" type="SimpleLineIcons" style={{ color: color.white, fontSize: 16 }} />
</View> </View>
...@@ -211,12 +211,16 @@ export default class NotificationScreen extends React.Component { ...@@ -211,12 +211,16 @@ export default class NotificationScreen extends React.Component {
}); });
let view = []; let view = [];
let day; let day;
if (data.length === 0) {
view.push(<Text style={[theme.normalText, { paddingHorizontal: 30, paddingVertical: 10 }]}>No data</Text>);
} else {
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
if (isToday(data[i].time * 1000) && i === 0) { if (isToday(data[i].time * 1000) && i === 0) {
view.push( view.push(
<> <>
<Text style={[theme.normalText, { paddingHorizontal: 30, paddingVertical: 10 }]}>Today</Text> <Text style={[theme.normalText, { paddingHorizontal: 30, paddingVertical: 10 }]}>
Today
</Text>
{this.renderActionCard(data[i])} {this.renderActionCard(data[i])}
</> </>
); );
...@@ -228,7 +232,9 @@ export default class NotificationScreen extends React.Component { ...@@ -228,7 +232,9 @@ export default class NotificationScreen extends React.Component {
view.push( view.push(
<> <>
<Text style={[theme.normalText, { paddingHorizontal: 30, paddingVertical: 10 }]}> <Text style={[theme.normalText, { paddingHorizontal: 30, paddingVertical: 10 }]}>
{isYesterday(data[i].time * 1000) ? 'Yesterday' : format(data[i].time * 1000, 'DD/MM/YYYY')} {isYesterday(data[i].time * 1000)
? 'Yesterday'
: format(data[i].time * 1000, 'DD/MM/YYYY')}
</Text> </Text>
{this.renderActionCard(data[i])} {this.renderActionCard(data[i])}
</> </>
...@@ -236,6 +242,7 @@ export default class NotificationScreen extends React.Component { ...@@ -236,6 +242,7 @@ export default class NotificationScreen extends React.Component {
day = data[i].time * 1000; day = data[i].time * 1000;
} }
} }
}
return view; return view;
} }
...@@ -361,6 +368,7 @@ export default class NotificationScreen extends React.Component { ...@@ -361,6 +368,7 @@ export default class NotificationScreen extends React.Component {
</Text> </Text>
</View> </View>
<Text style={[theme.smallTitle, theme.textDanger, theme.mt2]}>Select Date</Text> <Text style={[theme.smallTitle, theme.textDanger, theme.mt2]}>Select Date</Text>
<ScrollView>
<View style={[theme.mt2, styles.pickerContainer]}> <View style={[theme.mt2, styles.pickerContainer]}>
<RNPickerSelect <RNPickerSelect
onValueChange={value => this.setState({ filterBy: value })} onValueChange={value => this.setState({ filterBy: value })}
...@@ -377,10 +385,13 @@ export default class NotificationScreen extends React.Component { ...@@ -377,10 +385,13 @@ export default class NotificationScreen extends React.Component {
useNativeAndroidPickerStyle={false} useNativeAndroidPickerStyle={false}
value={this.state.filterBy} value={this.state.filterBy}
style={pickerStyle} style={pickerStyle}
Icon={() => <Icon name="ios-arrow-down" style={{ fontSize: 14, color: '#c8c8c8' }} />} Icon={() => (
<Icon name="ios-arrow-down" style={{ fontSize: 14, color: '#c8c8c8' }} />
)}
/> />
</View> </View>
{this.state.filterBy === 'custom' && this.renderCalendar()} {this.state.filterBy === 'custom' && this.renderCalendar()}
</ScrollView>
</SlideUpModal> </SlideUpModal>
</Modal> </Modal>
......
...@@ -9,6 +9,13 @@ import { TouchableHighlight } from 'react-native-gesture-handler'; ...@@ -9,6 +9,13 @@ import { TouchableHighlight } from 'react-native-gesture-handler';
class SettingScreen extends React.Component { class SettingScreen extends React.Component {
static navigationOptions = ({ navigation }) => ({ static navigationOptions = ({ navigation }) => ({
title: 'Setting', title: 'Setting',
headerLeft: (
<TouchableOpacity onPress={() => navigation.navigate('Home')}>
<View style={{ marginLeft: 17 }}>
<Icon name="home" type="SimpleLineIcons" style={{ color: color.white, fontSize: 16 }} />
</View>
</TouchableOpacity>
),
headerRight: navigation.state.params ? navigation.state.params.headerRight : null, headerRight: navigation.state.params ? navigation.state.params.headerRight : null,
}); });
constructor(props) { constructor(props) {
...@@ -39,7 +46,7 @@ class SettingScreen extends React.Component { ...@@ -39,7 +46,7 @@ class SettingScreen extends React.Component {
return ( return (
<View style={[theme.container]}> <View style={[theme.container]}>
<Text style={[theme.description, theme.mt2, { marginLeft: 25, color: '#a8a8a8' }]}> <Text style={[theme.description, theme.mt2, { marginLeft: 25, color: '#a8a8a8' }]}>
{data.type.toUpperCase()} {/* {data.type.toUpperCase()} */}
</Text> </Text>
<List style={styles.ListItemContainer}> <List style={styles.ListItemContainer}>
......
...@@ -91,9 +91,11 @@ class SmartMeterDetailScreen extends Component { ...@@ -91,9 +91,11 @@ class SmartMeterDetailScreen extends Component {
return { return {
title: deviceName, title: deviceName,
headerLeft: ( headerLeft: (
<HeaderButtons HeaderButtonComponent={IoniconsHeaderButton}> <TouchableOpacity onPress={() => navigation.navigate('Home')}>
<Item title="back" iconName="ios-arrow-back" onPress={() => navigation.popToTop()} /> <View style={{ marginLeft: 17 }}>
</HeaderButtons> <Icon name="home" type="SimpleLineIcons" style={{ color: color.white, fontSize: 16 }} />
</View>
</TouchableOpacity>
), ),
headerRight: ( headerRight: (
<TouchableOpacity onPress={() => console.log('clicked')}> <TouchableOpacity onPress={() => console.log('clicked')}>
......
...@@ -162,9 +162,11 @@ class TimerScreen extends Component { ...@@ -162,9 +162,11 @@ class TimerScreen extends Component {
static navigationOptions = ({ navigation }) => ({ static navigationOptions = ({ navigation }) => ({
title: 'Timer', title: 'Timer',
headerLeft: ( headerLeft: (
<HeaderButtons HeaderButtonComponent={IoniconsHeaderButton}> <TouchableOpacity onPress={() => navigation.navigate('Home')}>
<HeaderItem title="menu" iconName="ios-menu" onPress={() => console.log('menu')} /> <View style={{ marginLeft: 17 }}>
</HeaderButtons> <Icon name="home" type="SimpleLineIcons" style={{ color: color.white, fontSize: 16 }} />
</View>
</TouchableOpacity>
), ),
headerRight: navigation.state.params ? navigation.state.params.headerRight : null, headerRight: navigation.state.params ? navigation.state.params.headerRight : null,
}); });
......
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