File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed
includes/blocks/mailchimp Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,33 @@ import { useBlockProps } from '@wordpress/block-editor';
2
2
import { __ } from '@wordpress/i18n' ;
3
3
import { Placeholder , Button , Disabled } from '@wordpress/components' ;
4
4
import ServerSideRender from '@wordpress/server-side-render' ;
5
+ import { useSelect } from '@wordpress/data' ;
5
6
import Icon from './icon' ;
6
7
8
+ const disallowedThemesSSR = [
9
+ 'twentytwentyone' ,
10
+ 'twentytwenty' ,
11
+ 'twentynineteen' ,
12
+ 'twentyeighteen' ,
13
+ 'twentyseventeen' ,
14
+ 'twentysixteen' ,
15
+ 'twentyfifteen' ,
16
+ 'twentyfourteen' ,
17
+ ] ;
18
+
7
19
export const BlockEdit = ( { isSelected } ) => {
8
20
const blockProps = useBlockProps ( ) ;
21
+ const isDisallowedThemeSSR = useSelect ( ( select ) => {
22
+ const currentTheme = select ( 'core' ) . getCurrentTheme ( ) ;
23
+ if ( ! currentTheme || ( ! 'template' ) in currentTheme ) {
24
+ return false ;
25
+ }
26
+ return disallowedThemesSSR . includes ( currentTheme . template ) ;
27
+ } ) ;
9
28
10
29
return (
11
30
< div { ...blockProps } >
12
- { isSelected ? (
31
+ { isSelected || isDisallowedThemeSSR ? (
13
32
< Placeholder
14
33
icon = { Icon }
15
34
label = { __ ( 'Mailchimp Block' , 'mailchimp_i18n' ) }
Original file line number Diff line number Diff line change @@ -86,13 +86,15 @@ function mailchimp_sf_signup_form( $args = array() ) {
86
86
-moz-box-sizing: border-box;
87
87
-webkit-box-sizing: border-box;
88
88
box-sizing: border-box;
89
+ padding: 10px 8px;
89
90
width: 100%;
90
91
}
91
92
.mc_input.mc_phone {
92
93
width: auto;
93
94
}
94
95
select.mc_select {
95
96
margin-top: 0.5em;
97
+ padding: 10px 8px;
96
98
width: 100%;
97
99
}
98
100
.mc_address_label {
@@ -101,6 +103,7 @@ function mailchimp_sf_signup_form( $args = array() ) {
101
103
display: block;
102
104
}
103
105
.mc_address_label ~ select {
106
+ padding: 10px 8px;
104
107
width: 100%;
105
108
}
106
109
.mc_list li {
@@ -117,6 +120,7 @@ function mailchimp_sf_signup_form( $args = array() ) {
117
120
}
118
121
#mc_signup_submit {
119
122
margin-top: 1.5em;
123
+ padding: 10px 8px;
120
124
width: 80%;
121
125
}
122
126
#mc_unsub_link a {
Original file line number Diff line number Diff line change 71
71
}
72
72
ul.mc_list {
73
73
list-style-type: none;
74
+ margin-left: 0;
75
+ padding-left: 0;
74
76
}
75
77
ul.mc_list li {
76
78
font-size: 12px;
81
83
#ui-datepicker-div.show .ui-datepicker-year {
82
84
display: inline;
83
85
padding-left: 3px
84
- }
86
+ }
You can’t perform that action at this time.
0 commit comments