Fix toast positioning (close #9)

This commit is contained in:
Paul Frazee 2022-11-28 10:38:16 -06:00
parent c86ff23757
commit 0e6237e58c
15 changed files with 37 additions and 137 deletions

View file

@ -1,5 +1,5 @@
import React, {useState} from 'react'
import Toast from '../util/Toast'
import * as Toast from '../util/Toast'
import {
ActivityIndicator,
StyleSheet,
@ -71,9 +71,7 @@ export function Component({}: {}) {
},
)
.catch(e => console.error(e)) // an error here is not critical
Toast.show('Scene created', {
position: Toast.positions.TOP,
})
Toast.show('Scene created')
store.shell.closeModal()
store.nav.navigate(`/profile/${fullHandle}`)
} catch (e: any) {

View file

@ -1,5 +1,5 @@
import React, {useState} from 'react'
import Toast from '../util/Toast'
import * as Toast from '../util/Toast'
import {StyleSheet, Text, TouchableOpacity, View} from 'react-native'
import LinearGradient from 'react-native-linear-gradient'
import {BottomSheetScrollView, BottomSheetTextInput} from '@gorhom/bottom-sheet'
@ -52,9 +52,7 @@ export function Component({
}
},
)
Toast.show('Profile updated', {
position: Toast.positions.TOP,
})
Toast.show('Profile updated')
onUpdate?.()
store.shell.closeModal()
} catch (e: any) {

View file

@ -1,6 +1,6 @@
import React, {useState, useEffect, useMemo} from 'react'
import {observer} from 'mobx-react-lite'
import Toast from '../util/Toast'
import * as Toast from '../util/Toast'
import {
ActivityIndicator,
FlatList,
@ -83,10 +83,7 @@ export const Component = observer(function Component({
follow.declaration.cid,
)
setCreatedInvites({[follow.did]: assertionUri, ...createdInvites})
Toast.show('Invite sent', {
duration: Toast.durations.LONG,
position: Toast.positions.TOP,
})
Toast.show('Invite sent')
} catch (e) {
setError('There was an issue with the invite. Please try again.')
console.error(e)
@ -119,10 +116,7 @@ export const Component = observer(function Component({
[assertion.uri]: true,
...deletedPendingInvites,
})
Toast.show('Invite removed', {
duration: Toast.durations.LONG,
position: Toast.positions.TOP,
})
Toast.show('Invite removed')
} catch (e) {
setError('There was an issue with the invite. Please try again.')
console.error(e)