Skip to content

Commit

Permalink
Merge pull request #21 from opensrc0/main
Browse files Browse the repository at this point in the history
feat: Changed the import export, use can export import component in multiple ways
  • Loading branch information
opensrc0 committed Apr 8, 2024
2 parents ce48dcd + 038cf11 commit 6c20f3e
Show file tree
Hide file tree
Showing 34 changed files with 1,077 additions and 754 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
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
26 changes: 18 additions & 8 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ import Share from 'fe-pilot/Share';
>
> ###
> 01. :white_check_mark: AutoFillOtp             [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/AutoFillOtp/README.md)
> 00. :white_check_mark: ColorPicker            [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/ColorPicker/README.md)
> 00. :white_check_mark: CopyToClipboard  [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/CopyToClipboard/README.md)
> 00. :white_check_mark: FaceDetector        [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/FaceDetector/README.md)
> 00. :white_check_mark: LiveLocation          [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/LiveLocationTracking/README.md)
Expand Down Expand Up @@ -193,14 +194,23 @@ Thanks goes to these wonderful people
</tr>
<tr>
<td align="center" valign="top" width="14.28%">
<p>
<a target="_blank" href="https://github.com/fossabot">
<img src="https://avatars.githubusercontent.com/u/29791463?v=4" width="64px;" alt="Fossa Bot" />
<br />
<sub><b>Fossa Bot</b></sub>
</a>
</p>
</td>
<p>
<a target="_blank" href="https://github.com/fossabot">
<img src="https://avatars.githubusercontent.com/u/29791463?v=4" width="64px;" alt="Fossa Bot" />
<br />
<sub><b>Fossa Bot</b></sub>
</a>
</p>
</td>
<td align="center" valign="top" width="14.28%">
<p>
<a target="_blank" href="https://github.com/vineet091">
<img src="https://avatars.githubusercontent.com/u/5345138?v=4" width="64px;" alt="Vineet Gupta" />
<br />
<sub><b>Vineet Gupta</b></sub>
</a>
</p>
</td>
</tr>
</tbody>
</table>
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ node_modules/

__build/

**/index.js
**/index.js

!__app/component/**/index.js

2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"**/index.js": true,
"**/__build-es/**": true
},
"editor.tabSize": 2,

"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
Expand Down
50 changes: 30 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,18 @@ import Share from 'fe-pilot/Share';
<summary>See the list of components</summary>

###
:white_check_mark: AutoFillOtp &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/AutoFillOtp/README.md)
:white_check_mark: CopyToClipboard&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/CopyToClipboard/README.md)
:white_check_mark: FaceDetector&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/FaceDetector/README.md)
:white_check_mark: LiveLocation &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/LiveLocationTracking/README.md)
:white_check_mark: LocateMe &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/LocateMe/README.md)
:white_check_mark: PhoneBook &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/PhoneBook/README.md)
:white_check_mark: Scanner &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Scanner/README.md)
:white_check_mark: Share &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Share/README.md)
:white_check_mark: TextToSpeech &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/TextToSpeech/README.md)
:white_check_mark: VoiceRecognition&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/VoiceRecognition/README.md)
:white_check_mark: Vibrate &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Vibrate/README.md)
1. :white_check_mark: AutoFillOtp &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/AutoFillOtp/README.md)
2. :white_check_mark: ColorPicker&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/ColorPicker/README.md)
3. :white_check_mark: CopyToClipboard&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/CopyToClipboard/README.md)
4. :white_check_mark: FaceDetector&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/FaceDetector/README.md)
5. :white_check_mark: LiveLocation &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/LiveLocationTracking/README.md)
6. :white_check_mark: LocateMe &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/LocateMe/README.md)
7. :white_check_mark: PhoneBook &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/PhoneBook/README.md)
8. :white_check_mark: Scanner &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Scanner/README.md)
9. :white_check_mark: Share &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Share/README.md)
10. :white_check_mark: TextToSpeech &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/TextToSpeech/README.md)
11. :white_check_mark: VoiceRecognition&nbsp; [Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/VoiceRecognition/README.md)
12. :white_check_mark: Vibrate &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Implementation & Structure](https://github.com/opensrc0/fe-pilot/blob/main/__app/component/Vibrate/README.md)
></details>
## Online Editor Templates
Expand Down Expand Up @@ -191,15 +192,24 @@ Thanks goes to these wonderful people
</tr>
<tr>
<td align="center" valign="top" width="14.28%">
<p>
<a target="_blank" href="https://github.com/fossabot">
<img src="https://avatars.githubusercontent.com/u/29791463?v=4" width="64px;" alt="Fossa Bot" />
<br />
<sub><b>Fossa Bot</b></sub>
</a>
</p>
</td>
</tr>
<p>
<a target="_blank" href="https://github.com/fossabot">
<img src="https://avatars.githubusercontent.com/u/29791463?v=4" width="64px;" alt="Fossa Bot" />
<br />
<sub><b>Fossa Bot</b></sub>
</a>
</p>
</td>
<td align="center" valign="top" width="14.28%">
<p>
<a target="_blank" href="https://github.com/vineet091">
<img src="https://avatars.githubusercontent.com/u/5345138?v=4" width="64px;" alt="Vineet Gupta" />
<br />
<sub><b>Vineet Gupta</b></sub>
</a>
</p>
</td>
</tr>
</tbody>
</table>

Expand Down
86 changes: 86 additions & 0 deletions __app/component/AutoFillOtp/README.md
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",
},
});
```
5 changes: 5 additions & 0 deletions __app/component/AutoFillOtp/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import AutoFillOtp from './AutoFillOtp';

export { AutoFillOtp };

export default AutoFillOtp;
2 changes: 1 addition & 1 deletion __app/component/ColorPicker/ColorPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ColorPicker.propTypes = {
ColorPicker.defaultProps = {
successCb: () => {},
failureCb: () => {},
successMsg: 'Color copied successfully!!',
successMsg: 'Color picked successfully!!',
failureMsg: { ...failureMsgDefault },
};

Expand Down
8 changes: 4 additions & 4 deletions __app/component/ColorPicker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
```js
<ColorPicker
successCb={successCb}
successMsg="Color copied successfully!!"
successMsg="Color picked successfully!!"
>
Pass clickable(button, anchor etc) element here to bind onClick event
</ColorPicker>
Expand All @@ -17,13 +17,13 @@
```js
const successCb = ({ msgType, msg, data }) => {
console.log(msgType); // Success
console.log(msg); // Color copied successfully!!
console.log(msg); // Color picked successfully!!
console.log(data); // #FFFFFF (Color Code)
}

<ColorPicker
successCb={successCb}
successMsg="Color copied successfully!!"
successMsg="Color picked successfully!!"
>
<button type="button">Click here to start Color Picker</button>
</ColorPicker>
Expand Down Expand Up @@ -80,7 +80,7 @@ Failure can happend due to multiple reasons, due to that reason ```failureMsg```
```js
<ColorPicker
successCb={successCb}
successMsg="Color copied successfully!!"
successMsg="Color picked successfully!!"
failureCb={failureCb}
failureMsg={{
unSupported: 'Your device is not supporting Color Picker feature',
Expand Down
5 changes: 5 additions & 0 deletions __app/component/ColorPicker/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import ColorPicker from './ColorPicker';

export { ColorPicker };

export default ColorPicker;
6 changes: 4 additions & 2 deletions __app/component/CopyToClipboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<div>
`}
>
Pass Copy Icon here
Pass clickable(button, anchor, icon etc) element here to bind onClick event
</CopyToClipboard>
```

Expand All @@ -50,7 +50,9 @@ const successCb = ({ msgType, msg, data }) => {
successCb={successCb}
successMsg="Copied Successfully"
elementToBeCopy={`Fe-pilot library offers component like scanner, voice search, autofill otp, phonebook, share`}
/>
>
Click here to copy (Element, String, etc)
</CopyToClipboard>
```
> [!Note]
> **successCb** will get an object contains the property ```msgType```, ```msg```, ```data```
Expand Down
5 changes: 5 additions & 0 deletions __app/component/CopyToClipboard/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import CopyToClipboard from './CopyToClipboard';

export { CopyToClipboard };

export default CopyToClipboard;
Loading

0 comments on commit 6c20f3e

Please sign in to comment.