Skip to content

Commit

Permalink
Fix lockDuration typo
Browse files Browse the repository at this point in the history
  • Loading branch information
anhnch committed Oct 9, 2021
1 parent 8ebb844 commit d7abe00
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 33 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const customTexts = {
},
locked: {
title: 'Custom locked title',
subTitle: `You have entered wrong PIN {{maxAttempt}} times. The app is locked in {{lockedDuration}}.`,
subTitle: `You have entered wrong PIN {{maxAttempt}} times. The app is locked in {{lockDuration}}.`,
lockedText: 'Locked',
},
reset: {
Expand Down Expand Up @@ -113,7 +113,7 @@ const App = () => {
options={{
pinLength: 6,
maxAttempt: 4,
lockedDuration: 10000,
lockDuration: 10000,
allowedReset: true,
disableLock: false,
backSpace: <Icon name='backspace' size={40} color='white' />,
Expand Down Expand Up @@ -218,7 +218,7 @@ The text options are grouped by screen for the ease to find. You can pass the te
| Name | Description | Required | Default | Type |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------ | ------ |
| title | The Reset screen title | false | Forgot PIN? | string |
| subTitle | The Reset screen sub title. You can use the {{maxAttempt}} and {{lockedDuration}} placeholders to display the maxAttempt and lockedDuration (in minutes) in the sub title. | false | Remove the PIN may wipe out the app data and settings. | string |
| subTitle | The Reset screen sub title. You can use the {{maxAttempt}} and {{lockDuration}} placeholders to display the maxAttempt and lockDuration (in minutes) in the sub title. | false | Remove the PIN may wipe out the app data and settings. | string |
| resetButton | The reset button text | false | Reset | string |
| confirm | Ask user to confirm removeing PIN | false | Are you sure you want remove the PIN? | string |
| confirmButton | The confirm button text | false | Confirm | string |
Expand Down
52 changes: 26 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"name": "@anhnch/react-native-pincode",
"version": "1.2.4",
"description": "Pin Code component for React Native",
"scripts": {
"build": "tsc --project ./tsconfig.json"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"repository": "https://github.com/anhnch/react-native-pin-code.git",
"author": "Anh Nguyen <anhnch@gmail.com> https://github.com/anhnch",
"license": "MIT",
"private": false,
"devDependencies": {
"@types/react": "^17.0.0",
"@types/react-native": "^0.63.45",
"react": "^17.0.1",
"react-native": "^0.63.4",
"typescript": "^4.1.3"
},
"dependencies": {
"@react-native-community/async-storage": "^1.12.1"
},
"files": [
"dist/**/*"
]
}
"name": "@anhnch/react-native-pincode",
"version": "1.2.5",
"description": "Pin Code component for React Native",
"scripts": {
"build": "tsc --project ./tsconfig.json"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"repository": "https://github.com/anhnch/react-native-pin-code.git",
"author": "Anh Nguyen <anhnch@gmail.com> https://github.com/anhnch",
"license": "MIT",
"private": false,
"devDependencies": {
"@types/react": "^17.0.0",
"@types/react-native": "^0.63.45",
"react": "^17.0.1",
"react-native": "^0.63.4",
"typescript": "^4.1.3"
},
"dependencies": {
"@react-native-community/async-storage": "^1.12.1"
},
"files": [
"dist/**/*"
]
}
2 changes: 1 addition & 1 deletion src/Clock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { StyleSheet, View, Text, ViewStyle, TextStyle } from 'react-native';
import { PinCodeT, DEFAULT } from './types';

const Clock = ({
duration = DEFAULT.Options.lockedDuration,
duration = DEFAULT.Options.lockDuration,
style,
textStyle,
onFinish
Expand Down
2 changes: 1 addition & 1 deletion src/PinCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ const PinCode = ({
<Text style={[defaultStyles.title, styles?.locked?.title]}>{curTextOptions.locked?.title}</Text>
<Text style={[defaultStyles.subTitle, styles?.locked?.subTitle]}>
{curTextOptions.locked?.subTitle?.replace('{{maxAttempt}}', (curOptions.maxAttempt || DEFAULT.Options.maxAttempt).toString())
.replace('{{lockedDuration}}', millisToMinutesAndSeconds(curOptions.lockDuration || DEFAULT.Options.lockedDuration))}
.replace('{{lockDuration}}', millisToMinutesAndSeconds(curOptions.lockDuration || DEFAULT.Options.lockDuration))}
</Text>
</View>
<View style={defaultStyles.pinContainer}>
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const DEFAULT = {
pinLength: 4,
allowReset: true,
disableLock: false,
lockedDuration: 600000,
lockDuration: 600000,
maxAttempt: 10
},
TextOptions: {
Expand All @@ -123,7 +123,7 @@ export const DEFAULT = {
},
locked: {
title: 'Locked',
subTitle: `Your have entered wrong PIN {{maxAttempt}} times.\nThe app is temporarily locked in {{lockedDuration}}.`,
subTitle: `Your have entered wrong PIN {{maxAttempt}} times.\nThe app is temporarily locked in {{lockDuration}}.`,
lockedText: 'Locked',
},
reset: {
Expand Down

0 comments on commit d7abe00

Please sign in to comment.