-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Wallet] New camera permission flow (#1398)
- Loading branch information
1 parent
43c9ebf
commit 5d7db19
Showing
8 changed files
with
247 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as React from 'react' | ||
import { render } from 'react-native-testing-library' | ||
import NotAuthorizedView from 'src/qrcode/NotAuthorizedView' | ||
|
||
describe('NotAuthorizedView', () => { | ||
it('renders correctly', () => { | ||
const { toJSON } = render(<NotAuthorizedView />) | ||
|
||
expect(toJSON()).toMatchSnapshot() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import Button, { BtnTypes } from '@celo/react-components/components/Button' | ||
import fontStyles from '@celo/react-components/styles/fonts' | ||
import React, { useCallback } from 'react' | ||
import { withNamespaces, WithNamespaces } from 'react-i18next' | ||
import { Platform, StyleSheet, Text, View } from 'react-native' | ||
import * as AndroidOpenSettings from 'react-native-android-open-settings' | ||
import { Namespaces } from 'src/i18n' | ||
import { navigateToURI } from 'src/utils/linking' | ||
|
||
type Props = WithNamespaces | ||
|
||
function NotAuthorizedView({ t }: Props) { | ||
const onPressSettings = useCallback(() => { | ||
if (Platform.OS === 'ios') { | ||
navigateToURI('app-settings:') | ||
} else if (Platform.OS === 'android') { | ||
AndroidOpenSettings.appDetailsSettings() | ||
} | ||
}, []) | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<Text style={styles.title}>{t('cameraNotAuthorizedTitle')}</Text> | ||
<Text style={styles.description}>{t('cameraNotAuthorizedDescription')}</Text> | ||
<Button | ||
onPress={onPressSettings} | ||
text={t('cameraSettings')} | ||
standard={false} | ||
type={BtnTypes.SECONDARY} | ||
/> | ||
</View> | ||
) | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
paddingHorizontal: 30, | ||
}, | ||
title: { | ||
...fontStyles.h2, | ||
...fontStyles.bold, | ||
}, | ||
description: { | ||
marginTop: 10, | ||
...fontStyles.body, | ||
textAlign: 'center', | ||
}, | ||
}) | ||
|
||
export default withNamespaces(Namespaces.sendFlow7)(NotAuthorizedView) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.