mirror of
https://github.com/SrIzan10/featheroom.git
synced 2026-06-06 00:56:49 +00:00
chore: add small loading user feedback
This commit is contained in:
@@ -1,16 +1,22 @@
|
||||
import * as WebBrowser from 'expo-web-browser'
|
||||
import { useState } from 'react'
|
||||
import { Pressable, View } from 'react-native'
|
||||
import { Icon, Text } from 'react-native-paper'
|
||||
|
||||
export default function SimpleAttachment(props: Props) {
|
||||
const [clicked, setClicked] = useState(false)
|
||||
return (
|
||||
<Pressable
|
||||
onPress={async () => {
|
||||
await WebBrowser.openBrowserAsync(props.link)
|
||||
setClicked(true)
|
||||
const browse = await WebBrowser.openBrowserAsync(props.link)
|
||||
if (browse.type) {
|
||||
setClicked(false)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<View className="flex flex-row gap-3 items-center pt-2">
|
||||
<Icon source="attachment" size={20} />
|
||||
<Icon source={clicked ? 'dots-horizontal' : 'attachment'} size={20} />
|
||||
<Text className="text-xl">{props.title}</Text>
|
||||
</View>
|
||||
</Pressable>
|
||||
|
||||
Reference in New Issue
Block a user