-
Notifications
You must be signed in to change notification settings - Fork 809
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Subscription block] Add social followers toggle (#27443)
- Loading branch information
1 parent
a5d6e79
commit 4415d93
Showing
27 changed files
with
370 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
projects/plugins/jetpack/changelog/add-subscription-block-social-toggle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: enhancement | ||
|
||
Add a checkbox to include/exclude social followers from subscription block. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
projects/plugins/jetpack/extensions/blocks/subscriptions/deprecated/v8/attributes.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { __ } from '@wordpress/i18n'; | ||
|
||
export default { | ||
subscribePlaceholder: { | ||
type: 'string', | ||
default: __( 'Type your email…', 'jetpack' ), | ||
}, | ||
showSubscribersTotal: { | ||
type: 'boolean', | ||
default: false, | ||
}, | ||
buttonOnNewLine: { | ||
type: 'boolean', | ||
default: false, | ||
}, | ||
buttonWidth: { | ||
type: 'string', | ||
}, | ||
submitButtonText: { | ||
type: 'string', | ||
default: __( 'Subscribe', 'jetpack' ), | ||
}, | ||
emailFieldBackgroundColor: { | ||
type: 'string', | ||
}, | ||
customEmailFieldBackgroundColor: { | ||
type: 'string', | ||
}, | ||
emailFieldGradient: { | ||
type: 'string', | ||
}, | ||
customEmailFieldGradient: { | ||
type: 'string', | ||
}, | ||
buttonBackgroundColor: { | ||
type: 'string', | ||
}, | ||
customButtonBackgroundColor: { | ||
type: 'string', | ||
}, | ||
buttonGradient: { | ||
type: 'string', | ||
}, | ||
customButtonGradient: { | ||
type: 'string', | ||
}, | ||
textColor: { | ||
type: 'string', | ||
}, | ||
customTextColor: { | ||
type: 'string', | ||
}, | ||
fontSize: { | ||
type: 'string', | ||
}, | ||
customFontSize: { | ||
type: 'string', | ||
}, | ||
borderRadius: { | ||
type: 'number', | ||
}, | ||
borderWeight: { | ||
type: 'number', | ||
}, | ||
borderColor: { | ||
type: 'string', | ||
}, | ||
customBorderColor: { | ||
type: 'string', | ||
}, | ||
padding: { | ||
type: 'number', | ||
}, | ||
spacing: { | ||
type: 'number', | ||
}, | ||
successMessage: { | ||
type: 'string', | ||
default: __( | ||
"Success! An email was just sent to confirm your subscription. Please find the email now and click 'Confirm Follow' to start subscribing.", | ||
'jetpack' | ||
), | ||
}, | ||
}; |
18 changes: 18 additions & 0 deletions
18
projects/plugins/jetpack/extensions/blocks/subscriptions/deprecated/v8/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import definedAttributes from './attributes'; | ||
import save from './save'; | ||
|
||
/** | ||
* Deprecation reason | ||
* | ||
* Added new block attribute `successMessage`, which was already available to the shortcode. | ||
*/ | ||
export default { | ||
attributes: definedAttributes, | ||
migrate: oldAttributes => { | ||
return { | ||
includeSocialFollowers: true, | ||
...oldAttributes, | ||
}; | ||
}, | ||
save, | ||
}; |
15 changes: 15 additions & 0 deletions
15
projects/plugins/jetpack/extensions/blocks/subscriptions/deprecated/v8/save.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import classnames from 'classnames'; | ||
|
||
export default function Save( { className, attributes } ) { | ||
const { showSubscribersTotal, buttonOnNewLine } = attributes; | ||
|
||
const getBlockClassName = () => { | ||
return classnames( | ||
className, | ||
'wp-block-jetpack-subscriptions__supports-newline', | ||
buttonOnNewLine ? 'wp-block-jetpack-subscriptions__use-newline' : undefined, | ||
showSubscribersTotal ? 'wp-block-jetpack-subscriptions__show-subs' : undefined | ||
); | ||
}; | ||
return <div className={ getBlockClassName() }></div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.