-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Add donate button caption to form settings (#6883)
* feature: add donate button setting * feature: include submit button in multistep * refactor: update help messages * chore: include period in sentance * chore: update default Donate now text * refactor: update DonateButton import name to match the other form settings: * fix: use correct import * fix: add prop type to multstep forms
- Loading branch information
1 parent
a06c08d
commit f03c570
Showing
8 changed files
with
51 additions
and
17 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
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
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
23 changes: 23 additions & 0 deletions
23
src/FormBuilder/resources/js/form-builder/src/settings/donate-button/index.tsx
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,23 @@ | ||
import {__} from '@wordpress/i18n'; | ||
import {PanelBody, PanelRow, TextControl} from '@wordpress/components'; | ||
import {setFormSettings, useFormState, useFormStateDispatch} from '@givewp/form-builder/stores/form-state'; | ||
|
||
export default function DonateButton() { | ||
const { | ||
settings: {donateButtonCaption}, | ||
} = useFormState(); | ||
const dispatch = useFormStateDispatch(); | ||
|
||
return ( | ||
<PanelBody title={__('Donate Button', 'give')} initialOpen={false}> | ||
<PanelRow> | ||
<TextControl | ||
label={__('Button caption', 'give')} | ||
help={__('Enter the text you want to display on the donation button.', 'give')} | ||
value={donateButtonCaption} | ||
onChange={(value) => dispatch(setFormSettings({donateButtonCaption: value}))} | ||
/> | ||
</PanelRow> | ||
</PanelBody> | ||
); | ||
} |
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