mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-10 15:02:42 +01:00
reorg again, absolute (module) imports
This commit is contained in:
31
app/components/Button.tsx
Normal file
31
app/components/Button.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import React, { useState } from 'react'
|
||||
import { GestureResponderEvent, Pressable, Text } from 'react-native'
|
||||
import colors from '@app/styles/colors'
|
||||
import text from '@app/styles/text'
|
||||
|
||||
const Button: React.FC<{
|
||||
title: string
|
||||
onPress: (event: GestureResponderEvent) => void
|
||||
}> = ({ title, onPress }) => {
|
||||
const [opacity, setOpacity] = useState(1)
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
onPress={onPress}
|
||||
onPressIn={() => setOpacity(0.6)}
|
||||
onPressOut={() => setOpacity(1)}
|
||||
onLongPress={() => setOpacity(1)}
|
||||
style={{
|
||||
backgroundColor: colors.accent,
|
||||
paddingHorizontal: 24,
|
||||
minHeight: 42,
|
||||
justifyContent: 'center',
|
||||
borderRadius: 1000,
|
||||
opacity,
|
||||
}}>
|
||||
<Text style={{ ...text.button }}>{title}</Text>
|
||||
</Pressable>
|
||||
)
|
||||
}
|
||||
|
||||
export default Button
|
||||
Reference in New Issue
Block a user