Created
March 29, 2019 14:41
-
-
Save kamiljozwik/05414c79b0c70b428f82b2ae613d77f3 to your computer and use it in GitHub Desktop.
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, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import { withAuthenticator } from 'aws-amplify-react' // HOC do sprawdzania czy mamy zalogowanego użytkownika | |
class App extends Component { | |
render() { | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> | |
<h1 className="App-title">Welcome to React</h1> | |
</header> | |
<p className="App-intro"> | |
To get started, edit <code>src/App.js</code> and save to reload. | |
</p> | |
</div> | |
); | |
} | |
} | |
export default withAuthenticator(App, { includeGreetings: true}); // dodajemy autoryzację na całą naszą aplikację. "includeGreetings" wygeneruje nam górną belkę z nazwą użytkownika i przyciskem "Wyloguj" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment