Skip to content

Commit

Permalink
fix: [PE-959,PE-960,PE-961,PE-962] Remove transparent header in CGN (
Browse files Browse the repository at this point in the history
…#6709)

## Short description
This pull request enhances the accessibility of the header in the `CGN`.
The implementation follows the same approach used in PR
#6675


## List of changes proposed in this pull request
- Replace the `transparent` prop with `backgroundColor` 
- Removed the redundant `discountColor` variable and used the new
`backgroundColor` variable directly in the component

## How to test
- Using a real device 📱, go in each of these screens:
`CGN_CATEGORIES`/`CGN_MERCHANTS_LIST_BY_CATEGORY`/`CGN_MERCHANTS_DETAIL`/`CGN_MERCHANTS_DISCOUNT_SCREEN`
- Turn on the TalkBack accessibility tool
- Ensure the header action are now reachable

---------

Co-authored-by: Alessandro <[email protected]>
  • Loading branch information
LeleDallas and Hantex9 authored Feb 14, 2025
1 parent 6099525 commit 84a1f99
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,17 @@ const CgnDiscountDetailScreen = () => {
}
};

const { backgroundColor } = discountDetails?.isNew
? styles.backgroundNewItem
: styles.backgroundDefault;

useHeaderSecondLevel({
title: discountDetails?.name || "",
scrollValues: {
contentOffsetY: translationY,
triggerOffset: titleHeight
},
transparent: true,
backgroundColor,
canGoBack: true,
supportRequest: true
});
Expand Down Expand Up @@ -249,10 +253,6 @@ const CgnDiscountDetailScreen = () => {
);
};

const discountColor = discountDetails?.isNew
? styles.backgroundNewItem
: styles.backgroundDefault;

if (discountDetails && merchantDetails) {
return (
<>
Expand All @@ -272,7 +272,7 @@ const CgnDiscountDetailScreen = () => {
style={{
position: "absolute",
height: 1000,
backgroundColor: discountColor.backgroundColor,
backgroundColor,
top: -1000,
right: 0,
left: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const CgnMerchantsListByCategory = () => {
contentOffsetY: translationY,
triggerOffset: titleHeight
},
transparent: true,
backgroundColor: categorySpecs?.colors,
supportRequest: true,
secondAction: {
icon: "search",
Expand Down Expand Up @@ -195,14 +195,12 @@ const CgnMerchantsListByCategory = () => {
style={[
IOStyles.horizontalContentPadding,
{
paddingTop: insets.top,
backgroundColor: categorySpecs.colors,
paddingBottom: 24
}
]}
>
<VSpacer size={48} />
<VSpacer size={32} />
<VSpacer size={24} />
<View style={[IOStyles.row, { alignItems: "center" }]}>
<View
style={{
Expand Down

0 comments on commit 84a1f99

Please sign in to comment.