time input
This commit is contained in:
parent
e95d240562
commit
f480578520
4 changed files with 37 additions and 36 deletions
|
|
@ -3,31 +3,8 @@ const BuyOrSellButtonGroup = require('../components/BuyOrSellButtonGroup');
|
|||
const PremiumSelector = require('../components/PremiumSelector');
|
||||
const PriceDisplay = require('../components/PriceDisplay');
|
||||
const AmountInput = require('../components/AmountInput');
|
||||
|
||||
class PlaceInput {
|
||||
constructor({ parentElement, id }) {
|
||||
this.element = null;
|
||||
this.parentElement = parentElement;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
render() {
|
||||
const placeInput = document.createElement('textarea');
|
||||
placeInput.id = 'place-input';
|
||||
placeInput.className = 'place-and-time-box';
|
||||
placeInput.autocomplete = 'on';
|
||||
placeInput.maxLength = 140;
|
||||
placeInput.placeholder =
|
||||
"¿Dónde? Ej.'Eixample', 'La Maquinista', 'Cualquier lugar en BCN', 'Meetup BBO'";
|
||||
|
||||
this.element = placeInput;
|
||||
this.parentElement.appendChild(this.element);
|
||||
}
|
||||
|
||||
get inputText() {
|
||||
return this.element.value;
|
||||
}
|
||||
}
|
||||
const PlaceInput = require('../components/PlaceInput');
|
||||
const TimeInput = require('../components/TimeInput');
|
||||
|
||||
function offersPage() {
|
||||
const createOfferEventBus = new EventTarget();
|
||||
|
|
@ -86,6 +63,13 @@ function offersPage() {
|
|||
});
|
||||
|
||||
placeInput.render();
|
||||
|
||||
const timeInput = new TimeInput({
|
||||
parentElement: document.getElementById('place-and-time-boxes'),
|
||||
id: 'time-input',
|
||||
});
|
||||
|
||||
timeInput.render();
|
||||
// -----------
|
||||
const navbuttonHome = document.getElementById('navbutton-home');
|
||||
const navbuttonOffers = document.getElementById('navbutton-offers');
|
||||
|
|
@ -108,8 +92,6 @@ function offersPage() {
|
|||
);
|
||||
const viewMyOffersRoot = document.getElementById('view-my-offers-root');
|
||||
|
||||
const timeInput = document.getElementById('time-input');
|
||||
|
||||
const onchainCheckbox = document.getElementById('onchain-checkbox');
|
||||
const lightningCheckbox = document.getElementById('lightning-checkbox');
|
||||
|
||||
|
|
@ -172,7 +154,7 @@ function offersPage() {
|
|||
const premium = premiumSelector.getPremium();
|
||||
const trade_amount_eur = amountInput.intEurAmount;
|
||||
const location_details = placeInput.inputText;
|
||||
const time_availability_details = timeInput.value;
|
||||
const time_availability_details = timeInput.inputText;
|
||||
const is_onchain_accepted = onchainCheckbox.checked;
|
||||
const is_lightning_accepted = lightningCheckbox.checked;
|
||||
const show_offer_to_trusted = myTrustedCheckbox.checked;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue