ButtonsForm.js 1.1 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
37
    },
    selectedButton: {
Choi Ga Young's avatar
Choi Ga Young committed
38
        backgroundColor: '#bfd3f2'
39
40
41
42
43
44
45
    },
    selectedText: {
        color: "#1467ff",
        fontWeight: "bold",
    },
})

YoonDongMin's avatar
DongM    
YoonDongMin committed
46
export default ButtonsForm