ButtonsForm.js 1.22 KB
Newer Older
1
2
3
4
5
import React from 'react';
import { ButtonGroup } from 'react-native-elements';
import { StyleSheet, Text } from 'react-native';

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

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

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

26
27
28
29
30
31
32
33
34
        />
    );
};

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

YoonDongMin's avatar
DongM    
YoonDongMin committed
51
export default ButtonsForm