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
Here are some awesome react-js libraries to use for upgrading the user experience | |
1. For Creating scrollable Header for page **react-headroom** is an awesome library. | |
Details : https://kyleamathews.github.io/react-headroom/ | |
2. For Dealing with Table **material-table** is a very powerful library | |
Details : https://material-table.com/#/docs/get-started | |
3. For awesome toast messages **cogo-toast** is the go to option | |
Details: https://cogoport.github.io/cogo-toast/ |
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
importScripts('https://www.gstatic.com/firebasejs/7.14.2/firebase-app.js') | |
importScripts('https://www.gstatic.com/firebasejs/7.14.2/firebase-messaging.js') | |
const config = { | |
apiKey: "API_KEY", | |
authDomain: "PROJECT_ID.firebaseapp.com", | |
databaseURL: "https://PROJECT_ID.firebaseio.com", | |
projectId: "PROJECT_ID", | |
storageBucket: "PROJECT_ID.appspot.com", | |
messagingSenderId: "SENDER_ID", |
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
import firebase from 'firebase' | |
export const useFirebaseNotificationProvider = () => { | |
if ('serviceWorker' in navigator) { | |
navigator.serviceWorker | |
.register('./firebase-messaging-sw.js') | |
.then(function (registration) { | |
console.log('Registration successful, scope is:', registration.scope) | |
}) | |
.catch(function (err) { | |
console.log('Service worker registration failed, error:', err) |
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
import React from 'react'; | |
export default function Home() { | |
return <div>Home Page</div> | |
} |
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
import React from 'react'; | |
import Link from "next/link"; | |
export default function Home() { | |
return <div> | |
<Link href={'about'}>Go to About Page</Link> | |
</div> | |
} |
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
import React from 'react'; | |
import styles from './layout.module.css' | |
export default function Layout({children}) { | |
return <div className={styles.container}>{children}</div> | |
} |
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
export default function App () { | |
if ('serviceWorker' in navigator) { | |
navigator.serviceWorker | |
.register('firebase-messaging-sw.js') | |
.then(function(registration) { | |
console.log('[SW]: SCOPE: ', registration.scope); | |
return registration.scope; | |
}) | |
.catch(function(err) { |
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
function generatePreSignedGetUrl( fileName , fileType) { | |
myBucket.getSignedUrl('getObject', { | |
Key: fileName, | |
ContentType: fileType, | |
Expires: URL_EXPIRATION_TIME | |
} , (err , url) => { | |
return url // API Response Here | |
}); | |
} |
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
import {fetchData , putData} from './AwsFunctions'; | |
export default const App = () => { | |
const fetchDataFormDynamoDb = async () => { | |
await fetchData('users') | |
} | |
const addDataToDynamoDB = async () => { | |
const userData = { |
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
import {fetchData} from './AwsFunctions'; | |
export default const App = () => { | |
const fetchDataFormDynamoDb = () => { | |
fetchData('users') | |
} | |
return <> | |
<button onClick={() => fetchDataFormDynamoDb()}> Fetch </button> |
OlderNewer