-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from opensrc0/main
feat: Changed the import export, use can export import component in multiple ways
- Loading branch information
Showing
34 changed files
with
1,077 additions
and
754 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
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 |
---|---|---|
|
@@ -2,4 +2,7 @@ node_modules/ | |
|
||
__build/ | ||
|
||
**/index.js | ||
**/index.js | ||
|
||
!__app/component/**/index.js | ||
|
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,86 @@ | ||
## 1. Happy Flow | ||
|
||
```js | ||
import AutoFillOtp from "fe-pilot/AutoFillOtp"; | ||
``` | ||
|
||
#### a) Call AutoFillOtp function | ||
|
||
```js | ||
AutoFillOtp(); | ||
``` | ||
|
||
> [!Important] | ||
> To work AutoFillOtp successfully, your otp message template should follow the below format. | ||
> <br /> | ||
> ```Your OTP is 123456``` | ||
> <br/> | ||
> ```@your-domain.com #123456``` | ||
|
||
## 2. Success: successCb callBack function definition | ||
|
||
```js | ||
const successCb = ({ msgType, msg, data, status }) => { | ||
console.log(msgType); // SUCCESSFUL | ||
console.log(msg); // Success OTP Autofill | ||
console.log(data); // logs - otp | ||
console.log(status); // SUCCESS | ||
}; | ||
|
||
AutoFillOtp({ | ||
successCb, | ||
successMsg: "Success OTP Autofill", | ||
}); | ||
``` | ||
|
||
> [!Note] | ||
> **successCb** function will get an object contains the property `msgType`, `msg`, `data`, `status` | ||
|
||
## 3. Failure: failureCb callBack function definition | ||
|
||
```js | ||
const failureCb = ({ msgType, msg, status }) => { | ||
console.log(msgType); | ||
console.log(msg); | ||
console.log(status); | ||
// UN_SUPPORTED_FEATURE ERROR | ||
// Your device does not support AutoFillOtp | ||
// FAILURE | ||
|
||
// ----------OR---------- | ||
|
||
// ERROR | ||
// Unable to auto fill otp | ||
// FAILURE | ||
}; | ||
|
||
AutoFillOtp({ | ||
failureCb, | ||
failureMsg: { | ||
unSupported: "Your device does not support AutoFillOtp", | ||
error: "Unable to auto fill otp", | ||
}, | ||
}); | ||
``` | ||
|
||
> [!Note] | ||
> **failureCb** function will get an object contains the property `msgType`, `msg`, `status` | ||
> [!Important] | ||
> Failure can happend due to multiple reasons, due to that reason `failureMsg` is an object having different kind of error property according to the error can occur in component | ||
## 4. Combine with all props | ||
|
||
```js | ||
AutoFillOtp({ | ||
successCb, | ||
successMsg: "Success OTP Autofill", | ||
failureCb, | ||
failureMsg: { | ||
unSupported: "Your device does not support AutoFillOtp", | ||
error: "Unable to auto fill otp", | ||
}, | ||
}); | ||
``` |
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,5 @@ | ||
import AutoFillOtp from './AutoFillOtp'; | ||
|
||
export { AutoFillOtp }; | ||
|
||
export default AutoFillOtp; |
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,5 @@ | ||
import ColorPicker from './ColorPicker'; | ||
|
||
export { ColorPicker }; | ||
|
||
export default ColorPicker; |
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,5 @@ | ||
import CopyToClipboard from './CopyToClipboard'; | ||
|
||
export { CopyToClipboard }; | ||
|
||
export default CopyToClipboard; |
Oops, something went wrong.