Skip to content

Commit

Permalink
Fixes #173 (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
KKA11010 authored Sep 11, 2023
1 parent 34833fb commit 1f08c6c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/components/Empty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ interface IEmptyProps {
hasOk?: boolean
pressable?: boolean
onPress?: () => void
nav?: NativeStackNavigationProp<RootStackParamList, 'nostrReceive', 'MyStack'>
nav?: NativeStackNavigationProp<RootStackParamList, 'nostrReceive', 'MyStack'> |
NativeStackNavigationProp<RootStackParamList, 'qr scan', 'MyStack'>
}

export default function Empty({ txt, hasOk, pressable, onPress, nav }: IEmptyProps) {
Expand Down
17 changes: 7 additions & 10 deletions src/screens/QRScan/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getDecodedLnInvoice } from '@cashu/cashu-ts'
import Empty from '@comps/Empty'
import useLoading from '@comps/hooks/Loading'
import useCashuToken from '@comps/hooks/Token'
import { CloseIcon, FlashlightOffIcon } from '@comps/Icons'
Expand Down Expand Up @@ -223,7 +224,11 @@ export default function QRScanPage({ navigation, route }: TQRScanPageProps) {
}, [isFocused])

return (
<View style={[globals(color).container, styles.container]}>
<View style={[
globals(color).container,
styles.container,
isFocused && hasPermission ? { justifyContent: 'center' } : {}
]}>
{isFocused && hasPermission ?
<>
<Camera
Expand Down Expand Up @@ -262,9 +267,7 @@ export default function QRScanPage({ navigation, route }: TQRScanPageProps) {
</TouchableOpacity>
</>
:
<Text style={styles.noAccess}>
{t('noCamAccess')}
</Text>
<Empty txt={t('noCamAccess')} hasOk nav={navigation} />
}
{/* Question modal for mint trusting */}
{trustModal &&
Expand All @@ -283,12 +286,6 @@ const styles = StyleSheet.create({
container: {
paddingTop: 0,
alignItems: 'center',
justifyContent: 'center',
},
noAccess: {
fontSize: 16,
fontWeight: '500',
color: mainColors.WHITE
},
flashOn: {
position: 'absolute',
Expand Down

0 comments on commit 1f08c6c

Please sign in to comment.