Skip to content

Commit 7bbdc0f

Browse files
authored
Merge pull request #145 from Resgrid/develop
CU-868f1731u Adding badge back in, trying to fix ios interaction issue.
2 parents 1431baa + ca17006 commit 7bbdc0f

File tree

5 files changed

+578
-15
lines changed

5 files changed

+578
-15
lines changed

app.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
11
/* eslint-disable max-lines-per-function */
22
import type { ConfigContext, ExpoConfig } from '@expo/config';
3+
import type { AppIconBadgeConfig } from 'app-icon-badge/types';
34

45
import { ClientEnv, Env } from './env';
56
const packageJSON = require('./package.json');
67

8+
const appIconBadgeConfig: AppIconBadgeConfig = {
9+
enabled: Env.APP_ENV !== 'production',
10+
badges: [
11+
{
12+
text: Env.APP_ENV,
13+
type: 'banner',
14+
color: 'white',
15+
},
16+
{
17+
text: Env.VERSION.toString(),
18+
type: 'ribbon',
19+
color: 'white',
20+
},
21+
],
22+
};
23+
724
export default ({ config }: ConfigContext): ExpoConfig => ({
825
...config,
926
name: Env.NAME,
@@ -238,6 +255,7 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
238255
'@config-plugins/react-native-webrtc',
239256
'./customGradle.plugin.js',
240257
'./customManifest.plugin.js',
258+
['app-icon-badge', appIconBadgeConfig],
241259
],
242260
extra: {
243261
...ClientEnv,

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
"@sentry/react-native": "~6.10.0",
9595
"@shopify/flash-list": "1.7.3",
9696
"@tanstack/react-query": "~5.52.1",
97+
"app-icon-badge": "^0.1.2",
9798
"axios": "~1.7.5",
9899
"babel-plugin-module-resolver": "^5.0.2",
99100
"buffer": "^6.0.3",

src/app/(app)/__tests__/_layout.test.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,22 @@ describe('TabLayout Configuration', () => {
99
const expectedTabBarStyle = {
1010
paddingBottom: 5,
1111
paddingTop: 5,
12-
height: 60, // Default height for portrait mode
12+
height: 60,
1313
elevation: 8, // Ensures tab bar is above other elements on Android
14-
zIndex: 100, // Ensures tab bar is above other elements on iOS
14+
zIndex: 10, // Ensures tab bar is above other elements on iOS
15+
backgroundColor: undefined, // Let the tab bar use its default background
1516
};
1617

1718
const expectedLandscapeTabBarStyle = {
1819
paddingBottom: 5,
1920
paddingTop: 5,
2021
height: 65, // Height for landscape mode
2122
elevation: 8,
22-
zIndex: 100,
23+
zIndex: 10,
2324
};
2425

2526
// Verify that the configuration object has the required properties
26-
expect(expectedTabBarStyle.zIndex).toBe(100);
27+
expect(expectedTabBarStyle.zIndex).toBe(10);
2728
expect(expectedTabBarStyle.elevation).toBe(8);
2829
expect(expectedLandscapeTabBarStyle.height).toBe(65);
2930
expect(expectedTabBarStyle.height).toBe(60);
@@ -52,7 +53,7 @@ describe('TabLayout Configuration', () => {
5253
// Tab bar should have z-index 100
5354
// NotificationInbox should have lower z-index (999-1000) to not interfere
5455

55-
const tabBarZIndex = 100;
56+
const tabBarZIndex = 10;
5657
const notificationBackdropZIndex = 999;
5758
const notificationSidebarZIndex = 1000;
5859

src/app/(app)/_layout.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { size } from 'lodash';
66
import { Contact, ListTree, Map, Megaphone, Menu, Notebook, Settings } from 'lucide-react-native';
77
import React, { useCallback, useEffect, useRef } from 'react';
88
import { useTranslation } from 'react-i18next';
9-
import { StyleSheet, useWindowDimensions } from 'react-native';
9+
import { Platform, StyleSheet, useWindowDimensions } from 'react-native';
1010

1111
import { NotificationButton } from '@/components/notifications/NotificationButton';
1212
import { NotificationInbox } from '@/components/notifications/NotificationInbox';
@@ -224,7 +224,7 @@ export default function TabLayout() {
224224
}
225225

226226
const content = (
227-
<View style={styles.container} pointerEvents="box-none">
227+
<View style={styles.container} pointerEvents="auto">
228228
<View className="flex-1 flex-row" ref={parentRef}>
229229
{/* Drawer - conditionally rendered as permanent in landscape */}
230230
{isLandscape ? (
@@ -266,8 +266,8 @@ export default function TabLayout() {
266266
paddingTop: 5,
267267
height: isLandscape ? 65 : 60,
268268
elevation: 8, // Ensure tab bar is above other elements on Android
269-
zIndex: 100, // Ensure tab bar is above other elements on iOS
270-
backgroundColor: 'transparent', // Ensure proper touch event handling
269+
zIndex: 10, // Reduced z-index to prevent stacking issues
270+
backgroundColor: undefined, // Let the tab bar use its default background
271271
},
272272
}}
273273
>
@@ -406,5 +406,7 @@ const styles = StyleSheet.create({
406406
flex: 1,
407407
width: '100%',
408408
height: '100%',
409+
// Ensure proper touch event handling in iOS production builds
410+
...(Platform.OS === 'ios' && { overflow: 'hidden' }),
409411
},
410412
});

0 commit comments

Comments
 (0)