props.__layout.setLayout('modal', { title: 'Create Event', }); 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, image, links, description, } = data; const event = Near.call( EVENTS_CONTRACT, 'create_event', { account_id: props.__engine.accountId, name, type, category, status, start_date, end_date, location, image, links, description, }, TGAS_300, ONE_NEAR ); console.log('event', { event }); } function onSave(data) { createEvent(data); } return ( <div> <Widget src={`${APP_OWNER}/widget/${APP_NAME}___form`} props={{ onSave, buttonText: 'Create event', }} /> </div> );