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 React, { useEffect, useState } from "react"; | |
| const ShowNumberOfEvents = ({ number = 0 }) => { | |
| useEffect( | |
| () => { | |
| console.log( | |
| "called On mount (componentDidMount) and only number is changed" | |
| ); | |
| return () => console.log("--- componentWillUnmount ---"); | |
| }, |
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 React, { useState } from "react"; | |
| import { Button, Form, FormGroup, Label, Input } from "reactstrap"; | |
| export default function securityForm() { | |
| const [credentials, setCredentials] = useState({ | |
| email: "", | |
| password: "", | |
| checkMe: false | |
| }); | |
| const handleInputChange = event => { |
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 React, { Component } from "react"; | |
| import { Row } from "reactstrap"; | |
| import * as context from "../context"; | |
| export default class ContentComponent extends Component { | |
| static contextType = context.Language.LanguageContext; | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| loading: true | |
| }; |
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 React, { Component } from "react"; | |
| const LanguageContext = React.createContext(); | |
| // could be imported from our translation.json file | |
| const translations = { | |
| en: { | |
| welcome: "Welcome", | |
| greeting: "Hello you're loggedIn!!! Welcome my name is Stan", | |
| login: "Log In", | |
| changeLocale: "Change locale to French", |
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 React from "react"; | |
| import * as Context from "./context"; | |
| export default () => { | |
| return ( | |
| <Context.Language.Consumer> | |
| {({ locale, translation, switchLocale }) => ( | |
| <Context.Auth.Consumer> | |
| {Auth => ( | |
| <div className={"App-header"}> |
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 React, { Component } from "react"; | |
| const AuthContext = React.createContext(); | |
| class AuthProvider extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| isLoggedIn: false | |
| }; | |
| } |
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
| aws s3 sync s3://oldbucket s3://newbucket --source-region us-west-1 --region us-west-2 |
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
| /** | |
| * Modify the parts you need to get it working. | |
| */ | |
| var should = require('should'); | |
| var request = require('../node_modules/request'); | |
| var io = require('socket.io-client'); | |
| var serverUrl = 'http://localhost'; |