import React, { Component } from "react";
import { View } from "react-native";
import SwitchToggle from "react-native-switch-toggle";
import {
  postSubscription,
  getSubscription
} from "../../api/UserApi";
class Switch_notification extends Component {
  constructor(props) {
    super(props);
    this.state = {
      switchOn: false
    };
  }
  
  render() {
    return (
      <View>
        <SwitchToggle
          backgroundColorOn={"#7CBB33"}
          backgroundColorOff={"#b3b3b3"}
          circleColorOff={"#8c8c8c"}
          circleColorOn={"#269A21"}
          duration={300}
          containerStyle={{
            width: 35.42,
            height: 14,
            borderRadius: 30,
            padding: 0
          }}
          circleStyle={{
            width: 20,
            height: 20,
            borderRadius: 30
          }}
          switchOn={this.props.isSwitch}
          onPress={() => this.props.onToggle(this.props.customer,this.props.type)}
        />
      </View>
    );
  }
}

export default Switch_notification;
