PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.18.0.1
GiveWP – Donation Plugin and Fundraising Platform v4.18.0.1
4.18.0.1 4.18.0 4.17.0 4.16.9 4.16.8.1 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 All 258 releases
give / src / EventTickets / resources / templates / EventTickets / index.tsx

index.tsx in GiveWP – Donation Plugin and Fundraising Platform 4.18.0.1, at src/EventTickets/resources/templates/EventTickets/index.tsx

34 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import EventTicketsHeader from '../../components/EventTicketsHeader';
2 import EventTicketsDescription from '../../components/EventTicketsDescription';
3 import EventTicketsListHOC from './EventTicketsListHOC';
4 import {Event} from '../../components/types';
5
6 import './styles.scss';
7
8 /**
9 * @since 3.20.0 Hide tickets once the event has ended.
10 * @since 3.6.0
11 */
12 export default function EventTicketsField({
13 name,
14 title,
15 description,
16 startDateTime,
17 endDateTime,
18 ticketTypes,
19 }: Event) {
20 const startDateTimeObj = new Date(startDateTime);
21 const endDateTimeObj = new Date(endDateTime);
22 const hasEnded = endDateTimeObj < new Date();
23
24 return (
25 <div className={'givewp-event-tickets'}>
26 <EventTicketsHeader title={title} startDateTime={startDateTimeObj} endDateTime={endDateTimeObj} />
27
28 {description && <EventTicketsDescription description={description} />}
29
30 {!hasEnded && <EventTicketsListHOC name={name} ticketTypes={ticketTypes} />}
31 </div>
32 );
33 }
34