Skip to content

Instantly share code, notes, and snippets.

@kamiljozwik
Created March 29, 2019 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamiljozwik/05414c79b0c70b428f82b2ae613d77f3 to your computer and use it in GitHub Desktop.
Save kamiljozwik/05414c79b0c70b428f82b2ae613d77f3 to your computer and use it in GitHub Desktop.
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