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
it('Test navigation' , () => { | |
const ui = renderConnected( | |
<> | |
<FirstPage /> | |
<Route path="/second-page">Second Page</Route> | |
</>, | |
{ initialState } | |
); | |
expect(screen.queryByText('Second Page')).toBeNull(); |
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> |
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 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
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'; | |
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 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
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
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", |
NewerOlder