Files
mobile-darmasaba/components/buttonTab.tsx
amel 88d9cd117d upd: tab navigation
Deskripsi:
- fix tab navigation :: diganti pake useState
- group
- position
- member
- diskusi umum
- project
- divisi
- tugas divisi

No Issues
2025-06-09 16:38:31 +08:00

22 lines
714 B
TypeScript

import { ColorsStatus } from "@/constants/ColorsStatus"
import Styles from "@/constants/Styles"
import { Text, TouchableOpacity } from "react-native"
type Props = {
active: string
value: string
onPress: () => void
label: string
icon: React.ReactNode
n: number
}
export default function ButtonTab({ active, value, onPress, label, n, icon }: Props) {
return (
<TouchableOpacity style={[Styles.btnTab, (active == value) && ColorsStatus.orange, { width: n == 2 ? '50%' : 'auto' }]} onPress={() => { onPress() }}>
{icon}
<Text style={[Styles.textMediumSemiBold, Styles.ml10, { color: active == value ? 'white' : 'black' }]}>{label}</Text>
</TouchableOpacity>
)
}