Skip to content

Commit 85f32b1

Browse files
sookburtsookburttomrf1
authored
Two step dismissible banner (#14312)
* add buttons * toggle icon, toggle layout css, toggle close button * adds css ready for grid layout changes * pass abtest through to component, use to alter style * pass through abtest and use to show hide benefits * move button, try layout change for collapsed * fix isInTest prop type * fix style lint issues * prettier fix * handle hide pill on choice card * use mobile copy for collapsed banner * tidy logic * adds todo item reminder * show only selected choice in collapsed state * reduce complexity around passed booleans * reduce complexity around passed booleans * reduce complexity around passed booleans * ensure using specific test, variant combo when applying dismissible changes * wip: working on layout around close button * close button layout fixes, change to LinkButton, surprising overrides required * revert ThreeTierChoiceCards and hide if inABTest and isCollapsed * revert body copy check and hide body copy on collapse * tweaks to get phablet layout fixed * style lint does not like tabs in grid-template-areas * add margin-bottom to headline if collapsed * ensure consistent tabs in grid-template-areas - useful to see layout more easily * fix phablet to desktop layout * ensure cta is level with headline, vert line, logo when collapsed * ensure close button on left till phablet * remove unnecessary style * Update variant name * add story * tidy * unnecessary fragment * rename isInABTest * Add tracking * position tweaks * margin at desktop only * improve tablet and tidy * remove unused code * === * includes variant name * Fix heading font size * Use cta copy from tool if collapsed --------- Co-authored-by: sookburt <“[email protected]”> Co-authored-by: Tom Forbes <[email protected]>
1 parent 666945d commit 85f32b1

File tree

7 files changed

+332
-61
lines changed

7 files changed

+332
-61
lines changed

dotcom-rendering/src/components/marketing/banners/common/BannerWrapper.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ function getComponentIds(bannerId: BannerId) {
4949
reminderCta: `${bannerId} : reminder-cta`,
5050
reminderSet: `${bannerId} : reminder-set`,
5151
reminderClose: `${bannerId} : reminder-close`,
52+
collapse: `${bannerId} : collapse`,
53+
expand: `${bannerId} : expand`,
5254
};
5355
}
5456

@@ -298,6 +300,8 @@ const withBannerData =
298300
const onCloseClick = clickHandlerFor(componentIds.close, true);
299301
const onNotNowClick = clickHandlerFor(componentIds.notNow, true);
300302
const onSignInClick = clickHandlerFor(componentIds.signIn, false);
303+
const onCollapseClick = clickHandlerFor(componentIds.collapse, false);
304+
const onExpandClick = clickHandlerFor(componentIds.expand, false);
301305

302306
try {
303307
const renderedContent = content && buildRenderedContent(content);
@@ -316,6 +320,8 @@ const withBannerData =
316320
onCloseClick,
317321
onSignInClick,
318322
onNotNowClick,
323+
onCollapseClick,
324+
onExpandClick,
319325
content: {
320326
mainContent: renderedContent,
321327
mobileContent: renderedMobileContent ?? renderedContent,

dotcom-rendering/src/components/marketing/banners/common/types.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export interface BannerRenderProps {
6363
onNotNowClick: () => void;
6464
onCloseClick: () => void;
6565
onSignInClick?: () => void;
66+
onCollapseClick: () => void;
67+
onExpandClick: () => void;
6668
reminderTracking: ContributionsReminderTracking;
6769
content: BannerTextContent;
6870
countryCode?: string;

0 commit comments

Comments
 (0)