Skip to content

Commit 71bb573

Browse files
committed
Merge branch 'feature/remove-woocommerce' into develop
2 parents 33ad2cf + a6beb6b commit 71bb573

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+44
-3700
lines changed

private/src/scripts/editor/blocks/hero/DisplayComponent.jsx

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { fetchMediaData } from '../utils';
88
const { InnerBlocks, InspectorControls, RichText, URLInputButton } = wp.blockEditor;
99
const { PanelBody, SelectControl } = wp.components;
1010
const { useEntityRecord } = wp.coreData;
11-
const { useSelect } = wp.data;
1211
const { PostFeaturedImage } = wp.editor;
1312
const { Fragment, useEffect, useRef, useState } = wp.element;
1413
const { __ } = wp.i18n;
@@ -30,24 +29,16 @@ const mediaPanelTitle = (type) => {
3029
return __('Featured Image', 'amnesty');
3130
};
3231

33-
const useHasInnerBlocks = (parentClientId) =>
34-
useSelect((select) => {
35-
const { innerBlocks } = select('core/block-editor').getBlock(parentClientId);
36-
return innerBlocks.length;
37-
});
38-
3932
const DisplayComponent = (props) => {
4033
const {
4134
attributes,
4235
className,
43-
clientId,
4436
context: { postId, postType },
4537
setAttributes,
4638
} = props;
4739

4840
const [mediaData, setMediaData] = useState({});
4941
const videoRef = useRef();
50-
const hasInnerBlocks = useHasInnerBlocks(clientId);
5142
const object = useEntityRecord('postType', postType, postId);
5243

5344
useEffect(() => {
@@ -74,7 +65,6 @@ const DisplayComponent = (props) => {
7465
const blockClasses = classnames(className, {
7566
[`has-${attributes.background}-background`]: attributes.background,
7667
[`is-aligned-${attributes.align}`]: !!attributes.align,
77-
'has-inner-blocks': hasInnerBlocks,
7868
'has-video': !!attributes.featuredVideoId,
7969
});
8070

@@ -144,43 +134,43 @@ const DisplayComponent = (props) => {
144134
</video>
145135
</div>
146136
)}
147-
<div className="hero-contentWrapper">
148-
<h1 className="hero-title">
149-
<RichText
150-
tagName="span"
151-
placeholder={/* translators: [admin] */ __('Hero Title', 'amnesty')}
152-
value={attributes.title}
153-
onChange={(title) => setAttributes({ title })}
154-
format="string"
155-
/>
156-
</h1>
157-
<RichText
158-
tagName="p"
159-
className="hero-content"
160-
placeholder={/* translators: [admin] */ __('Hero Content', 'amnesty')}
161-
value={attributes.content}
162-
onChange={(content) => setAttributes({ content })}
163-
format="string"
164-
/>
165-
<div className="hero-cta">
166-
<div className="btn btn--large">
137+
<div className="container">
138+
<div className="hero-contentWrapper">
139+
<h1 className="hero-title">
167140
<RichText
168141
tagName="span"
169-
placeholder={/* translators: [admin] */ __('Call to action', 'amnesty')}
170-
value={attributes.ctaText}
171-
onChange={(ctaText) => setAttributes({ ctaText })}
142+
placeholder={/* translators: [admin] */ __('Hero Title', 'amnesty')}
143+
value={attributes.title}
144+
onChange={(title) => setAttributes({ title })}
172145
format="string"
173146
/>
174-
<URLInputButton
175-
url={attributes.ctaLink}
176-
onChange={(ctaLink) => setAttributes({ ctaLink })}
177-
/>
147+
</h1>
148+
<RichText
149+
tagName="p"
150+
className="hero-content"
151+
placeholder={/* translators: [admin] */ __('Hero Content', 'amnesty')}
152+
value={attributes.content}
153+
onChange={(content) => setAttributes({ content })}
154+
format="string"
155+
/>
156+
<div className="hero-cta">
157+
<div className="btn btn--large">
158+
<RichText
159+
tagName="span"
160+
placeholder={/* translators: [admin] */ __('Call to action', 'amnesty')}
161+
value={attributes.ctaText}
162+
onChange={(ctaText) => setAttributes({ ctaText })}
163+
format="string"
164+
/>
165+
<URLInputButton
166+
url={attributes.ctaLink}
167+
onChange={(ctaLink) => setAttributes({ ctaLink })}
168+
/>
169+
</div>
178170
</div>
171+
<InnerBlocks orientation="horizontal" />
179172
</div>
180173
</div>
181-
<div className="hero-innerBlocks">
182-
<InnerBlocks allowedBlocks={['amnesty-wc/donation']} orientation="horizontal" />
183-
</div>
184174
<MediaMetadata
185175
media={mediaData}
186176
showMediaCaption={showMediaCaption}

private/src/styles/blocks/header/_main.scss

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,6 @@
201201
line-height: 1.6;
202202
}
203203

204-
.page-heroAlignment--center .container .hero-content.has-donation-block {
205-
align-items: center;
206-
207-
@include mq("md-small") {
208-
align-items: flex-start;
209-
}
210-
}
211-
212204
.page-heroAlignment--center .container .hero-content .page-heroTitle {
213205
text-align: center;
214206
}
@@ -229,14 +221,6 @@
229221
}
230222
}
231223

232-
.page-heroAlignment--center .container .hero-content.has-donation-block .page-heroTitle {
233-
text-align: center;
234-
235-
@include mq("md-small") {
236-
text-align: left;
237-
}
238-
}
239-
240224
.page-hero .image-metadata.is-image {
241225
display: flex;
242226
}

private/src/styles/components/form/_input-editor.scss

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,23 @@ label.components-toggle-control__label {
1515
font-weight: normal;
1616
}
1717

18-
.postbox input[type="radio"]:checked::before {
19-
display: none;
18+
input[type="radio"].components-radio-control__input:checked::after {
19+
content: '';
20+
}
21+
22+
input[type="checkbox"].components-checkbox-control__input:checked::after {
23+
content: '';
2024
}
2125

2226
.components-base-control.wp-block-post-title textarea.components-textarea-control__input {
2327
font-family: var(--wp--preset--font-family--secondary);
2428
}
2529

30+
.components-text-control__input {
31+
text-transform: none;
32+
font-weight: normal;
33+
}
34+
2635
.media-modal label,
2736
.media-modal input,
2837
.media-modal optgroup,

private/src/styles/components/form/_input.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ label,
22
input,
33
optgroup,
44
select,
5-
textarea {
5+
textarea,
6+
.checkboxGroup-label {
67
font-family: var(--wp--preset--font-family--secondary);
78
font-size: var(--wp--preset--font-size--small);
89
text-transform: uppercase;

private/src/styles/layout/_page-hero-editor.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,3 @@ p.page-heroContent {
184184
display: flex;
185185
align-items: center;
186186
}
187-
188-
.page-heroAlignment--center .has-donation-block .page-heroContent {
189-
margin: 0;
190-
}
191-
192-
.page-heroAlignment--center .hero-content.has-donation-block {
193-
text-align: left;
194-
}

wp-content/themes/humanity-theme/functions.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -255,29 +255,6 @@
255255
require_once realpath( __DIR__ . '/includes/users/meta.php' );
256256
#endregion users
257257

258-
/**
259-
* Theme WooCommerce includes
260-
*/
261-
#region woocommerce
262-
if ( class_exists( '\WooCommerce', false ) ) {
263-
// disable WooCommerce block templates -- it breaks lots of things in hybrid
264-
add_filter( 'woocommerce_has_block_template', '__return_false', 999 );
265-
266-
require_once realpath( __DIR__ . '/includes/admin/woo/theme-options.php' );
267-
268-
require_once realpath( __DIR__ . '/includes/woo/helpers.php' );
269-
require_once realpath( __DIR__ . '/includes/woo/cart.php' );
270-
require_once realpath( __DIR__ . '/includes/woo/checkout.php' );
271-
require_once realpath( __DIR__ . '/includes/woo/emails.php' );
272-
require_once realpath( __DIR__ . '/includes/woo/form-fields.php' );
273-
require_once realpath( __DIR__ . '/includes/woo/menus.php' );
274-
require_once realpath( __DIR__ . '/includes/woo/order.php' );
275-
require_once realpath( __DIR__ . '/includes/woo/product.php' );
276-
require_once realpath( __DIR__ . '/includes/woo/select-element.php' );
277-
require_once realpath( __DIR__ . '/includes/woo/templates.php' );
278-
}
279-
#endregion woocommerce
280-
281258
/**
282259
* Theme MultilingualPress includes
283260
*/

wp-content/themes/humanity-theme/includes/blocks/_deprecated/header/class-header-block-renderer.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,7 @@ protected function video() {
223223
* @return void
224224
*/
225225
protected function inner_open() {
226-
$classes = 'hero-content';
227-
228-
if ( $this->content ) {
229-
$classes .= ' has-donation-block';
230-
}
231-
232-
printf( '<div class="container"><div class="%s">', esc_attr( $classes ) );
226+
printf( '<div class="container"><div class="hero-content">', esc_attr( $classes ) );
233227
}
234228

235229
/**

wp-content/themes/humanity-theme/includes/theme-setup/supports.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ function amnesty_theme_support() {
2424
add_theme_support( 'disable-custom-font-sizes' );
2525

2626
add_theme_support( 'block-template-parts' );
27-
28-
if ( class_exists( 'WooCommerce', false ) ) {
29-
add_theme_support( 'woocommerce' );
30-
add_theme_support( 'wc-product-gallery-lightbox' );
31-
add_theme_support( 'wc-product-gallery-slider' );
32-
}
3327
}
3428
}
3529

wp-content/themes/humanity-theme/includes/woo/cart.php

Lines changed: 0 additions & 110 deletions
This file was deleted.

0 commit comments

Comments
 (0)