Skip to content

Commit

Permalink
feat: Added useHooks for userData
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyvid7-Darus10 committed May 21, 2023
1 parent 81e8ae6 commit 81e4a56
Show file tree
Hide file tree
Showing 27 changed files with 314 additions and 78 deletions.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@ Add `FaceLogin` to your component:
```js
import React from 'react';
import ReactDOM from 'react-dom';
import FaceLogin from 'face-guardian';
import { FaceLogin, useUserData } from 'face-guardian';

const App = () => {
const userData = useUserData();

return (
<React.StrictMode>
<FaceLogin
appId="your-app-id"
buttonStyles={{ background: 'red', fontSize: '20px' }}
buttonText="Custom Button Text"
/>
{userData && <div>Welcome, {userData.name}!</div>}
</React.StrictMode>
);
};
Expand All @@ -44,6 +47,18 @@ const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
root.render(<App />);
```

## Contributing

We welcome contributions to the Face Guardian package! Please refer to our [Contributing Guidelines](https://github.com/Cyvid7-Darus10/face-guardian-npm/blob/main/CONTRIBUTING.md) for detailed information on how you can contribute.

## Support

If you're having trouble with the package, please open an issue on the [GitHub repository](https://github.com/Cyvid7-Darus10/face-guardian-npm/issues). We'll do our best to help you out.

## License

The Face Guardian package is open source software [licensed as MIT](https://github.com/Cyvid7-Darus10/face-guardian-npm/blob/main/LICENSE).

[npm-url]: https://www.npmjs.com/package/face-guardian
[npm-image]: https://img.shields.io/npm/v/face-guardian
[github-license]: https://img.shields.io/github/license/Cyvid7-Darus10/face-guardian-npm
Expand Down
10 changes: 6 additions & 4 deletions dist/cjs/components/FaceLogin/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react';
declare const FaceLogin: React.FC<{
import React, { CSSProperties } from 'react';
type FaceLoginProps = {
appId: string;
clientSecret: string;
}>;
buttonStyles?: CSSProperties;
buttonText?: string;
};
declare const FaceLogin: React.FC<FaceLoginProps>;
export default FaceLogin;
62 changes: 45 additions & 17 deletions dist/cjs/components/FaceLogin/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cjs/components/FaceLogin/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/cjs/components/useUserData/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const useUserData: () => any;
export default useUserData;
37 changes: 37 additions & 0 deletions dist/cjs/components/useUserData/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/cjs/components/useUserData/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion dist/cjs/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import FaceLogin from './components/FaceLogin';
export default FaceLogin;
import useUserData from './components/useUserData';
export { FaceLogin, useUserData };
5 changes: 4 additions & 1 deletion dist/cjs/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cjs/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions dist/esm/components/FaceLogin/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react';
declare const FaceLogin: React.FC<{
import React, { CSSProperties } from 'react';
type FaceLoginProps = {
appId: string;
clientSecret: string;
}>;
buttonStyles?: CSSProperties;
buttonText?: string;
};
declare const FaceLogin: React.FC<FaceLoginProps>;
export default FaceLogin;
63 changes: 46 additions & 17 deletions dist/esm/components/FaceLogin/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/esm/components/FaceLogin/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/esm/components/useUserData/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const useUserData: () => any;
export default useUserData;
34 changes: 34 additions & 0 deletions dist/esm/components/useUserData/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/esm/components/useUserData/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion dist/esm/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import FaceLogin from './components/FaceLogin';
export default FaceLogin;
import useUserData from './components/useUserData';
export { FaceLogin, useUserData };
3 changes: 2 additions & 1 deletion dist/esm/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/esm/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 81e4a56

Please sign in to comment.