StyledButton.js 809 Bytes
Newer Older
YoonDongMin's avatar
DongM    
YoonDongMin committed
1
import React from 'react';
Choi Ga Young's avatar
Choi Ga Young committed
2
import { StyleSheet, Pressable, Text } from 'react-native';
YoonDongMin's avatar
DongM    
YoonDongMin committed
3
4
5
6
7
8

const StyledButton = (props) => {
    return (
        <Pressable
            style={({ pressed }) => [
                {
Choi Ga Young's avatar
Choi Ga Young committed
9
                    backgroundColor: pressed ? '#adbfdb' : '#bfd3f2',
YoonDongMin's avatar
DongM    
YoonDongMin committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
                },
                style.pressableStyle,
                props.style
            ]}
            onPress={props.onPress}>
            <Text style={style.buttonText}>{props.name}</Text>
        </Pressable>
    );
};

const style = StyleSheet.create({
    pressableStyle: {
        alignItems: "center",
        justifyContent: "center",
        marginRight: 3,
        borderRadius: 2,
    },
    buttonText: {
YoonDongMin's avatar
YDm    
YoonDongMin committed
28
        fontFamily: 'GowunDodum-Regular',
YoonDongMin's avatar
DongM    
YoonDongMin committed
29
30
31
32
33
        fontSize: 20,
    },
})

export default StyledButton