@planningcenter/chat-react-native 3.7.0-rc.7 → 3.7.0-rc.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/build/components/primitive/form_sheet.d.ts +41 -0
  2. package/build/components/primitive/form_sheet.d.ts.map +1 -0
  3. package/build/components/primitive/{actions_form_sheet.js → form_sheet.js} +43 -24
  4. package/build/components/primitive/form_sheet.js.map +1 -0
  5. package/build/navigation/index.d.ts +1 -72
  6. package/build/navigation/index.d.ts.map +1 -1
  7. package/build/navigation/index.js +1 -4
  8. package/build/navigation/index.js.map +1 -1
  9. package/build/screens/attachment_actions/attachment_actions_screen.d.ts.map +1 -1
  10. package/build/screens/attachment_actions/attachment_actions_screen.js +8 -6
  11. package/build/screens/attachment_actions/attachment_actions_screen.js.map +1 -1
  12. package/build/screens/conversation/message_read_receipts_screen.d.ts +1 -1
  13. package/build/screens/conversation/message_read_receipts_screen.d.ts.map +1 -1
  14. package/build/screens/conversation/message_read_receipts_screen.js +28 -39
  15. package/build/screens/conversation/message_read_receipts_screen.js.map +1 -1
  16. package/build/screens/conversation_filters_screen.d.ts.map +1 -1
  17. package/build/screens/conversation_filters_screen.js +1 -4
  18. package/build/screens/conversation_filters_screen.js.map +1 -1
  19. package/build/utils/index.d.ts +0 -1
  20. package/build/utils/index.d.ts.map +1 -1
  21. package/build/utils/index.js +0 -1
  22. package/build/utils/index.js.map +1 -1
  23. package/package.json +2 -2
  24. package/src/components/primitive/{actions_form_sheet.tsx → form_sheet.tsx} +61 -35
  25. package/src/navigation/index.tsx +1 -4
  26. package/src/screens/attachment_actions/attachment_actions_screen.tsx +8 -8
  27. package/src/screens/conversation/message_read_receipts_screen.tsx +37 -51
  28. package/src/screens/conversation_filters_screen.tsx +1 -4
  29. package/src/utils/index.ts +0 -1
  30. package/build/components/primitive/actions_form_sheet.d.ts +0 -34
  31. package/build/components/primitive/actions_form_sheet.d.ts.map +0 -1
  32. package/build/components/primitive/actions_form_sheet.js.map +0 -1
  33. package/build/utils/navigation_constants.d.ts +0 -2
  34. package/build/utils/navigation_constants.d.ts.map +0 -1
  35. package/build/utils/navigation_constants.js +0 -11
  36. package/build/utils/navigation_constants.js.map +0 -1
  37. package/src/utils/navigation_constants.ts +0 -12
@@ -30,10 +30,7 @@ const HeaderRightWithContext = () => {
30
30
  };
31
31
  export const ConversationFiltersScreenOptions = {
32
32
  presentation: Platform.select({ android: 'modal', ios: 'formSheet' }),
33
- sheetAllowedDetents: Platform.select({
34
- android: [0.75, 0.94],
35
- default: [0.75, 1],
36
- }),
33
+ sheetAllowedDetents: [0.75, 1],
37
34
  sheetGrabberVisible: true,
38
35
  headerBackVisible: false,
39
36
  headerRight: HeaderRightWithContext,
@@ -1 +1 @@
1
- {"version":3,"file":"conversation_filters_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_filters_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC3F,OAAO,EAAE,kCAAkC,EAAa,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAClG,OAAO,EACL,0BAA0B,GAE3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EACL,aAAa,EACb,cAAc,GACf,MAAM,4DAA4D,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAA;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;AAKnE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,WA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AAE,cAAc,CAAC,CAClB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,EAAE,CAAA;IACnC,MAAM,EAAE,MAAM,EAAE,GAAG,mBAAmB,EAAE,CAAA;IACxC,MAAM,YAAY,GAAG,eAAe,EAAE,CAAA;IACtC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IAExB,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC;QACtC,OAAO,EAAE,MAAM;QACf,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,YAAY;KACjC,CAAC,CAAA;IAEF,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,IAAI,EAAE,CAAC;SACR;QACD,WAAW,EAAE;YACX,SAAS,EAAE,MAAM;YACjB,IAAI,EAAE,CAAC;SACR;QACD,SAAS,EAAE;YACT,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,2BAA2B;YACzD,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;YAC/B,UAAU,EAAE,QAAQ;YACpB,iBAAiB,EAAE,EAAE;YACrB,eAAe,EAAE,EAAE;YACnB,GAAG,EAAE,CAAC;SACP;QACD,eAAe,EAAE;YACf,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,gCAAgC;SAC5C;QACD,gBAAgB,EAAE;YAChB,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;YACN,UAAU,EAAE,QAAQ;SACrB;QACD,WAAW,EAAE;YACX,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;YACN,UAAU,EAAE,QAAQ;SACrB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { HeaderTitle, HeaderTitleProps, useHeaderHeight } from '@react-navigation/elements'\nimport { createComponentForStaticNavigation, RouteProp, useRoute } from '@react-navigation/native'\nimport {\n createNativeStackNavigator,\n NativeStackNavigationOptions,\n} from '@react-navigation/native-stack'\nimport React from 'react'\nimport { Platform, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Button, TextButton } from '../components'\nimport {\n FilterContext,\n FilterProvider,\n} from './conversation_filters/context/conversation_filter_context'\nimport { ConversationFilters } from './conversation_filters/components/conversation_filters'\nimport { GroupFilters } from './conversation_filters/group_filters'\nimport {\n ConversationFiltersScreenProps,\n ConversationFilterStackParamList,\n} from './conversation_filters/screen_props'\nimport { useTheme } from '../hooks'\nimport { TeamFilters } from './conversation_filters/team_filters'\n\nconst FilterHeaderTitle = ({ tintColor }: HeaderTitleProps) => {\n const styles = useStyles()\n return <HeaderTitle style={[styles.headerTitle, { color: tintColor }]}>Filters</HeaderTitle>\n}\n\nconst HeaderRight = () => {\n const { resetFilter, applyFilters } = React.useContext(FilterContext)\n const route = useRoute<RouteProp<ConversationFiltersScreenProps['route']>>()\n const styles = useStyles()\n\n return (\n <View style={styles.headerRight}>\n <TextButton onPress={resetFilter}>Reset</TextButton>\n <Button title=\"Apply\" onPress={() => applyFilters(route.params)} />\n </View>\n )\n}\n\nconst HeaderRightWithContext = () => {\n return (\n <FilterProvider>\n <HeaderRight />\n </FilterProvider>\n )\n}\n\nexport const ConversationFiltersScreenOptions: NativeStackNavigationOptions = {\n presentation: Platform.select({ android: 'modal', ios: 'formSheet' }),\n sheetAllowedDetents: Platform.select({\n android: [0.75, 0.94],\n default: [0.75, 1],\n }),\n sheetGrabberVisible: true,\n headerBackVisible: false,\n headerRight: HeaderRightWithContext,\n headerTitle: FilterHeaderTitle,\n headerTitleAlign: 'left',\n sheetCornerRadius: 16,\n}\n\nconst FilterNavigator = createNativeStackNavigator<ConversationFilterStackParamList>({\n initialRouteName: 'Filters',\n screens: {\n Filters: {\n screen: ConversationFilters,\n options: {\n headerShown: false,\n },\n },\n GroupFilters: {\n screen: GroupFilters,\n options: {\n headerTitle: Platform.select({\n android: 'Groups',\n ios: '',\n }),\n headerBackTitle: 'Groups',\n },\n },\n TeamFilters: {\n screen: TeamFilters,\n options: {\n headerTitle: Platform.select({\n android: 'Teams',\n ios: '',\n }),\n headerBackTitle: 'Teams',\n },\n },\n },\n})\n\nconst Filters = createComponentForStaticNavigation(FilterNavigator, 'Filters')\n\nexport const ConversationFiltersScreen = (_props: ConversationFiltersScreenProps) => {\n const styles = useStyles()\n\n return (\n <FilterProvider>\n <View style={styles.container}>\n <Filters />\n </View>\n </FilterProvider>\n )\n}\n\nconst useStyles = () => {\n const { top } = useSafeAreaInsets()\n const { height } = useWindowDimensions()\n const headerHeight = useHeaderHeight()\n const theme = useTheme()\n\n const containerHeight = Platform.select({\n android: height,\n ios: height - top - headerHeight,\n })\n\n return StyleSheet.create({\n container: {\n height: containerHeight,\n flex: 1,\n },\n headerTitle: {\n textAlign: 'left',\n flex: 1,\n },\n filterBar: {\n backgroundColor: theme.colors.fillColorNeutral100Inverted,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n paddingHorizontal: 16,\n paddingVertical: 16,\n gap: 8,\n },\n filterBarScroll: {\n elevation: 4,\n boxShadow: '0px 4px 4px rgba(0, 0, 0, 0.1)',\n },\n filterBarActions: {\n flexDirection: 'row',\n gap: 8,\n alignItems: 'center',\n },\n headerRight: {\n flexDirection: 'row',\n gap: 8,\n alignItems: 'center',\n },\n })\n}\n"]}
1
+ {"version":3,"file":"conversation_filters_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_filters_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC3F,OAAO,EAAE,kCAAkC,EAAa,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAClG,OAAO,EACL,0BAA0B,GAE3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,m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EAAE,CAAC;YACN,UAAU,EAAE,QAAQ;SACrB;QACD,WAAW,EAAE;YACX,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;YACN,UAAU,EAAE,QAAQ;SACrB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { HeaderTitle, HeaderTitleProps, useHeaderHeight } from '@react-navigation/elements'\nimport { createComponentForStaticNavigation, RouteProp, useRoute } from '@react-navigation/native'\nimport {\n createNativeStackNavigator,\n NativeStackNavigationOptions,\n} from '@react-navigation/native-stack'\nimport React from 'react'\nimport { Platform, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Button, TextButton } from '../components'\nimport {\n FilterContext,\n FilterProvider,\n} from './conversation_filters/context/conversation_filter_context'\nimport { ConversationFilters } from './conversation_filters/components/conversation_filters'\nimport { GroupFilters } from './conversation_filters/group_filters'\nimport {\n ConversationFiltersScreenProps,\n ConversationFilterStackParamList,\n} from './conversation_filters/screen_props'\nimport { useTheme } from '../hooks'\nimport { TeamFilters } from './conversation_filters/team_filters'\n\nconst FilterHeaderTitle = ({ tintColor }: HeaderTitleProps) => {\n const styles = useStyles()\n return <HeaderTitle style={[styles.headerTitle, { color: tintColor }]}>Filters</HeaderTitle>\n}\n\nconst HeaderRight = () => {\n const { resetFilter, applyFilters } = React.useContext(FilterContext)\n const route = useRoute<RouteProp<ConversationFiltersScreenProps['route']>>()\n const styles = useStyles()\n\n return (\n <View style={styles.headerRight}>\n <TextButton onPress={resetFilter}>Reset</TextButton>\n <Button title=\"Apply\" onPress={() => applyFilters(route.params)} />\n </View>\n )\n}\n\nconst HeaderRightWithContext = () => {\n return (\n <FilterProvider>\n <HeaderRight />\n </FilterProvider>\n )\n}\n\nexport const ConversationFiltersScreenOptions: NativeStackNavigationOptions = {\n presentation: Platform.select({ android: 'modal', ios: 'formSheet' }),\n sheetAllowedDetents: [0.75, 1],\n sheetGrabberVisible: true,\n headerBackVisible: false,\n headerRight: HeaderRightWithContext,\n headerTitle: FilterHeaderTitle,\n headerTitleAlign: 'left',\n sheetCornerRadius: 16,\n}\n\nconst FilterNavigator = createNativeStackNavigator<ConversationFilterStackParamList>({\n initialRouteName: 'Filters',\n screens: {\n Filters: {\n screen: ConversationFilters,\n options: {\n headerShown: false,\n },\n },\n GroupFilters: {\n screen: GroupFilters,\n options: {\n headerTitle: Platform.select({\n android: 'Groups',\n ios: '',\n }),\n headerBackTitle: 'Groups',\n },\n },\n TeamFilters: {\n screen: TeamFilters,\n options: {\n headerTitle: Platform.select({\n android: 'Teams',\n ios: '',\n }),\n headerBackTitle: 'Teams',\n },\n },\n },\n})\n\nconst Filters = createComponentForStaticNavigation(FilterNavigator, 'Filters')\n\nexport const ConversationFiltersScreen = (_props: ConversationFiltersScreenProps) => {\n const styles = useStyles()\n\n return (\n <FilterProvider>\n <View style={styles.container}>\n <Filters />\n </View>\n </FilterProvider>\n )\n}\n\nconst useStyles = () => {\n const { top } = useSafeAreaInsets()\n const { height } = useWindowDimensions()\n const headerHeight = useHeaderHeight()\n const theme = useTheme()\n\n const containerHeight = Platform.select({\n android: height,\n ios: height - top - headerHeight,\n })\n\n return StyleSheet.create({\n container: {\n height: containerHeight,\n flex: 1,\n },\n headerTitle: {\n textAlign: 'left',\n flex: 1,\n },\n filterBar: {\n backgroundColor: theme.colors.fillColorNeutral100Inverted,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n paddingHorizontal: 16,\n paddingVertical: 16,\n gap: 8,\n },\n filterBarScroll: {\n elevation: 4,\n boxShadow: '0px 4px 4px rgba(0, 0, 0, 0.1)',\n },\n filterBarActions: {\n flexDirection: 'row',\n gap: 8,\n alignItems: 'center',\n },\n headerRight: {\n flexDirection: 'row',\n gap: 8,\n alignItems: 'center',\n },\n })\n}\n"]}
@@ -8,5 +8,4 @@ export * from './cache';
8
8
  export * from './native_adapters';
9
9
  export * from './pluralize';
10
10
  export * from './destructure_chat_group_graph_id';
11
- export * from './navigation_constants';
12
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,mCAAmC,CAAA"}
@@ -8,5 +8,4 @@ export * from './cache';
8
8
  export * from './native_adapters';
9
9
  export * from './pluralize';
10
10
  export * from './destructure_chat_group_graph_id';
11
- export * from './navigation_constants';
12
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA","sourcesContent":["export * from './session'\nexport * from './theme'\nexport * from './styles'\nexport * from './space'\nexport * from './client'\nexport * from './uri'\nexport * from './cache'\nexport * from './native_adapters'\nexport * from './pluralize'\nexport * from './destructure_chat_group_graph_id'\nexport * from './navigation_constants'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,mCAAmC,CAAA","sourcesContent":["export * from './session'\nexport * from './theme'\nexport * from './styles'\nexport * from './space'\nexport * from './client'\nexport * from './uri'\nexport * from './cache'\nexport * from './native_adapters'\nexport * from './pluralize'\nexport * from './destructure_chat_group_graph_id'\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/chat-react-native",
3
- "version": "3.7.0-rc.7",
3
+ "version": "3.7.0-rc.8",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -55,5 +55,5 @@
55
55
  "prettier": "^3.4.2",
56
56
  "typescript": "<5.6.0"
57
57
  },
58
- "gitHead": "06b73c117671227235899f500cb1664c7f1eff42"
58
+ "gitHead": "7e6a66b01f150561ea8c8d195c6bc7e3badd2df1"
59
59
  }
@@ -1,9 +1,8 @@
1
1
  import { NativeStackNavigationOptions } from '@react-navigation/native-stack'
2
2
  import React, { ReactNode } from 'react'
3
- import { AccessibilityRole, StyleSheet, View } from 'react-native'
3
+ import { AccessibilityRole, Platform, StyleSheet, View } from 'react-native'
4
4
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
5
5
  import { useTheme } from '../../hooks'
6
- import { PLATFORM_SHEET_ALLOWED_DETENTS_FIT_TO_CONTENTS } from '../../utils/navigation_constants'
7
6
  import { PlatformPressable } from '@react-navigation/elements'
8
7
  import { Icon, IconString, Text } from '../display'
9
8
 
@@ -11,70 +10,97 @@ import { Icon, IconString, Text } from '../display'
11
10
  // ====== Exports ==================
12
11
  // =================================
13
12
 
14
- export const BaseActionsFormSheetOptions: NativeStackNavigationOptions = {
13
+ /**
14
+ * Screen options for the formsheet's NativeStackNavigation route
15
+ * @param {string} options.headerTitle - Doesn't show in UI but good to have for semantic reasons.
16
+ * @param {number[]} [options.sheetAllowedDetents] - Controls the height increments the sheet grows to. To prevent bugs in Android, do not specify more then two values and use [0.94] instead of [1] to go full screen.
17
+ * @param {NativeStackNavigationOptions} [options.rest] - Adds or overrides any valid NativeStackNavigationOptions
18
+ * @returns {NativeStackNavigationOptions} Merged NativeStackNavigationOptions
19
+ */
20
+ export const getFormSheetScreenOptions = ({
21
+ headerTitle,
22
+ sheetAllowedDetents = [0.25],
23
+ ...rest
24
+ }: NativeStackNavigationOptions = {}): NativeStackNavigationOptions => ({
15
25
  presentation: 'formSheet',
16
26
  headerShown: false,
17
- sheetAllowedDetents: PLATFORM_SHEET_ALLOWED_DETENTS_FIT_TO_CONTENTS,
27
+ sheetAllowedDetents,
18
28
  sheetCornerRadius: 16,
19
- }
20
-
21
- const ActionsFormSheet = {
22
- Root: ActionsFormSheetRoot,
23
- Action: ActionsFormSheetAction,
29
+ sheetGrabberVisible: true,
30
+ headerTitle,
31
+ ...rest,
32
+ })
33
+
34
+ const FormSheet = {
35
+ Root: FormSheetRoot,
36
+ Action: FormSheetAction,
24
37
  } as const
25
38
 
26
- type ActionFormSheetComponents = {
27
- Root: React.FC<ActionsFormSheetRootProps>
28
- Action: React.FC<ActionsFormSheetActionProps>
39
+ type FormSheetComponents = {
40
+ Root: React.FC<FormSheetRootProps>
41
+ Action: React.FC<FormSheetActionProps>
29
42
  }
30
43
 
31
- export default ActionsFormSheet as ActionFormSheetComponents
32
- export type { ActionsFormSheetRootProps, ActionsFormSheetActionProps }
44
+ export default FormSheet as FormSheetComponents
45
+ export type { FormSheetRootProps, FormSheetActionProps }
33
46
 
34
47
  // ====================================
35
48
  // ====== ActionsFormSheetRoot ========
36
49
  // ====================================
37
50
 
38
- interface ActionsFormSheetRootProps {
51
+ interface FormSheetRootProps {
39
52
  children: ReactNode
40
53
  }
41
54
 
42
- export function ActionsFormSheetRoot({ children }: ActionsFormSheetRootProps) {
55
+ export function FormSheetRoot({ children }: FormSheetRootProps) {
43
56
  const styles = useStyles()
44
57
 
45
58
  return (
46
59
  <View style={styles.container}>
47
- <View style={styles.gestureBar} />
48
- <View style={styles.actions}>{children}</View>
60
+ <AndroidSheetGrabber />
61
+ <View style={styles.content}>{children}</View>
49
62
  </View>
50
63
  )
51
64
  }
52
65
 
53
- ActionsFormSheetRoot.displayName = 'ActionsFormSheet.Root'
66
+ FormSheetRoot.displayName = 'FormSheet.Root'
67
+
68
+ // ====================================
69
+ // ====== AndroidSheetGrabber =========
70
+ // ====================================
71
+
72
+ function AndroidSheetGrabber() {
73
+ const styles = useStyles()
74
+
75
+ return Platform.select({
76
+ android: <View style={styles.androidSheetGrabber} />,
77
+ ios: null,
78
+ })
79
+ }
54
80
 
55
81
  // ====================================
56
82
  // ====== ActionsFormSheetAction ======
57
83
  // ====================================
58
84
 
59
- const ACTION_FORM_SHEET_ACTION_APPEARANCES = {
85
+ const FORM_SHEET_ACTION_APPEARANCES = {
60
86
  neutral: 'neutral',
61
87
  danger: 'danger',
62
88
  } as const
63
89
 
64
- type ActionsFormSheetActionAppearanceUnion =
65
- (typeof ACTION_FORM_SHEET_ACTION_APPEARANCES)[keyof typeof ACTION_FORM_SHEET_ACTION_APPEARANCES]
90
+ type FormSheetActionAppearanceUnion =
91
+ (typeof FORM_SHEET_ACTION_APPEARANCES)[keyof typeof FORM_SHEET_ACTION_APPEARANCES]
66
92
 
67
- interface ActionsFormSheetActionProps {
93
+ interface FormSheetActionProps {
68
94
  title: string
69
95
  iconName: IconString
70
96
  onPress: () => void
71
97
  accessibilityLabel?: string
72
98
  accessibilityHint?: string
73
99
  accessibilityRole?: AccessibilityRole
74
- appearance?: ActionsFormSheetActionAppearanceUnion
100
+ appearance?: FormSheetActionAppearanceUnion
75
101
  }
76
102
 
77
- function ActionsFormSheetAction({
103
+ function FormSheetAction({
78
104
  title,
79
105
  iconName,
80
106
  onPress,
@@ -82,7 +108,7 @@ function ActionsFormSheetAction({
82
108
  accessibilityHint,
83
109
  accessibilityRole = 'button',
84
110
  appearance = 'neutral',
85
- }: ActionsFormSheetActionProps) {
111
+ }: FormSheetActionProps) {
86
112
  const styles = useStyles({ appearance })
87
113
 
88
114
  return (
@@ -99,14 +125,14 @@ function ActionsFormSheetAction({
99
125
  )
100
126
  }
101
127
 
102
- ActionsFormSheetAction.displayName = 'ActionsFormSheet.Action'
128
+ FormSheetAction.displayName = 'FormSheet.Action'
103
129
 
104
130
  // ==================================
105
131
  // ====== Styles ====================
106
132
  // ==================================
107
133
 
108
134
  interface Styles {
109
- appearance?: ActionsFormSheetActionAppearanceUnion
135
+ appearance?: FormSheetActionAppearanceUnion
110
136
  }
111
137
 
112
138
  const useStyles = ({ appearance = 'neutral' }: Styles = {}) => {
@@ -128,20 +154,20 @@ const useStyles = ({ appearance = 'neutral' }: Styles = {}) => {
128
154
  container: {
129
155
  flex: 1,
130
156
  justifyContent: 'flex-start',
131
- paddingTop: 12,
132
157
  paddingBottom: bottom,
133
158
  width: '100%',
134
159
  backgroundColor: colors.fillColorNeutral100Inverted,
135
160
  },
136
- gestureBar: {
137
- width: 32,
138
- height: 4,
139
- backgroundColor: colors.fillColorNeutral050Base,
161
+ androidSheetGrabber: {
162
+ marginTop: 5,
163
+ width: 34,
164
+ height: 5,
165
+ backgroundColor: colors.fillColorNeutral040,
140
166
  borderRadius: 100,
141
167
  alignSelf: 'center',
142
168
  },
143
- actions: {
144
- paddingTop: 20,
169
+ content: {
170
+ paddingTop: Platform.select({ android: 16, ios: 20 }),
145
171
  },
146
172
  actionPressable: {
147
173
  flexDirection: 'row',
@@ -219,10 +219,7 @@ export const ChatStack = createNativeStackNavigator({
219
219
  },
220
220
  MessageReadReceipts: {
221
221
  screen: MessageReadReceiptsScreen,
222
- options: {
223
- ...MessageReadReceiptsScreenOptions,
224
- headerTitle: 'Read receipts',
225
- },
222
+ options: MessageReadReceiptsScreenOptions,
226
223
  },
227
224
  BugReport: {
228
225
  screen: BugReportScreen,
@@ -1,12 +1,12 @@
1
1
  import { StaticScreenProps, useNavigation } from '@react-navigation/native'
2
2
  import React from 'react'
3
3
  import { Linking } from 'react-native'
4
- import ActionsFormSheet, {
5
- BaseActionsFormSheetOptions,
6
- } from '../../components/primitive/actions_form_sheet'
4
+ import FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet'
7
5
  import { useDeleteAttachment } from './hooks/useDeleteAttachment'
8
6
 
9
- export const AttachmentActionsScreenOptions = BaseActionsFormSheetOptions
7
+ export const AttachmentActionsScreenOptions = getFormSheetScreenOptions({
8
+ headerTitle: 'Attachment actions',
9
+ })
10
10
 
11
11
  export type AttachmentActionsScreenProps = StaticScreenProps<{
12
12
  attachmentId: string
@@ -43,8 +43,8 @@ export function AttachmentActionsScreen({ route }: AttachmentActionsScreenProps)
43
43
  }
44
44
 
45
45
  return (
46
- <ActionsFormSheet.Root>
47
- <ActionsFormSheet.Action
46
+ <FormSheet.Root>
47
+ <FormSheet.Action
48
48
  iconName="general.newWindow"
49
49
  title="Open in browser"
50
50
  accessibilityRole="link"
@@ -53,14 +53,14 @@ export function AttachmentActionsScreen({ route }: AttachmentActionsScreenProps)
53
53
  onPress={handleOpenInBrowser}
54
54
  />
55
55
  {canDelete && (
56
- <ActionsFormSheet.Action
56
+ <FormSheet.Action
57
57
  appearance="danger"
58
58
  iconName="publishing.trash"
59
59
  title={`Delete ${attachmentName}`}
60
60
  onPress={handleDeleteAttachment}
61
61
  />
62
62
  )}
63
- </ActionsFormSheet.Root>
63
+ </FormSheet.Root>
64
64
  )
65
65
  }
66
66
 
@@ -1,27 +1,25 @@
1
- import React, { useEffect } from 'react'
2
- import { View, StyleSheet, useWindowDimensions, Platform } from 'react-native'
1
+ import { useHeaderHeight } from '@react-navigation/elements'
2
+ import { StaticScreenProps } from '@react-navigation/native'
3
+ import { NativeStackNavigationOptions } from '@react-navigation/native-stack'
4
+ import React, { memo } from 'react'
5
+ import { Platform, StyleSheet, useWindowDimensions, View } from 'react-native'
3
6
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
4
7
  import { Avatar, Heading, Text } from '../../components'
5
8
  import { useTheme } from '../../hooks'
6
- import { StaticScreenProps, useNavigation } from '@react-navigation/native'
7
- import { NativeStackNavigationOptions } from '@react-navigation/native-stack'
8
9
  import { useReadReceipts } from '../../hooks/use_read_receipts'
9
- import { FlashList } from '@shopify/flash-list'
10
- import { useHeaderHeight } from '@react-navigation/elements'
11
-
12
- const SCREEN_HEIGHT_RATIO_QUARTER = 0.25 // 25% of the screen height
13
- const SCREEN_HEIGHT_RATIO_HALF = 0.5 // 50% of the screen height
14
- const SCREEN_HEIGHT_RATIO_FULL = 1 // 100% of the screen height
10
+ import { FlatList } from 'react-native-gesture-handler'
11
+ import { ReadReceiptResource } from '../../types/resources/read_receipt'
15
12
 
16
13
  export const MessageReadReceiptsScreenOptions: NativeStackNavigationOptions = {
17
- presentation: Platform.select({ ios: 'formSheet', android: 'modal' }),
14
+ presentation: 'formSheet',
18
15
  sheetAllowedDetents: Platform.select({
19
- ios: [SCREEN_HEIGHT_RATIO_QUARTER, SCREEN_HEIGHT_RATIO_HALF, SCREEN_HEIGHT_RATIO_FULL],
20
- default: undefined,
16
+ android: [0.25, 0.94], // Going straight to full 0.94 preserves height of screen on Android
17
+ default: [0.25, 0.5, 1],
21
18
  }),
22
19
  sheetGrabberVisible: true,
23
- headerShown: Platform.select({ ios: false, default: true }),
20
+ headerShown: false,
24
21
  sheetCornerRadius: 16,
22
+ headerTitle: 'Read receipts',
25
23
  }
26
24
 
27
25
  export type MessageReadReceiptsScreenProps = StaticScreenProps<{
@@ -31,7 +29,6 @@ export type MessageReadReceiptsScreenProps = StaticScreenProps<{
31
29
 
32
30
  export function MessageReadReceiptsScreen({ route }: MessageReadReceiptsScreenProps) {
33
31
  const styles = useStyles()
34
- const navigation = useNavigation()
35
32
 
36
33
  const { conversation_id, message_id } = route.params
37
34
  const {
@@ -40,49 +37,38 @@ export function MessageReadReceiptsScreen({ route }: MessageReadReceiptsScreenPr
40
37
  fetchNextPage,
41
38
  } = useReadReceipts({ conversation_id, message_id })
42
39
 
43
- useEffect(() => {
44
- navigation.setOptions({
45
- headerTitle: `Read receipts (${totalCount})`,
46
- })
47
- }, [totalCount, navigation])
48
-
49
40
  return (
50
- <View style={styles.container}>
51
- <FlashList
41
+ <View style={styles.container} collapsable={false}>
42
+ <Heading variant="h3" style={styles.header}>
43
+ Read receipts ({totalCount})
44
+ </Heading>
45
+ <FlatList
52
46
  data={receipts}
53
- contentContainerStyle={styles.contentContainer}
47
+ style={styles.contentContainer}
54
48
  keyExtractor={item => item.id.toString()}
55
- estimatedItemSize={24}
56
- renderItem={({ item }) => (
57
- <View style={styles.receiptRow}>
58
- <Avatar sourceUri={item.avatar} size="sm" />
59
- <Text variant="tertiary" numberOfLines={2} style={styles.name}>
60
- {item.name}
61
- </Text>
62
- </View>
63
- )}
64
- ListHeaderComponent={() => PlatformListHeader({ totalCount })}
49
+ renderItem={({ item }) => <Receipt receipt={item} />}
50
+ nestedScrollEnabled
65
51
  ListFooterComponent={<View style={styles.footer} />}
66
52
  ListEmptyComponent={<Text style={styles.emptyText}>No one has read this message yet.</Text>}
67
- onEndReached={fetchNextPage}
53
+ onEndReached={() => fetchNextPage()}
68
54
  onEndReachedThreshold={0.2}
69
55
  />
70
56
  </View>
71
57
  )
72
58
  }
73
59
 
74
- function PlatformListHeader({ totalCount }: { totalCount: number }) {
60
+ const Receipt = memo(({ receipt }: { receipt: ReadReceiptResource }) => {
75
61
  const styles = useStyles()
76
62
 
77
- return Platform.select({
78
- ios: (
79
- <Heading variant="h3" style={styles.header}>
80
- Read receipts ({totalCount})
81
- </Heading>
82
- ),
83
- default: null,
84
- })
85
- }
63
+ return (
64
+ <View style={styles.receiptRow}>
65
+ <Avatar sourceUri={receipt.avatar} size="sm" />
66
+ <Text variant="tertiary" numberOfLines={2} style={styles.name}>
67
+ {receipt.name}
68
+ </Text>
69
+ </View>
70
+ )
71
+ })
86
72
 
87
73
  const useStyles = () => {
88
74
  const theme = useTheme()
@@ -91,23 +77,23 @@ const useStyles = () => {
91
77
  const headerHeight = useHeaderHeight()
92
78
 
93
79
  const containerHeight = Platform.select({
94
- android: height,
80
+ android: null,
95
81
  ios: height - top - headerHeight,
96
82
  })
97
83
 
98
84
  return StyleSheet.create({
99
85
  container: {
100
- paddingHorizontal: 16,
86
+ paddingTop: 16,
101
87
  backgroundColor: theme.colors.fillColorNeutral100Inverted,
102
88
  height: containerHeight,
103
89
  flex: 1,
104
90
  },
105
91
  contentContainer: {
106
- paddingTop: 8,
92
+ paddingHorizontal: 16,
107
93
  },
108
94
  header: {
109
- marginTop: 16,
110
- marginBottom: 8,
95
+ paddingHorizontal: 16,
96
+ paddingBottom: 8,
111
97
  },
112
98
  receiptRow: {
113
99
  flexDirection: 'row',
@@ -120,7 +106,7 @@ const useStyles = () => {
120
106
  flex: 1,
121
107
  },
122
108
  footer: {
123
- height: bottom + 40,
109
+ height: bottom + 16,
124
110
  },
125
111
  emptyText: {
126
112
  textAlign: 'center',
@@ -49,10 +49,7 @@ const HeaderRightWithContext = () => {
49
49
 
50
50
  export const ConversationFiltersScreenOptions: NativeStackNavigationOptions = {
51
51
  presentation: Platform.select({ android: 'modal', ios: 'formSheet' }),
52
- sheetAllowedDetents: Platform.select({
53
- android: [0.75, 0.94],
54
- default: [0.75, 1],
55
- }),
52
+ sheetAllowedDetents: [0.75, 1],
56
53
  sheetGrabberVisible: true,
57
54
  headerBackVisible: false,
58
55
  headerRight: HeaderRightWithContext,
@@ -8,4 +8,3 @@ export * from './cache'
8
8
  export * from './native_adapters'
9
9
  export * from './pluralize'
10
10
  export * from './destructure_chat_group_graph_id'
11
- export * from './navigation_constants'
@@ -1,34 +0,0 @@
1
- import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
2
- import React, { ReactNode } from 'react';
3
- import { AccessibilityRole } from 'react-native';
4
- import { IconString } from '../display';
5
- export declare const BaseActionsFormSheetOptions: NativeStackNavigationOptions;
6
- type ActionFormSheetComponents = {
7
- Root: React.FC<ActionsFormSheetRootProps>;
8
- Action: React.FC<ActionsFormSheetActionProps>;
9
- };
10
- declare const _default: ActionFormSheetComponents;
11
- export default _default;
12
- export type { ActionsFormSheetRootProps, ActionsFormSheetActionProps };
13
- interface ActionsFormSheetRootProps {
14
- children: ReactNode;
15
- }
16
- export declare function ActionsFormSheetRoot({ children }: ActionsFormSheetRootProps): React.JSX.Element;
17
- export declare namespace ActionsFormSheetRoot {
18
- var displayName: string;
19
- }
20
- declare const ACTION_FORM_SHEET_ACTION_APPEARANCES: {
21
- readonly neutral: "neutral";
22
- readonly danger: "danger";
23
- };
24
- type ActionsFormSheetActionAppearanceUnion = (typeof ACTION_FORM_SHEET_ACTION_APPEARANCES)[keyof typeof ACTION_FORM_SHEET_ACTION_APPEARANCES];
25
- interface ActionsFormSheetActionProps {
26
- title: string;
27
- iconName: IconString;
28
- onPress: () => void;
29
- accessibilityLabel?: string;
30
- accessibilityHint?: string;
31
- accessibilityRole?: AccessibilityRole;
32
- appearance?: ActionsFormSheetActionAppearanceUnion;
33
- }
34
- //# sourceMappingURL=actions_form_sheet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actions_form_sheet.d.ts","sourceRoot":"","sources":["../../../src/components/primitive/actions_form_sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAo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E,EAAE;YACd,aAAa,EAAE,MAAM;YACrB,KAAK,EAAE,MAAM;YACb,eAAe,EAAE,MAAM,CAAC,2BAA2B;SACpD;QACD,UAAU,EAAE;YACV,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,CAAC;YACT,eAAe,EAAE,MAAM,CAAC,uBAAuB;YAC/C,YAAY,EAAE,GAAG;YACjB,SAAS,EAAE,QAAQ;SACpB;QACD,OAAO,EAAE;YACP,UAAU,EAAE,EAAE;SACf;QACD,eAAe,EAAE;YACf,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,eAAe,EAAE,EAAE;YACnB,iBAAiB,EAAE,EAAE;YACrB,GAAG,EAAE,CAAC;SACP;QACD,UAAU,EAAE;YACV,KAAK,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC,SAAS;SACjD;QACD,WAAW,EAAE;YACX,KAAK,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC,SAAS;SACjD;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { NativeStackNavigationOptions } from '@react-navigation/native-stack'\nimport React, { ReactNode } from 'react'\nimport { AccessibilityRole, StyleSheet, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { useTheme } from '../../hooks'\nimport { PLATFORM_SHEET_ALLOWED_DETENTS_FIT_TO_CONTENTS } from '../../utils/navigation_constants'\nimport { PlatformPressable } from '@react-navigation/elements'\nimport { Icon, IconString, Text } from '../display'\n\n// =================================\n// ====== Exports ==================\n// =================================\n\nexport const BaseActionsFormSheetOptions: NativeStackNavigationOptions = {\n presentation: 'formSheet',\n headerShown: false,\n sheetAllowedDetents: PLATFORM_SHEET_ALLOWED_DETENTS_FIT_TO_CONTENTS,\n sheetCornerRadius: 16,\n}\n\nconst ActionsFormSheet = {\n Root: ActionsFormSheetRoot,\n Action: ActionsFormSheetAction,\n} as const\n\ntype ActionFormSheetComponents = {\n Root: React.FC<ActionsFormSheetRootProps>\n Action: React.FC<ActionsFormSheetActionProps>\n}\n\nexport default ActionsFormSheet as ActionFormSheetComponents\nexport type { ActionsFormSheetRootProps, ActionsFormSheetActionProps }\n\n// ====================================\n// ====== ActionsFormSheetRoot ========\n// ====================================\n\ninterface ActionsFormSheetRootProps {\n children: ReactNode\n}\n\nexport function ActionsFormSheetRoot({ children }: ActionsFormSheetRootProps) {\n const styles = useStyles()\n\n return (\n <View style={styles.container}>\n <View style={styles.gestureBar} />\n <View style={styles.actions}>{children}</View>\n </View>\n )\n}\n\nActionsFormSheetRoot.displayName = 'ActionsFormSheet.Root'\n\n// ====================================\n// ====== ActionsFormSheetAction ======\n// ====================================\n\nconst ACTION_FORM_SHEET_ACTION_APPEARANCES = {\n neutral: 'neutral',\n danger: 'danger',\n} as const\n\ntype ActionsFormSheetActionAppearanceUnion =\n (typeof ACTION_FORM_SHEET_ACTION_APPEARANCES)[keyof typeof ACTION_FORM_SHEET_ACTION_APPEARANCES]\n\ninterface ActionsFormSheetActionProps {\n title: string\n iconName: IconString\n onPress: () => void\n accessibilityLabel?: string\n accessibilityHint?: string\n accessibilityRole?: AccessibilityRole\n appearance?: ActionsFormSheetActionAppearanceUnion\n}\n\nfunction ActionsFormSheetAction({\n title,\n iconName,\n onPress,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole = 'button',\n appearance = 'neutral',\n}: ActionsFormSheetActionProps) {\n const styles = useStyles({ appearance })\n\n return (\n <PlatformPressable\n onPress={onPress}\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n accessibilityRole={accessibilityRole}\n style={styles.actionPressable}\n >\n <Icon name={iconName} size={16} accessibilityElementsHidden style={styles.actionIcon} />\n <Text style={styles.actionTitle}>{title}</Text>\n </PlatformPressable>\n )\n}\n\nActionsFormSheetAction.displayName = 'ActionsFormSheet.Action'\n\n// ==================================\n// ====== Styles ====================\n// ==================================\n\ninterface Styles {\n appearance?: ActionsFormSheetActionAppearanceUnion\n}\n\nconst useStyles = ({ appearance = 'neutral' }: Styles = {}) => {\n const { colors } = useTheme()\n const { bottom } = useSafeAreaInsets()\n\n const appearanceColorsMap = {\n neutral: {\n iconColor: colors.iconColorDefaultPrimary,\n textColor: colors.textColorDefaultPrimary,\n },\n danger: {\n iconColor: colors.fillColorStatusErrorMedium,\n textColor: colors.fillColorStatusErrorMedium,\n },\n }\n\n return StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'flex-start',\n paddingTop: 12,\n paddingBottom: bottom,\n width: '100%',\n backgroundColor: colors.fillColorNeutral100Inverted,\n },\n gestureBar: {\n width: 32,\n height: 4,\n backgroundColor: colors.fillColorNeutral050Base,\n borderRadius: 100,\n alignSelf: 'center',\n },\n actions: {\n paddingTop: 20,\n },\n actionPressable: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingVertical: 12,\n paddingHorizontal: 16,\n gap: 8,\n },\n actionIcon: {\n color: appearanceColorsMap[appearance].iconColor,\n },\n actionTitle: {\n color: appearanceColorsMap[appearance].textColor,\n },\n })\n}\n"]}
@@ -1,2 +0,0 @@
1
- export declare const PLATFORM_SHEET_ALLOWED_DETENTS_FIT_TO_CONTENTS: "fitToContents";
2
- //# sourceMappingURL=navigation_constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"navigation_constants.d.ts","sourceRoot":"","sources":["../../src/utils/navigation_constants.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,8CAA8C,iBAIhD,CAAA"}
@@ -1,11 +0,0 @@
1
- import { Platform } from 'react-native';
2
- /*
3
- * Android doesn't support "fitToContents" yet, so we need to manually set the detents.
4
- * This tries to mimic iOS by setting a small detent of 25%, but allowing the user to "grow" the sheet to a full screen detent of 100% as an escape hatch if there is a lot of content.
5
- */
6
- export const PLATFORM_SHEET_ALLOWED_DETENTS_FIT_TO_CONTENTS = Platform.select({
7
- ios: 'fitToContents',
8
- // @ts-expect-error TS was seeing this as "fitToContents", even though it is valid to pass number[] to NativeStackNavigationOptions['sheetAllowedDetents']
9
- android: [0.25, 1],
10
- });
11
- //# sourceMappingURL=navigation_constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"navigation_constants.js","sourceRoot":"","sources":["../../src/utils/navigation_constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC;;;GAGG;AAEH,MAAM,CAAC,MAAM,8CAA8C,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC5E,GAAG,EAAE,eAAe;IACpB,0JAA0J;IAC1J,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;CACV,CAAC,CAAA","sourcesContent":["import { Platform } from 'react-native'\n\n/*\n * Android doesn't support \"fitToContents\" yet, so we need to manually set the detents.\n * This tries to mimic iOS by setting a small detent of 25%, but allowing the user to \"grow\" the sheet to a full screen detent of 100% as an escape hatch if there is a lot of content.\n */\n\nexport const PLATFORM_SHEET_ALLOWED_DETENTS_FIT_TO_CONTENTS = Platform.select({\n ios: 'fitToContents',\n // @ts-expect-error TS was seeing this as \"fitToContents\", even though it is valid to pass number[] to NativeStackNavigationOptions['sheetAllowedDetents']\n android: [0.25, 1],\n} as const)\n"]}
@@ -1,12 +0,0 @@
1
- import { Platform } from 'react-native'
2
-
3
- /*
4
- * Android doesn't support "fitToContents" yet, so we need to manually set the detents.
5
- * This tries to mimic iOS by setting a small detent of 25%, but allowing the user to "grow" the sheet to a full screen detent of 100% as an escape hatch if there is a lot of content.
6
- */
7
-
8
- export const PLATFORM_SHEET_ALLOWED_DETENTS_FIT_TO_CONTENTS = Platform.select({
9
- ios: 'fitToContents',
10
- // @ts-expect-error TS was seeing this as "fitToContents", even though it is valid to pass number[] to NativeStackNavigationOptions['sheetAllowedDetents']
11
- android: [0.25, 1],
12
- } as const)