Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kjohnson committed Nov 8, 2024
1 parent 0bea8ff commit f50c964
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ declare const window: {
*/
const DefaultFormWidget = () => {

const {watch,} = useFormContext();
const {watch} = useFormContext();

const [defaultFormId] = watch(['defaultFormId']);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ declare const window: {
* @unreleased
*/
export default () => {

const {donationForms} = window.GiveCampaignDetails

const {
register,
watch,
Expand Down Expand Up @@ -138,7 +141,7 @@ export default () => {
</div>

{/* DEFAULT CAMPAIGN FORM SETTINGS */}
{ window.GiveCampaignDetails.donationForms.length > 1 && (
{ donationForms.length > 1 && (
<div className={styles.section}>
<div className={styles.leftColumn}>
<div className={styles.sectionTitle}>{__('Default campaign form', 'give')}</div>
Expand All @@ -152,12 +155,7 @@ export default () => {
className={styles.sectionSubtitle}>{__('Select your default campaign form', 'give')}</div>

<select {...register('defaultFormId', {valueAsNumber: true})} disabled={isDisabled}>
{window.GiveCampaignDetails.donationForms && (
<>
{window.GiveCampaignDetails.donationForms.map(({id, title}) =><option key={id}
value={id}>{title}</option>)}
</>
)}
{donationForms.map(({id, title}) => <option key={id} value={id}>{title}</option>)}
</select>

{errors.defaultForm &&
Expand Down

0 comments on commit f50c964

Please sign in to comment.