icon button touchable opacity?

This commit is contained in:
Violet Caulfield
2025-01-26 19:09:15 -06:00
parent 210fe1ded2
commit e11cc4e7c7

View File

@@ -1,6 +1,7 @@
import React from "react";
import { Square, Theme } from "tamagui";
import Icon from "./icon";
import { TouchableOpacity } from "react-native";
interface IconButtonProps {
onPress: () => void;
@@ -18,26 +19,27 @@ export default function IconButton({
return (
<Theme name={"inverted_purple"}>
<Square
animation={"quick"}
circular={circular}
elevate
hoverStyle={{ scale: 0.925 }}
pressStyle={{ scale: 0.875 }}
onPress={onPress}
width={size}
height={size}
alignContent="center"
justifyContent="center"
backgroundColor={"$background"}
>
<Icon
large
name={name}
color={"$color"}
/>
</Square>
<TouchableOpacity>
<Square
animation={"quick"}
circular={circular}
elevate
hoverStyle={{ scale: 0.925 }}
pressStyle={{ scale: 0.875 }}
onPress={onPress}
width={size}
height={size}
alignContent="center"
justifyContent="center"
backgroundColor={"$background"}
>
<Icon
large
name={name}
color={"$color"}
/>
</Square>
</TouchableOpacity>
</Theme>
)
}