PluginProbe
WP Ultimate Post Grid / 4.0.1
WP Ultimate Post Grid v4.0.1
4.1.1 trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.8 1.9 2.0 2.1 2.2 2.3 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.2 3.0.0 3.3.0 3.4.0 3.5.0 3.6.0 3.7.0 All 32 releases
wp-ultimate-post-grid / assets / js / admin-modal / grid / section / SectionItem.js

SectionItem.js in WP Ultimate Post Grid 4.0.1, at assets/js/admin-modal/grid/section/SectionItem.js

113 lines 4.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import React, { Fragment } from 'react';
2
3 import Field from 'Modal/field';
4 import { __wpupg } from 'Shared/Translations';
5
6 const SectionItem = (props) => {
7 return (
8 <Fragment>
9 <Field
10 value={ props.grid.template }
11 onChange={ ( value ) => {
12 props.onGridChange({
13 template: value,
14 });
15 }}
16 type="dropdown"
17 label={ __wpupg( 'Template' ) }
18 options={ wpupg_admin_manage_modal.templates }
19 />
20 {
21 'terms' === props.grid.type
22 &&
23 <Field
24 value={ props.grid.use_image }
25 onChange={ ( value ) => {
26 props.onGridChange({
27 use_image: value,
28 });
29 }}
30 type="dropdown"
31 label={ __wpupg( 'Image to use' ) }
32 options={[
33 {
34 value: 'default',
35 label: __wpupg( 'Use custom grid image' ),
36 },
37 {
38 value: 'latest_post',
39 label: __wpupg( 'Use featured image of latest post with this term' ),
40 },
41 {
42 value: 'oldest_post',
43 label: __wpupg( 'Use featured image of oldest post with this term' ),
44 },
45 {
46 value: 'random_post',
47 label: __wpupg( 'Use featured image of random post with this term' ),
48 },
49 ]}
50 />
51 }
52 <Field
53 value={ props.grid.link }
54 onChange={ ( value ) => {
55 props.onGridChange({
56 link: value,
57 });
58 }}
59 type="checkbox"
60 label={ __wpupg( 'Link Entire Item' ) }
61 help={ __wpupg( 'Make the full item a link. Other links inside the item will still work as well. When disabled you are responsible for adding a link.' ) }
62 />
63 {
64 props.grid.link
65 &&
66 <Fragment>
67 <Field
68 value={ props.grid.link_type }
69 onChange={ ( value ) => {
70 props.onGridChange({
71 link_type: value,
72 });
73 }}
74 type="dropdown"
75 label={ __wpupg( 'Link To' ) }
76 options={[
77 {
78 value: 'post',
79 label: __wpupg( 'Post' ),
80 },
81 {
82 value: 'image',
83 label: __wpupg( 'Featured Image' ),
84 }
85 ]}
86 />
87 <Field
88 value={ props.grid.link_target }
89 onChange={ ( value ) => {
90 props.onGridChange({
91 link_target: value,
92 });
93 }}
94 type="dropdown"
95 label={ __wpupg( 'Link Target' ) }
96 options={[
97 {
98 value: '_self',
99 label: __wpupg( 'Open in same tab' ),
100 },
101 {
102 value: '_blank',
103 label: __wpupg( 'Open in new tab' ),
104 }
105 ]}
106 />
107 </Fragment>
108 }
109 </Fragment>
110 );
111 }
112 export default SectionItem;
113