docbrown/app/javascript/packs/listingForm.jsx
ludwiczakpawel 90d04a73db
Crayonsification of Listings form (#10429)
* i dont know how to test

* fix i guess

* layout update

* layout updates

* edit

* edit listing

* fix

* tags field

* specs|

* Update app/javascript/listings/__tests__/ContactViaConnect.test.jsx

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
2020-09-30 09:14:48 +02:00

29 lines
623 B
JavaScript

import { h, render } from 'preact';
import ListingForm from '../listings/listingForm';
function loadElement() {
const root = document.getElementById('listingform-data');
if (root) {
const {
listing,
organizations,
categoriesForSelect,
categoriesForDetails,
} = root.dataset;
render(
<ListingForm
organizations={organizations}
listing={listing}
categoriesForSelect={categoriesForSelect}
categoriesForDetails={categoriesForDetails}
/>,
root,
);
}
}
window.InstantClick.on('change', () => {
loadElement();
});
loadElement();