Skip to content

Commit dd43d97

Browse files
fix(client): update 25 tier ab test (freeCodeCamp#62553)
Co-authored-by: Huyen Nguyen <[email protected]>
1 parent d282d0a commit dd43d97

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

client/src/components/Donation/multi-tier-donation-form.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function SelectionTabs({
8383
<Spacer size='xs' />
8484
<Tabs
8585
className={'donate-btn-group'}
86-
defaultValue={donationAmount.toString()}
86+
value={donationAmount.toString()}
8787
onValueChange={switchTab}
8888
>
8989
<TabsList className='nav-lists'>
@@ -182,6 +182,10 @@ const MultiTierDonationForm: React.FC<MultiTierDonationFormProps> = ({
182182

183183
const [showDonateForm, setShowDonateForm] = useState(false);
184184

185+
useEffect(() => {
186+
setDonationAmount(replace20With25 ? defaultTierAmountB : defaultTierAmount);
187+
}, [replace20With25]);
188+
185189
useEffect(() => {
186190
if (setShowHeaderAndFooter) setShowHeaderAndFooter(!showDonateForm);
187191
}, [showDonateForm, setShowHeaderAndFooter]);

0 commit comments

Comments
 (0)