Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add flag to disable pin explainer screen #1343

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/legacy/core/App/layout/ScreenLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { StyleSheet, View, ViewStyle } from 'react-native'
import { Edge, SafeAreaView } from 'react-native-safe-area-context'

import { TOKENS, useServices } from '../container-api'
import { Screens } from 'types/navigators'
import { Screens } from '../types/navigators'

export interface LayoutProps {
safeArea?: boolean
Expand Down
29 changes: 15 additions & 14 deletions packages/legacy/core/App/navigators/SettingStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const SettingStack: React.FC = () => {
options={{
title: t('Screens.Settings'),
headerBackTestID: testIdWithKey('Back'),
...ScreenOptionsDictionary[Screens.Settings]
...ScreenOptionsDictionary[Screens.Settings],
}}
/>
<Stack.Screen
Expand All @@ -65,7 +65,7 @@ const SettingStack: React.FC = () => {
options={{
title: t('Screens.NameWallet'),
headerBackTestID: testIdWithKey('Back'),
...ScreenOptionsDictionary[Screens.NameWallet]
...ScreenOptionsDictionary[Screens.NameWallet],
}}
/>
<Stack.Screen
Expand All @@ -74,15 +74,16 @@ const SettingStack: React.FC = () => {
options={{
title: t('Screens.Language'),
headerBackTestID: testIdWithKey('Back'),
...ScreenOptionsDictionary[Screens.Language]
...ScreenOptionsDictionary[Screens.Language],
}}
/>
<Stack.Screen
name={Screens.AutoLock}
component={AutoLock}
options={{title: 'Auto lock Options',
options={{
title: 'Auto lock Options',
headerBackTestID: testIdWithKey('Back'),
...ScreenOptionsDictionary[Screens.AutoLock]
...ScreenOptionsDictionary[Screens.AutoLock],
}}
/>
<Stack.Screen
Expand All @@ -91,7 +92,7 @@ const SettingStack: React.FC = () => {
options={{
title: t('Screens.DataRetention'),
headerBackTestID: testIdWithKey('Back'),
...ScreenOptionsDictionary[Screens.DataRetention]
...ScreenOptionsDictionary[Screens.DataRetention],
}}
/>
<Stack.Screen
Expand All @@ -100,7 +101,7 @@ const SettingStack: React.FC = () => {
options={{
title: t('Screens.Tours'),
headerBackTestID: testIdWithKey('Back'),
...ScreenOptionsDictionary[Screens.Tours]
...ScreenOptionsDictionary[Screens.Tours],
}}
/>
<Stack.Screen
Expand All @@ -110,16 +111,16 @@ const SettingStack: React.FC = () => {
title: t('Screens.Biometry'),
headerLeft: biometryUpdatePending ? () => null : undefined,
headerBackTestID: testIdWithKey('Back'),
...ScreenOptionsDictionary[Screens.UseBiometry]
...ScreenOptionsDictionary[Screens.UseBiometry],
}}
/>
<Stack.Screen
name={Screens.CreatePIN}
component={PINCreate}
component={(props) => <PINCreate explainedStatus {...props} />}
options={{
title: t('Screens.ChangePIN'),
headerBackTestID: testIdWithKey('Back'),
...ScreenOptionsDictionary[Screens.CreatePIN]
...ScreenOptionsDictionary[Screens.CreatePIN],
}}
/>
<Stack.Screen
Expand All @@ -128,7 +129,7 @@ const SettingStack: React.FC = () => {
options={{
title: t('Screens.UsePushNotifications'),
headerBackTestID: testIdWithKey('Back'),
...ScreenOptionsDictionary[Screens.UsePushNotifications]
...ScreenOptionsDictionary[Screens.UsePushNotifications],
}}
/>
<Stack.Screen
Expand All @@ -137,7 +138,7 @@ const SettingStack: React.FC = () => {
options={{
title: t('Screens.Terms'),
headerBackTestID: testIdWithKey('Back'),
...ScreenOptionsDictionary[Screens.Terms]
...ScreenOptionsDictionary[Screens.Terms],
}}
/>
<Stack.Screen
Expand All @@ -146,7 +147,7 @@ const SettingStack: React.FC = () => {
options={{
title: t('Screens.Developer'),
headerBackTestID: testIdWithKey('Back'),
...ScreenOptionsDictionary[Screens.Developer]
...ScreenOptionsDictionary[Screens.Developer],
}}
/>
<Stack.Screen name={Screens.Onboarding} options={{ title: t('Screens.Onboarding') }}>
Expand All @@ -167,7 +168,7 @@ const SettingStack: React.FC = () => {
options={{
title: t('Screens.HistorySettings'),
headerBackTestID: testIdWithKey('Back'),
...ScreenOptionsDictionary[Screens.HistorySettings]
...ScreenOptionsDictionary[Screens.HistorySettings],
}}
/>
</Stack.Navigator>
Expand Down
5 changes: 3 additions & 2 deletions packages/legacy/core/App/screens/PINCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ const PINCreate: React.FC<PINCreateProps> = ({ setAuthenticated, explainedStatus
title: '',
message: '',
})
const [explained, setExplained] = useState(explainedStatus)
const iconSize = 24
const navigation = useNavigation<StackNavigationProp<AuthenticateStackParams>>()
const [store, dispatch] = useStore()
Expand All @@ -78,7 +77,7 @@ const PINCreate: React.FC<PINCreateProps> = ({ setAuthenticated, explainedStatus
const [
PINExplainer,
PINCreateHeader,
{ PINSecurity },
{ PINSecurity, showPINExplainer },
Button,
inlineMessages,
logger,
Expand All @@ -97,6 +96,8 @@ const PINCreate: React.FC<PINCreateProps> = ({ setAuthenticated, explainedStatus
TOKENS.HISTORY_EVENTS_LOGGER,
])

const [explained, setExplained] = useState(explainedStatus || showPINExplainer === false)

const [PINOneValidations, setPINOneValidations] = useState<PINValidationsType[]>(
PINCreationValidations(PIN, PINSecurity.rules)
)
Expand Down
1 change: 1 addition & 0 deletions packages/legacy/core/App/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface Config {
enableImplicitInvitations?: boolean
enableReuseConnections?: boolean
showPreface?: boolean
showPINExplainer?: boolean
disableOnboardingSkip?: boolean
enablePushNotifications?: PushNotificationConfiguration
whereToUseWalletUrl?: string
Expand Down