Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions frontend/src/pages/CreateGirl.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useNavigate } from 'react-router-dom';
import { Link, useNavigate } from 'react-router-dom';
import api from '../api';
import { useState } from 'react';
import { validate, changeInput } from '../helpers';
Expand All @@ -25,10 +25,8 @@ export default function CreateGirl() {
} else {
console.log("Girl was not added!");
}

})
.catch((error) => console.error(`Error: ${error}`));

}

return (
Expand Down Expand Up @@ -83,7 +81,6 @@ export default function CreateGirl() {
min="18"
max="70"
/>

{(age) ? null : <small className="error">This field is required</small>}
<label htmlFor="height">Height:</label>
<input
Expand Down Expand Up @@ -138,21 +135,28 @@ export default function CreateGirl() {
<option value="white">White</option>
<option value="bald">Bald</option>
</select>

{(hairColor) ? null : <small className="error">This field is required</small>}
<label htmlFor="eyeColor">Eye Color:</label>
<input
<select
type="text"
className="form-input"
id="eyeColor"
name="eyeColor"
required
onChange={(e) => setEyeColor(e.target.value)}
value={eyeColor}
/>
>
<option value="">--Please choose an option--</option>
<option value="black">Black</option>
<option value="brown">Brown</option>
<option value="gray">Gray</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
</select>
{(eyeColor) ? null : <small className="error">This field is required</small>}

<input type="submit" value="Submit" />
<Link className="button service" to="/strip-club">Back</Link>
</form>
</div>
)
Expand Down
16 changes: 11 additions & 5 deletions frontend/src/pages/EditGirl.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useParams, useNavigate } from 'react-router-dom';
import { Link, useParams, useNavigate } from 'react-router-dom';
import api from '../api';
import { useState, useEffect } from 'react';
import { validate, changeInput } from '../helpers';
Expand All @@ -7,7 +7,6 @@ import { validate, changeInput } from '../helpers';
export default function EditEscapeRoom() {
const { girlId } = useParams();
const [girls, setGirls] = useState([]);

const [image, setImage] = useState("");
const [name, setName] = useState("");
const [bio, setBio] = useState("");
Expand Down Expand Up @@ -59,7 +58,6 @@ export default function EditEscapeRoom() {
})
.catch((error) => console.error(`Error: ${error}`));
}

return (
<div>
<h2 className="crud-title">Edit Girl</h2>
Expand Down Expand Up @@ -171,18 +169,26 @@ export default function EditEscapeRoom() {
</select>
{(hairColor) ? null : <small className="error">This field is required</small>}
<label htmlFor="eyeColor">Eye Color:</label>
<input
<select
type="text"
className="form-input"
id="eyeColor"
name="eyeColor"
required
onChange={(e) => setEyeColor(e.target.value)}
value={eyeColor}
/>
>
<option value="">--Please choose an option--</option>
<option value="black">Black</option>
<option value="brown">Brown</option>
<option value="gray">Gray</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
</select>
{(eyeColor) ? null : <small className="error">This field is required</small>}

<input type="submit" value="Submit" />
<Link className="button" to="/strip-club">Back</Link>
</form>
</div>
)
Expand Down