| .. | .. |
|---|
| 1 | 1 | import React from "react"; |
|---|
| 2 | 2 | import { Pressable, Text, ViewStyle } from "react-native"; |
|---|
| 3 | +import { useTheme } from "../../contexts/ThemeContext"; |
|---|
| 3 | 4 | |
|---|
| 4 | 5 | interface IconButtonProps { |
|---|
| 5 | 6 | onPress: () => void; |
|---|
| 6 | 7 | label: string; |
|---|
| 7 | 8 | size?: number; |
|---|
| 8 | 9 | style?: ViewStyle; |
|---|
| 9 | | - className?: string; |
|---|
| 10 | 10 | } |
|---|
| 11 | 11 | |
|---|
| 12 | 12 | export function IconButton({ |
|---|
| 13 | 13 | onPress, |
|---|
| 14 | 14 | label, |
|---|
| 15 | 15 | size = 24, |
|---|
| 16 | | - className = "", |
|---|
| 17 | 16 | }: IconButtonProps) { |
|---|
| 17 | + const { colors } = useTheme(); |
|---|
| 18 | + |
|---|
| 18 | 19 | return ( |
|---|
| 19 | 20 | <Pressable |
|---|
| 20 | 21 | onPress={onPress} |
|---|
| 21 | | - className={`items-center justify-center ${className}`} |
|---|
| 22 | | - style={{ width: size, height: size }} |
|---|
| 22 | + style={{ width: size, height: size, alignItems: "center", justifyContent: "center" }} |
|---|
| 23 | 23 | hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }} |
|---|
| 24 | 24 | > |
|---|
| 25 | | - <Text className="text-pai-text-secondary" style={{ fontSize: size * 0.7 }}> |
|---|
| 25 | + <Text style={{ color: colors.textSecondary, fontSize: size * 0.7 }}> |
|---|
| 26 | 26 | {label} |
|---|
| 27 | 27 | </Text> |
|---|
| 28 | 28 | </Pressable> |
|---|