AlarmTab.js 3.8 KB
import React, { Component } from 'react';
import { View, Text, StyleSheet,TouchableOpacity,Image } from 'react-native';
import MapView from 'react-native-daummap';
import Postcode from '../Postcode'
import AlarmItem from '../AlarmItem'
import { ScrollView } from 'react-native-gesture-handler';

import Heart from '../../assets/heart_.svg'
import Chat from '../../assets/chat_.svg'
import Home from '../../assets/home.svg'
import QR from '../../assets/qr.svg'
import Alarm from '../../assets/alarm.svg'
import AsyncStorage from '@react-native-community/async-storage'
export default class AddTab extends Component {
    static navigationOptions = {
        
        headerShown: false
        
    }
    state = {
        mapLoading:false,
        alarmList:[]
    }
    componentDidMount = () => {
        
        //AsyncStorage.getItem("AlarmList",(err,res) => {
        //    if(res) {
        //        this.setState({
        //            alarmList:JSON.parse(res)
        //        })
        //    }
        //})
    }
    render() {
        return (
            <View style={{backgroundColor:"#BDBCBC",width:"100%",height:"100%"}}>
                
                <View style={{width:"100%",flexDirection:"row",paddingTop:16,paddingBottom:16,paddingLeft:16,backgroundColor:"#615F5F"}}>
                    <TouchableOpacity onPress={() => this.props.navigation.goBack(null)}>
                        <Image source={require('../../assets/back.png')}/>
                    </TouchableOpacity>
                    <Text style={{color:"white",fontSize:16,marginLeft:16}}>
                        알림
                    </Text>
                </View>
                <View style={{marginBottom:8}}>
                    <View style={{flexDirection:"row" }}>
                        <TouchableOpacity onPress={() => this.setState({current:1})} style={{width:"50%",backgroundColor:"white",paddingTop:8.9, paddingBottom:12,}}>
                            <Text style={[{textAlign:"center",borderRightColor:"#615F5F",borderRightWidth:1,color:"#615F5F"}]}>
                                모두 읽음
                            </Text>
                        </TouchableOpacity>
                        <TouchableOpacity  onPress={() => this.props.navigation.navigate("AlarmConfig")}  style={{width:"50%",backgroundColor:"white",paddingTop:8.9, paddingBottom:12}}>
                            <Text style={[{textAlign:"center",color:"#615F5F"}]}>
                                알림 설정
                            </Text> 
                        </TouchableOpacity>
                    </View>
                </View>
                <ScrollView>
                    {this.state.alarmList.map((e,i) => <AlarmItem item={e}/> )}
                </ScrollView>
                
            <View style={{
                shadowColor: "#000",
                shadowOffset: {
                    width: 0,
                    height: 6,
                },
                shadowOpacity: 0.39,
                shadowRadius: 8.30,
                
                elevation: 13,
                flexDirection:"row",justifyContent:"space-between",paddingLeft:24,paddingRight:24,paddingTop:19,paddingBottom:19,width:"100%",position:"absolute",backgroundColor:"white",bottom:0}}>
                <Home onPress={() => this.props.navigation.replace("Main_")}/>
                <Chat onPress={() => this.props.navigation.replace("ChatTab")}/>
                <QR onPress={() => this.props.navigation.replace("QRTab")}/>
                <Heart onPress={() => this.props.navigation.replace("LikeTab")}/>
                <Alarm onPress={() => this.props.navigation.replace("AlarmTab")}/>
            </View>
            </View>
        );
    }
}
 
const style = StyleSheet.create({
    container: {
        flex: 1,
        alignItems: 'center',
        justifyContent: 'center',
    }
});