Commit 78369df1 by Tonk

update

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