From e95d240562a8e3d795822cccc0976ebc6aedc72e Mon Sep 17 00:00:00 2001 From: counterweight Date: Sat, 22 Mar 2025 17:34:42 +0100 Subject: [PATCH] refactor place input out --- src/front/components/PlaceInput.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/front/components/PlaceInput.js diff --git a/src/front/components/PlaceInput.js b/src/front/components/PlaceInput.js new file mode 100644 index 0000000..9720ec9 --- /dev/null +++ b/src/front/components/PlaceInput.js @@ -0,0 +1,26 @@ +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; + } +} + +module.exports = PlaceInput;