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
REACT_APP_LOGIN="http://localhost:3030/api/auth/login" | |
REACT_APP_LOGOUT="http://localhost:3030/api/auth/logout" | |
DOMAIN="user4234.auth0.com" | |
ID="46NxlCzM0XDE7T2upOn2jlgvoS" | |
SECRET="0xbTbFK2y3DIMp2TdOgK1MKQ2vH2WRg2rv6jVrMhSX0T39e5_Kd4lmsFz" | |
SUCCESS_REDIRECT="http://localhost:3030/" | |
FAILURE_REDIRECT="http://localhost:3030/api/auth/login" | |
AWS_ACCESS_KEY_ID=AKSFDI4KL343K55L3 | |
AWS_SECRET_ACCESS_KEY=EkjfDzVrG1cw6QFDK4kjKFUa2yEDmPOVzN553kAANcy |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "PublicReadGetObject", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": [ | |
"s3:GetObject" | |
], |
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
handleCheckBox(e) { | |
const newSelection = e.target.value; | |
let newSelectionArray; | |
if(this.state.newUser.skills.indexOf(newSelection) > -1) { | |
newSelectionArray = this.state.newUser.skills.filter(s => s !== newSelection) | |
} else { | |
newSelectionArray = [...this.state.newUser.skills, newSelection]; | |
} |
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
/* FormContainer.jsx */ | |
handleInput(e) { | |
let value = e.target.value; | |
let name = e.target.name; | |
this.setState( prevState => { | |
return { | |
newUser : { | |
...prevState.newUser, [name]: value | |
} |
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
const CheckBox = (props) => { | |
return( <div> | |
<label for={props.name} className="form-label">{props.title}</label> | |
<div className="checkbox-group"> | |
{props.options.map(option => { | |
return ( | |
<label key={option}> | |
<input | |
className="form-checkbox" |
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
/*Select.jsx*/ | |
const Select = (props) => { | |
return( | |
<div className="form-group"> | |
<label htmlFor={props.name}> {props.title} </label> | |
<select | |
name={props.name} | |
value={props.value} | |
onChange={props.handleChange} |
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 Presentational Components */ | |
import CheckBox from '../components/CheckBox'; | |
import Input from '../components/Input'; | |
class FormContainer extends Component { | |
constructor(props) { | |
super(props); |
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
<form className="container" onSubmit={this.handleFormSubmit}> | |
<Input /> {/* Name of the user */} | |
<Input /> {/* Input for Age */} | |
<Select /> {/* Gender Selection */} | |
<CheckBox /> {/* List of Skills (eg. Programmer, developer) */} | |
<TextArea /> {/* About you */} | |
<Button /> { /*Submit */ } | |
<Button /> {/* Clear the form */} | |
</form> |
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'; | |
class App extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
data: 'Default data' | |
} | |
this.updateState = this.updateState.bind(this); |