acupedia-mobile-ui/src/features/auth/components/SocialButton.tsx

64 lines
1.1 KiB
TypeScript

import React from "react";
import {
Pressable,
StyleSheet,
View,
} from "react-native";
import {
moderateScale,
scale,
verticalScale,
} from "react-native-size-matters";
interface SocialButtonProps {
icon: React.ReactNode;
onPress?: () => void;
}
export default function SocialButton({
icon,
onPress,
}: SocialButtonProps) {
return (
<Pressable
accessibilityRole="button"
style={({ pressed }) => [
styles.container,
pressed && styles.pressed,
]}
onPress={onPress}
>
<View style={styles.iconContainer}>
{icon}
</View>
</Pressable>
);
}
const styles = StyleSheet.create({
container: {
width: scale(58),
height: scale(58),
borderRadius: moderateScale(29),
backgroundColor: "#FFFFFF",
justifyContent: "center",
alignItems: "center",
borderWidth: 1,
borderColor: "#ECECEC",
marginHorizontal: scale(8),
},
iconContainer: {
justifyContent: "center",
alignItems: "center",
},
pressed: {
opacity: 0.8,
transform: [{ scale: 0.96 }],
},
});