PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.2.0
GiveWP – Donation Plugin and Fundraising Platform v4.2.0
4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 All 253 releases
give / src / EventTickets / resources / blocks / EventTicketsBlock / Edit / BlockPlaceholderSelectEvent.tsx
BlockPlaceholderSelectEvent.tsx
28 lines 953 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import {__} from '@wordpress/i18n';
2 import {SelectControl} from '@wordpress/components';
3
4 /**
5 * @since 3.6.0
6 */
7 export default function BlockPlaceholderSelectEvent({attributes, setAttributes}) {
8 const {events} = window.eventTicketsBlockSettings;
9 const eventOptions =
10 events.map((event) => {
11 return {label: event.title, value: `${event.id}`};
12 }) ?? [];
13
14 return (
15 <div className={'givewp-event-tickets-block__placeholder--select-event'}>
16 <p>
17 <strong>{__('No event selected yet', 'give')}</strong>
18 </p>
19 <SelectControl
20 label={__('Select your preferred event for this donation form', 'give')}
21 value={`${attributes.eventId}`}
22 options={[{label: 'Select', value: ''}, ...eventOptions]}
23 onChange={(value: string) => setAttributes({eventId: Number(value)})}
24 />
25 </div>
26 );
27 }
28