index.js 2.15 KB
Newer Older
李彥志's avatar
李彥志 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
import React ,{ Component } from 'react';
import {  
    StyleSheet,
    View,
    Text,
    Switch,
    Image,
    TouchableOpacity
   } from 'react-native';
import styles from './styles';

class notice extends Component {

  static navigationOptions = ({ navigation }) => ({
    headerLeft: (
      <TouchableOpacity
        style={styles.nav_left_touch_container}
        onPress={() => {
          navigation.goBack();
        }}
      >
        <View style={styles.nav_left_icon_container}>
          <Image
            style={styles.nav_icon}
            source={require('../../images/btn_nv_back.png')}
          />
        </View>
      </TouchableOpacity>
    ),
    headerTitle: 
    <View style={styles.headerTitleContainer}>
    <Text style={styles.headerTitleTxt}>通知</Text>
    </View>
  });

  constructor(props) {
    super(props);
    this.state = {
      isBlocking: false
    };
    this.onChange = this.onChange.bind(this);
  }
  
  onChange(value) { 
    const { isBlocking } = this.state;
    this.setState({ value : !value  });
  }
    render() {
    const {isBlocking} =this.state;
        return(
    <View>
        <View style={styles.subRowContainer} />
        <View style={styles.rowBackground}>

      <View style={styles.rowContainer}>
        <View>
        <Text style={styles.rowText}>提醒通知</Text>
        </View>
        <View style={styles.rowContent}>
        <Switch
          value={!this.state.value}
          onValueChange={isSync => this.onChange(isSync)}
          trackColor={{ false: '#E5E5E5', true: '#339FAF' }}
          style={{ transform: [{ scaleX: 0.8 }, { scaleY: 0.8 }] }}
        />
        </View>
      </View>

      <View style={styles.rowContainer}>
        <View>
        <Text style={styles.rowText}>文章推播</Text>
        </View>
        <View style={styles.rowContent}>
        <Switch
          value={!this.state.value}
          onValueChange={isSync => this.onChange(isSync)}
          trackColor={{ false: '#E5E5E5', true: '#339FAF' }}
          style={{ transform: [{ scaleX: 0.8 }, { scaleY: 0.8 }] }}
        />
        </View>

      </View>
      </View>
    </View>
        )
    }
}

export default notice;