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
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

const StyledButton = (props) => {
    return (
        <Pressable
            style={({ pressed }) => [
                {
                    backgroundColor: pressed ? '#437dd9' : '#4e8ff5',
                },
                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