-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Creared give a ride form template - When user clicks give a ride button form will apear and can enter the ride details - Form will disapear when user presses either submit or close button - The give a ride button will only appear in the main(dashboard) screen see #15
- Loading branch information
Showing
3 changed files
with
49 additions
and
8 deletions.
There are no files selected for viewing
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
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React, { Component } from "react"; | ||
import '../../css/form.css'; | ||
|
||
class GiveARide extends Component { | ||
openForm() { | ||
document.getElementById("myForm").style.display = "block"; | ||
} | ||
|
||
closeForm() { | ||
document.getElementById("myForm").style.display = "none"; | ||
} | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<button class="open-button" onClick={this.openForm}>Give a Ride</button> | ||
<div class="form-popup" id="myForm"> | ||
<form action="/action_page.php" class="form-container"> | ||
<h1>Want to offer someone a ride ?</h1> | ||
<p>We just need a few details</p> | ||
|
||
<label for="ride_start"><b>Starting point</b></label> | ||
<input type="text" placeholder="From" name="ride_start" required /> | ||
|
||
<label for="ride_destination"><b>Destination</b></label> | ||
<input type="text" placeholder="To" name="ride_destination" required /> | ||
|
||
<label for="ride_time"><b>Prefered time</b></label> | ||
<input type="text" placeholder="Time" name="ride_time" required /> | ||
|
||
<label for="ride_fare"><b>Asking price</b></label> | ||
<input type="text" placeholder="Time" name="ride_fare" required /> | ||
|
||
<button type="submit" class="btn" onClick={this.closeForm}>Submit</button> | ||
<button type="submit" class="btn cancel" onClick={this.closeForm}>Close</button> | ||
</form> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default GiveARide; |