ButtonsForm.js 1.28 KB
Newer Older
1
2
3
import React from 'react';
import { ButtonGroup } from 'react-native-elements';
import { StyleSheet, Text } from 'react-native';
Choi Ga Young's avatar
Choi Ga Young committed
4
import { color } from 'react-native-elements/dist/helpers';
5
6

const ButtonsForm = (props) => {
7
    const components = [];
8

Choi Ga Young's avatar
Choi Ga Young committed
9
10
11
12
13
14
15
    for (let i = 0; i < props.group.length; i++) {
        components[i] = {
            element: () => <Text style={{
                fontSize: 20,
                fontFamily: 'GowunDodum-Regular'
            }} > {props.group[i]}</Text >
        }
16
    }
17
18
19
20
21

    return (
        <ButtonGroup
            onPress={props.onPress}
            selectedIndex={props.selectedIndex}
22
            buttons={components}
23
24
25
            containerStyle={style.container}
            selectedButtonStyle={style.selectedButton}
            selectedTextStyle={style.selectedText}
Choi Ga Young's avatar
Choi Ga Young committed
26

27
28
29
30
        />
    );
};

31

32
33
34
35
36
const style = StyleSheet.create({
    container: {
        height: 50,
        flexDirection: 'row',
        alignItems: "center",
Choi Ga Young's avatar
Choi Ga Young committed
37
        backgroundColor: '#f5f5f5'
38
    },
Choi Ga Young's avatar
Choi Ga Young committed
39
40
41
42
43
    // text: {
    //     color: "#808080",
    //     fontSize: 24,
    //     fontFamily: 'GowunDodum-Regular'
    // },
44
    selectedButton: {
Choi Ga Young's avatar
Choi Ga Young committed
45
        backgroundColor: '#bfd3f2'
46
47
48
49
50
51
52
    },
    selectedText: {
        color: "#1467ff",
        fontWeight: "bold",
    },
})

YoonDongMin's avatar
DongM    
YoonDongMin committed
53
export default ButtonsForm