MemoDetails.js 2.34 KB
Newer Older
YoonDongMin's avatar
YdM    
YoonDongMin 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
import React, { useState } from 'react';
import { StyleSheet, View, Text, Button, Pressable, TouchableWithoutFeedback, Keyboard } from 'react-native';
import { globalStyles } from '../styles/global';
import InputBox from '../components/InputBox';
import StyledButton from '../components/StyledButton';


function MemoDetails({ route }) {
    const [date, setDate] = useState('')
    const [person, setPerson] = useState('')
    const [money, setMoney] = useState('')


    return (
        <TouchableWithoutFeedback onPress={() => {
            Keyboard.dismiss();
        }}>
            <View style={{ flex: 1 }}>
                <View>
                    <InputBox
                        inputTitle="날짜"
                        placeholder={route.params?.date}
                        onChangeText={
                            (date) => setDate(date)
                        }
                    />
                    <InputBox
                        inputTitle="내용"
                        placeholder={route.params?.person}
                        onChangeText={
                            (person) => setPerson(person)
                        }
                    />
                    <InputBox
                        inputTitle="금액"
                        placeholder={route.params?.money}
                        onChangeText={
                            (money) => setMoney(moeny)
                        }
                    />
                </View>
                <View style={style.buttonRow}>
                    <StyledButton
                        name="수정"
                        onPress={() => console.log('수정버튼')}
                        style={style.submitButton}
                    />
                    <StyledButton
                        name="저장"
                        onPress={() => console.log('취소버튼')}
                        style={style.cancelButton}
                    />
                </View>
            </View>
        </TouchableWithoutFeedback>
    )
}



const style = StyleSheet.create({

    buttonRow: {
        flexDirection: 'row',
        alignItems: "center",
        marginHorizontal: 10,
        marginVertical: 3,
    },
    submitButton: {
        flex: 1,
        height: 50,
    },
    cancelButton: {
        flex: 1,
        height: 50,
    }
});




export default MemoDetails;