mirror of
https://github.com/myfatemi04/wheelshare-frontend.git
synced 2025-04-21 19:29:51 -04:00
pool register button
This commit is contained in:
parent
ca2db7ca60
commit
aba1d34c79
|
@ -1,7 +1,8 @@
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect, Component } from 'react';
|
||||||
|
|
||||||
const Pool = (props) => {
|
const Pool = (props) => {
|
||||||
const poolid = props.match.params.id;
|
const poolid = props.match.params.id;
|
||||||
|
const registered = false;
|
||||||
const [state, setState] = useState({
|
const [state, setState] = useState({
|
||||||
pool_title: 'TJ Carpool',
|
pool_title: 'TJ Carpool',
|
||||||
id: 1,
|
id: 1,
|
||||||
|
@ -31,6 +32,7 @@ const Pool = (props) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
callAPI();
|
callAPI();
|
||||||
}, []);
|
}, []);
|
||||||
|
@ -51,7 +53,21 @@ const Pool = (props) => {
|
||||||
<p className="text-left">Start Time: {state.start_time}</p>
|
<p className="text-left">Start Time: {state.start_time}</p>
|
||||||
<p className="text-left">End Time: {state.end_time}</p>
|
<p className="text-left">End Time: {state.end_time}</p>
|
||||||
<p className="text-left">{state.pool_text}</p>
|
<p className="text-left">{state.pool_text}</p>
|
||||||
|
<form
|
||||||
|
action={'register_pool/' + poolid}
|
||||||
|
method="POST"
|
||||||
|
className="text-left"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
type="submit"
|
||||||
|
value={!registered ? 'Register' : 'Unregister'}
|
||||||
|
className={
|
||||||
|
'text-left btn btn-' + (!registered ? 'success' : 'danger')
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form onSubmit={onComment}>
|
<form onSubmit={onComment}>
|
||||||
<div id="form-group" className="text-left">
|
<div id="form-group" className="text-left">
|
||||||
<textarea
|
<textarea
|
||||||
|
|
Loading…
Reference in New Issue
Block a user