File tree Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,16 @@ const requestNewData = async () => {
35
35
return syncDataFromUserBenefitsApi ( authStatus ) . then ( persistResponse ) ;
36
36
} ;
37
37
38
+ /**
39
+ * Persist the user benefits response to cookies
40
+ *
41
+ * If new cookies are added/removed/edited, update the persistUserBenefitsCookie function in Gateway
42
+ * https://github.com/guardian/gateway/blob/252b2b2f24be826da42c6e7c1b1e202594184023/src/server/lib/user-features.ts#L88
43
+ *
44
+ * In gateway, the cookies are set after authentication.
45
+ *
46
+ * @param {UserBenefits } userBenefitsResponse
47
+ */
38
48
const persistResponse = ( userBenefitsResponse : UserBenefits ) => {
39
49
createOrRenewCookie ( USER_BENEFITS_EXPIRY_COOKIE ) ;
40
50
if ( userBenefitsResponse . hideSupportMessaging ) {
Original file line number Diff line number Diff line change @@ -452,6 +452,7 @@ const DesignableBannerV2: ReactComponent<BannerRenderProps> = ({
452
452
isTabletOrAbove ,
453
453
countryCode ,
454
454
) }
455
+ id = { 'banner' }
455
456
/>
456
457
457
458
< div css = { styles . ctaContainer } >
Original file line number Diff line number Diff line change @@ -183,6 +183,7 @@ type ThreeTierChoiceCardsProps = {
183
183
countryCode ?: string ;
184
184
choices : ChoiceInfo [ ] ;
185
185
supporterPlusDiscount ?: number ;
186
+ id : string ; // uniquely identify this choice cards component to avoid conflicting with others
186
187
} ;
187
188
188
189
export const ThreeTierChoiceCards = ( {
@@ -191,6 +192,7 @@ export const ThreeTierChoiceCards = ({
191
192
setSelectedProduct,
192
193
choices,
193
194
supporterPlusDiscount,
195
+ id,
194
196
} : ThreeTierChoiceCardsProps ) => {
195
197
const currencySymbol = getLocalCurrencySymbol ( countryCode ) ;
196
198
const countryGroupId = countryCodeToCountryGroupId ( countryCode ) ;
@@ -221,7 +223,7 @@ export const ThreeTierChoiceCards = ({
221
223
! isUndefined ( supporterPlusDiscount ) &&
222
224
supportTier === 'SupporterPlus' ;
223
225
224
- const radioId = `choicecard-${ supportTier } ` ;
226
+ const radioId = `choicecard-${ id } - ${ supportTier } ` ;
225
227
226
228
return (
227
229
< div
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ export const ContributionsEpicCtasContainer: ReactComponent<Props> = ({
67
67
supporterPlusDiscount = {
68
68
hasSupporterPlusPromoCode ? 0.5 : undefined
69
69
}
70
+ id = { 'epic' }
70
71
/>
71
72
) }
72
73
< ContributionsEpicButtons
You can’t perform that action at this time.
0 commit comments