props.controller.setLayout('modal', { title: 'Create Event', back: true, }); const EVENTS_CONTRACT = 'events_v1.near'; const APP_OWNER = 'events_v1.near'; const APP_NAME = 'events'; const TGAS_300 = '300000000000000'; const ONE_NEAR = '1000000000000000000000000'; function createEvent(data) { const { name, type, category, status, start_date, end_date, location, images, links, description, } = data; const eventData = { account_id: props.__engine.accountId, name, type, category, status, start_date, end_date, location, images, links, description, }; const cost = props.__engine.helpers.calculateStorageCost(eventData); Near.call(EVENTS_CONTRACT, 'create_event', eventData, TGAS_300, cost); } function onSave(data) { createEvent(data); } return ( <div> <Widget src={`${APP_OWNER}/widget/${APP_NAME}___form`} props={{ onSave, buttonText: 'Create event', }} /> </div> );