Skip to content

Commit aafd6a1

Browse files
author
Max
committed
Merge branch 'fixRegistrationBranch'
2 parents 2d4f91f + 73476f5 commit aafd6a1

File tree

3 files changed

+87
-16
lines changed

3 files changed

+87
-16
lines changed

client/package-lock.json

Lines changed: 4 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/src/components/Login/SignUpForm.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ class SignUpForm extends Component{
99
super(props);
1010

1111
this.state = {
12-
displayname: '',
12+
firstName: '',
13+
lastName: '',
14+
username: '',
1315
email:'', //UUID
1416
firstName:'',
1517
lastName:'',
@@ -85,6 +87,7 @@ class SignUpForm extends Component{
8587
try{
8688
await Auth.signUp({username: email, password: password,});
8789
console.log("Signed up successfully!");
90+
this.handleCreateNewUser();
8891
this.setState({ step: 1 });
8992
}catch(err){
9093
console.log("Error signing up: ", err);
@@ -127,9 +130,12 @@ class SignUpForm extends Component{
127130
}
128131
}
129132

130-
Create_New_User = async () => {
133+
handleCreateNewUser = async () => {
134+
console.log("Trying to add user to DB");
131135
const Url="https://0o1szwcqn7.execute-api.us-west-2.amazonaws.com/pj-stage-login-v2/user";
132136
const _data={
137+
"firstname": this.state.firstName,
138+
"lastname": this.state.lastName,
133139
"username": this.state.username,
134140
"email": this.state.email,
135141
"location": this.state.location,
@@ -202,10 +208,10 @@ class SignUpForm extends Component{
202208
type="text"
203209
id="firstName"
204210
className="FormField__Input"
205-
placeholder="Enter your last name"
211+
placeholder="Enter your first name"
206212
name="firstName"
207213
required="required"
208-
value={this.state.fistName}
214+
value={this.state.firstName}
209215
onChange={this.updateFirstName.bind(this)}
210216
/>
211217
</div>

client/src/components/NewItemPage.js

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,79 @@ class NewItemPage extends Component {
243243
return false;
244244
};
245245

246+
render() {
247+
return (
248+
<div class="mt-2 p-4">
249+
<NavBar></NavBar>
250+
{/* <div class="form-group">
251+
<label for="title-input" >What is your meal?</label>
252+
<input type="text" class="form-control" id="title-input" placeholder="ex Hamburger, Tofu, Sushi..." ref={this.mealNameInput}></input>
253+
</div> */}
254+
<InputField labelName="What is your meal?" placeHolder="Hamburger, Tofu, Sushi..." input={this.mealNameInput} />
255+
256+
<div class="row justify-content-center p-4 border bg-light" id="photo-and-description">
257+
258+
<form class="md-form w-50 p-4">
259+
<div class="file-field">
260+
<div class="z-depth-1-half mb-4">
261+
<img id="FoodImage" src="https://mdbootstrap.com/img/Photos/Others/placeholder.jpg" class="img-fluid"
262+
alt="example placeholder"></img>
263+
</div>
264+
</div>
265+
<div class="d-flex justify-content-center">
266+
<div class="btn btn-mdb-color btn-rounded float-left">
267+
<span>Choose file</span>
268+
<input type="file" id="photoFile" onChange="updatePhoto"></input>
269+
</div>
270+
</div>
271+
272+
<InputField labelName="Tags" placeHolder="Seafood, Spanish..." input={this.mealTagsInput} />
273+
<InputField labelName="Ingredients" placeHolder="" input={this.mealIngredientsInput} />
274+
<InputField labelName="Allergy" placeHolder="Peanuts, Milk..." input={this.mealAllergyInput} />
275+
{/* <div label="food-tags">
276+
<label for="foodTagsBox">Tags:</label>
277+
<input type="text" class="form-control" id="foodTagsBox" placeholder="Seafood, Spanish..." ref={this.mealTagsInput}></input>
278+
</div>
279+
<div label="ingredients">
280+
<label for="ingredientsField">Ingredients:</label>
281+
<input type="text" class="form-control" id="ingredientsField" placeholder="" ref={this.mealIngredientsInput}></input>
282+
</div>
283+
<div label="allergy-info">
284+
<label for="allergyBox">Allergy:</label>
285+
<input type="text" class="form-control" id="allergyBox" placeholder="Peanuts, Milk..." ref={this.mealAllergyInput}></input>
286+
</div> */}
287+
</form>
288+
289+
<div label="right column" class="w-50 p-4">
290+
<div label="food-description">
291+
<label for="foodDescriptionBox">Food Description</label>
292+
<textarea class="form-control rounded-0" id="foodDescriptionBox" rows="10" ref={this.mealDescriptionInput}></textarea>
293+
</div>
294+
295+
<label for="price">Price:</label>
296+
297+
<div>
298+
<CurrencyInput value={this.state.amount} onChangeEvent={this.handleChange}/>
299+
</div>
300+
301+
{/* <div class="input-group mb-3">
302+
<div class="input-group-prepend">
303+
<span class="input-group-text">$</span>
304+
</div>
305+
<input type="text" class="form-control" aria-label="Amount" ref={this.mealPriceInput}></input>
306+
</div> */}
307+
308+
{/* <label for="quantity">Quantity:</label>
309+
<input type="text" class="form-control" ref={this.mealQuantityInput}></input> */}
310+
<InputField labelName="Quantity" placeHolder="" input={this.mealQuantityInput} />
311+
312+
<button class="btn btn-success mt-4" type="button" onClick={() => this.handleAddMeal()} >Submit Listing</button>
313+
</div>
314+
</div>
315+
</div>
316+
);
317+
}
318+
246319
}
247320

248321
export default NewItemPage;

0 commit comments

Comments
 (0)