PluginProbe ʕ •ᴥ•ʔ
Presto Player / 4.3.2
Presto Player v4.3.2
4.3.2 4.3.1 4.3.0 4.2.4 4.2.3 4.2.2 4.2.0 4.2.1 trunk 1.10.0 1.10.1 1.10.2 1.11.0 1.12.0 1.13.0 1.14.0 1.14.1 1.5.10 1.5.11 1.5.12 1.5.13 1.5.14 1.5.15 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.10 1.6.11 1.6.12 1.6.13 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.9.0 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.14 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.15 2.0.16 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.2.0 2.2.1 2.2.2 2.2.3 2.2.3-beta1 2.3.0 2.3.1 2.3.2 2.3.3 3.0.0 3.0.0-beta1 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.1.0 3.1.1 3.1.2 3.1.3 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4
presto-player / src / admin / dashboard / components / PostScheduleField.js
presto-player / src / admin / dashboard / components Last commit date
Emails 1 month ago EngagementChart 2 months ago MediaHub 1 month ago Onboarding 2 months ago Popup 2 months ago Skeletons 1 month ago WhatsNew 2 months ago charts 2 months ago test 2 months ago AdminMenuSync.js 2 months ago ChartEmptyState.js 2 months ago ChooseDate.js 2 months ago ColorPicker.js 2 months ago ExtendPlugins.js 2 months ago Filters.js 2 months ago Link.js 2 months ago Navbar.js 1 month ago NoFound.js 2 months ago PageHeader.js 2 months ago PluginRecommendations.js 2 months ago PostScheduleField.js 2 months ago PrestoPlayerIcon.js 2 months ago ProGateOverlay.js 2 months ago QuickAccess.js 2 months ago RankedTable.js 2 months ago StatCard.js 2 months ago TopMedia.js 2 months ago TopPerformingMedia.js 2 months ago TopUsers.js 2 months ago TruncatedTitle.js 2 months ago UpgradeNotice.js 2 months ago UpgradeToPro.js 2 months ago VideoModal.js 2 months ago WelcomeBanner.js 2 months ago
PostScheduleField.js
93 lines
1 import React from 'react';
2 import { __ } from '@wordpress/i18n';
3 import { Select } from '@bsf/force-ui';
4 import ChooseDate from './ChooseDate';
5 import {
6 SELECT_TIME_OPTIONS,
7 PERIOD_OPTIONS,
8 getOptionLabel,
9 } from './Popup/EmailFormPopupUtils';
10
11 const PostScheduleField = ( {
12 date,
13 time,
14 period,
15 setDate,
16 setTime,
17 setPeriod,
18 } ) => {
19 const timeSelectValue = time
20 ? SELECT_TIME_OPTIONS.find( ( o ) => o.value === time ) || SELECT_TIME_OPTIONS[ 0 ]
21 : SELECT_TIME_OPTIONS[ 0 ];
22
23 return (
24 <div className="flex flex-col gap-2 flex-1 w-full">
25 <span className="text-sm font-medium text-text-secondary whitespace-nowrap">
26 { __( 'Publish Date & Time', 'presto-player' ) }
27 </span>
28 <div className="flex flex-wrap items-center gap-3">
29 <div className="flex-1 min-w-[12rem]">
30 <ChooseDate
31 chosenDate={ date }
32 onPickDate={ ( s ) => {
33 if ( ! s ) return setDate( null );
34 const [ y, m, d ] = s.split( '-' ).map( Number );
35 if ( y && m && d ) setDate( new Date( y, m - 1, d ) );
36 } }
37 placeholder={ __( 'Select date', 'presto-player' ) }
38 size="md"
39 />
40 </div>
41 <span className="text-sm font-medium text-text-secondary whitespace-nowrap">
42 { __( 'at', 'presto-player' ) }
43 </span>
44 <div className="w-32">
45 <Select
46 by="value"
47 value={ timeSelectValue }
48 onChange={ ( o ) => o && setTime( o.value ) }
49 size="md"
50 >
51 <Select.Button
52 placeholder={ __( 'Select time', 'presto-player' ) }
53 render={ ( v ) => v?.label || '' }
54 />
55 <Select.Options>
56 { SELECT_TIME_OPTIONS.map( ( o ) => (
57 <Select.Option
58 key={ o.value || 'none' }
59 value={ { value: o.value, label: o.label } }
60 >
61 { o.label }
62 </Select.Option>
63 ) ) }
64 </Select.Options>
65 </Select>
66 </div>
67 <div className="w-24">
68 <Select
69 by="value"
70 value={ period ?? '-1' }
71 onChange={ ( v ) => setPeriod( String( v ) ) }
72 size="md"
73 >
74 <Select.Button
75 placeholder={ __( 'Select', 'presto-player' ) }
76 render={ ( v ) => getOptionLabel( PERIOD_OPTIONS, v ) }
77 />
78 <Select.Options>
79 { PERIOD_OPTIONS.map( ( o ) => (
80 <Select.Option key={ o.value } value={ o.value }>
81 { o.label }
82 </Select.Option>
83 ) ) }
84 </Select.Options>
85 </Select>
86 </div>
87 </div>
88 </div>
89 );
90 };
91
92 export default PostScheduleField;
93