This file contains hidden or 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
| import {Action, ActionCreator, Dispatch} from 'redux'; | |
| import {ThunkAction} from 'redux-thunk'; | |
| // Redux action | |
| const reduxAction: ActionCreator<Action> = (text: string) => { | |
| return { | |
| type: SET_TEXT, | |
| text | |
| }; | |
| }; |
This file contains hidden or 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
| const certificateGenerator = (image, name, userName) => { | |
| if (image) getBlob(image).then((blob) => { | |
| const { base64 } = blob; | |
| const doc = new jsPDF({ | |
| orientation: 'landscape', | |
| }) | |
| const w = doc.internal.pageSize.getWidth(); | |
| const h = doc.internal.pageSize.getHeight(); | |
| doc.addImage(base64, 'JPEG', 0, 0, w, h); |
This file contains hidden or 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
| function parseJwt (token) { | |
| var base64Url = token.split('.')[1]; | |
| var base64 = base64Url.replace('-', '+').replace('_', '/'); | |
| return JSON.parse(window.atob(base64)); | |
| }; |
This file contains hidden or 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
| update gitignore with the rules | |
| git add .gitignore | |
| git rm -r --cached some-directory | |
| git commit -m 'Remove the now ignored directory "some-directory"' | |
| git push origin master |