From d7abe00dd429a026f17146eb69c3b32f0e787dc9 Mon Sep 17 00:00:00 2001 From: Anh Nguyen Date: Sun, 10 Oct 2021 00:20:41 +0700 Subject: [PATCH] Fix lockDuration typo --- README.md | 6 +++--- package.json | 52 ++++++++++++++++++++++++------------------------- src/Clock.tsx | 2 +- src/PinCode.tsx | 2 +- src/types.ts | 4 ++-- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index a674211..187bb26 100644 --- a/README.md +++ b/README.md @@ -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: { @@ -113,7 +113,7 @@ const App = () => { options={{ pinLength: 6, maxAttempt: 4, - lockedDuration: 10000, + lockDuration: 10000, allowedReset: true, disableLock: false, backSpace: , @@ -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 | diff --git a/package.json b/package.json index a8037e7..183b577 100644 --- a/package.json +++ b/package.json @@ -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 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 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/**/*" + ] +} \ No newline at end of file diff --git a/src/Clock.tsx b/src/Clock.tsx index 42bdfc3..83e7f03 100644 --- a/src/Clock.tsx +++ b/src/Clock.tsx @@ -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 diff --git a/src/PinCode.tsx b/src/PinCode.tsx index 2aadc98..c512705 100644 --- a/src/PinCode.tsx +++ b/src/PinCode.tsx @@ -243,7 +243,7 @@ const PinCode = ({ {curTextOptions.locked?.title} {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))} diff --git a/src/types.ts b/src/types.ts index b955c02..92e8fdc 100644 --- a/src/types.ts +++ b/src/types.ts @@ -103,7 +103,7 @@ export const DEFAULT = { pinLength: 4, allowReset: true, disableLock: false, - lockedDuration: 600000, + lockDuration: 600000, maxAttempt: 10 }, TextOptions: { @@ -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: {