Skip to content

Commit de6169b

Browse files
committed
doc: update readme
1 parent dcf6898 commit de6169b

File tree

6 files changed

+59
-10
lines changed

6 files changed

+59
-10
lines changed

CHANGELOG.md

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
1-
# (2021-02-24)
1+
# [4.1.0](https://github.com/YanYuanFE/react-native-signature-canvas/compare/v4.0.0...v4.1.0) (2021-07-14)
2+
3+
4+
5+
# [4.0.0](https://github.com/YanYuanFE/react-native-signature-canvas/compare/3.6.0...v4.0.0) (2021-04-15)
6+
7+
8+
### Bug Fixes
9+
10+
* example ([664ba0c](https://github.com/YanYuanFE/react-native-signature-canvas/commit/664ba0c6a39e5ab476fe94ff9e3c4693ba6f9665))
11+
12+
13+
### Features
14+
15+
* style for view ([439ae9f](https://github.com/YanYuanFE/react-native-signature-canvas/commit/439ae9facba56d6c566dbd96bc0d5e2c8ad51312))
16+
17+
18+
19+
# [3.6.0](https://github.com/YanYuanFE/react-native-signature-canvas/compare/3.5.2...3.6.0) (2021-03-02)
20+
21+
22+
23+
## [3.5.2](https://github.com/YanYuanFE/react-native-signature-canvas/compare/3.5.1...3.5.2) (2021-02-26)
224

325

426

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ import Signature from 'react-native-signature-canvas';
6666
| :------------ |:---------------|
6767
| readSignature() | Reads the current signature on the canvas and triggers either the onOK or onEmpty callbacks |
6868
| clearSignature() | Clears the current signature |
69+
| undo() | undo signature |
70+
| erase() | erase signature |
71+
| draw() | draw signature |
72+
| changePenColor(color) | change pen color |
6973

7074
You need to use ref like:
7175
``` js

example/expo-app/Sign.js

+26-3
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,48 @@ const Sign = ({onOK}) => {
1919
ref.current.readSignature();
2020
}
2121

22+
const undo = () => {
23+
ref.current.undo();
24+
};
25+
26+
const erase = () => {
27+
ref.current.erase();
28+
};
29+
30+
const draw = () => {
31+
ref.current.draw();
32+
};
33+
34+
const changeColor = (color) => {
35+
ref.current.changePenColor(color);
36+
};
37+
2238
const style = `.m-signature-pad--footer {display: none; margin: 0px;}`;
2339

2440
return (
2541
<View style={styles.container}>
2642
<SignatureScreen
43+
rotated
2744
ref={ref}
2845
onOK={handleSignature}
2946
webStyle={style}
3047
backgroundColor={'rgba(255,255,255,0)'}
3148
/>
49+
50+
<View style={styles.row}>
51+
<Button title="undo" onPress={undo} />
52+
<Button title="draw" onPress={draw} />
53+
<Button title="erase" onPress={erase} />
54+
<Button title="change color" onPress={()=>changeColor("#d45")} />
55+
</View>
3256
<View style={styles.row}>
3357
<Button
3458
title="Clear"
3559
onPress={handleClear}
3660
/>
3761
<Button
38-
title="Confirm"
39-
onPress={handleConfirm}
62+
title="Confirm"
63+
onPress={handleConfirm}
4064
/>
4165
</View>
4266
</View>
@@ -50,7 +74,6 @@ const styles = StyleSheet.create({
5074
flex: 1,
5175
alignItems: 'center',
5276
justifyContent: 'center',
53-
height: 250,
5477
padding: 10,
5578
},
5679
row: {

example/expo-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"react": "16.13.1",
1414
"react-dom": "16.13.1",
1515
"react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz",
16-
"react-native-signature-canvas": "^3.6.0",
16+
"react-native-signature-canvas": "^4.1.0",
1717
"react-native-web": "~0.13.12",
1818
"react-native-webview": "^11.2.3"
1919
},

example/expo-app/yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -5106,10 +5106,10 @@ [email protected]:
51065106
resolved "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-3.1.9.tgz#48864ea976b0fa57142a2cc523e1fd3314e7247e"
51075107
integrity sha512-wmcGbdyE/vBSL5IjDPReoJUEqxkZsywZw5gPwsVUV1NBpw5eTIdnL6Y0uNKHE25Z661moxPHQz6kwAkYQyorxA==
51085108

5109-
react-native-signature-canvas@^3.6.0:
5110-
version "3.6.0"
5111-
resolved "https://registry.npmjs.org/react-native-signature-canvas/-/react-native-signature-canvas-3.6.0.tgz#f5567154223342b2e530cb0cf74af9f496a31817"
5112-
integrity sha512-4TRdii1olBku6F6aCkPs0q3qp+zA6FEBPLRPYRlrpMX3ixVXnAI+PiZ9w4afHAXz4O4lgelh/HDyBiUBgv2GIQ==
5109+
react-native-signature-canvas@^4.1.0:
5110+
version "4.1.0"
5111+
resolved "https://registry.nlark.com/react-native-signature-canvas/download/react-native-signature-canvas-4.1.0.tgz?cache=0&sync_timestamp=1626268524919&other_urls=https%3A%2F%2Fregistry.nlark.com%2Freact-native-signature-canvas%2Fdownload%2Freact-native-signature-canvas-4.1.0.tgz#99435af051234964258df7b83a088e2d5003100b"
5112+
integrity sha1-mUNa8FEjSWQljfe4OgiOLVADEAs=
51135113

51145114
react-native-web@~0.13.12:
51155115
version "0.13.18"

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "index.js",
66
"scripts": {
77
"build": "npm publish",
8-
"genlog": "conventional-changelog -p angular -i CHANGELOG.md -s",
8+
"genlog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
99
"postversion": "git push --follow-tags"
1010
},
1111
"repository": {

0 commit comments

Comments
 (0)