import React from "react"; import { StyleSheet, FlatList } from "react-native"; import { Block, Text, theme } from "galio-framework"; import { Switch } from "../components"; import argonTheme from "../constants/Theme"; export default class Notifications extends React.Component { state = {}; toggleSwitch = switchNumber => this.setState({ [switchNumber]: !this.state[switchNumber] }); renderItem = ({ item }) => ( {item.title} this.toggleSwitch(item.id)} value={this.state[item.id]} /> ); render() { const notifications = [ { title: "Someone mentions me", id: "mentions" }, { title: "Anyone follows me", id: "follows" }, { title: "Someone comments me", id: "comments" }, { title: "A seller follows me", id: "seller" } ]; return ( item.id} renderItem={this.renderItem} ListHeaderComponent={ Recommended Settings These are the most important settings } /> ); } } const styles = StyleSheet.create({ notification: { paddingVertical: theme.SIZES.BASE / 3 }, title: { paddingTop: theme.SIZES.BASE / 2, paddingBottom: theme.SIZES.BASE * 1.5 }, rows: { paddingHorizontal: theme.SIZES.BASE, marginBottom: theme.SIZES.BASE * 1.25 } });