@planningcenter/chat-react-native 3.43.1-qa-858.0 → 3.43.1-qa-858.1
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.
- package/build/components/conversations/conversations.d.ts.map +1 -1
- package/build/components/conversations/conversations.js +16 -25
- package/build/components/conversations/conversations.js.map +1 -1
- package/build/components/primitive/form_sheet.d.ts +8 -2
- package/build/components/primitive/form_sheet.d.ts.map +1 -1
- package/build/components/primitive/form_sheet.js +8 -2
- package/build/components/primitive/form_sheet.js.map +1 -1
- package/build/navigation/index.d.ts +15 -15
- package/build/screens/attachment_actions/attachment_actions_screen.d.ts +1 -1
- package/build/screens/attachment_actions/attachment_actions_screen.d.ts.map +1 -1
- package/build/screens/avatar_picker/avatar_picker_screen.d.ts +2 -2
- package/build/screens/avatar_picker/avatar_picker_screen.d.ts.map +1 -1
- package/build/screens/conversation/message_read_receipts_screen.d.ts +1 -1
- package/build/screens/conversation/message_read_receipts_screen.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_filters_screen.d.ts +1 -1
- package/build/screens/conversation_filters_screen.d.ts.map +1 -1
- package/build/screens/conversation_filters_screen.js +3 -0
- package/build/screens/conversation_filters_screen.js.map +1 -1
- package/build/screens/conversation_notification_level_select_screen.d.ts +1 -1
- package/build/screens/conversation_notification_level_select_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_type_screen.d.ts +1 -1
- package/build/screens/conversation_select_type_screen.d.ts.map +1 -1
- package/build/screens/group_notification_level_select_screen.d.ts +1 -1
- package/build/screens/group_notification_level_select_screen.d.ts.map +1 -1
- package/build/screens/message_actions_screen.d.ts +1 -1
- package/build/screens/message_actions_screen.d.ts.map +1 -1
- package/build/screens/notification_settings_screen.d.ts.map +1 -1
- package/build/screens/notification_settings_screen.js +19 -27
- package/build/screens/notification_settings_screen.js.map +1 -1
- package/build/screens/reactions_screen.d.ts +1 -1
- package/build/screens/reactions_screen.d.ts.map +1 -1
- package/build/screens/send_giphy_screen.d.ts +1 -1
- package/build/screens/send_giphy_screen.d.ts.map +1 -1
- package/build/screens/system_message_people_screen.d.ts +1 -1
- package/build/screens/system_message_people_screen.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/conversations/conversations.tsx +1 -17
- package/src/components/primitive/form_sheet.tsx +18 -14
- package/src/screens/conversation_filters_screen.tsx +3 -0
- package/src/screens/notification_settings_screen.tsx +0 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../../src/components/conversations/conversations.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../../src/components/conversations/conversations.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAWtC,UAAU,kBAAkB;IAC1B,mBAAmB,CAAC,EAChB,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GACxB,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAClE,IAAI,GACJ,SAAS,CAAA;CACd;AAED,eAAO,MAAM,aAAa,GAAI,yBAAyB,kBAAkB,4CA4ExE,CAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useNavigation } from '@react-navigation/native';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
-
import { FlatList, StyleSheet,
|
|
5
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
|
+
import { FlatList, StyleSheet, View } from 'react-native';
|
|
6
5
|
import { useConversationsContext } from '../../contexts/conversations_context';
|
|
7
6
|
import { useTheme } from '../../hooks';
|
|
8
7
|
import { useCanCreateConversations } from '../../hooks/use_chat_permissions';
|
|
@@ -17,7 +16,6 @@ export const Conversations = ({ ListHeaderComponent }) => {
|
|
|
17
16
|
const canCreateConversations = useCanCreateConversations();
|
|
18
17
|
const isFilterApplied = !!chat_group_graph_id || !!group_source_app_name;
|
|
19
18
|
const showBadges = !chat_group_graph_id;
|
|
20
|
-
const debugInsets = useSafeAreaInsets();
|
|
21
19
|
const data = useMemo(() => {
|
|
22
20
|
if (isLoading) {
|
|
23
21
|
return loadingPlaceholder;
|
|
@@ -32,27 +30,20 @@ export const Conversations = ({ ListHeaderComponent }) => {
|
|
|
32
30
|
throwResponseError(error);
|
|
33
31
|
}
|
|
34
32
|
useConversationsJoltEvents();
|
|
35
|
-
return (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
title: item.resource.title,
|
|
50
|
-
badge: item.resource.badges?.[0],
|
|
51
|
-
deleted: item.resource.deleted,
|
|
52
|
-
muted: item.resource.muted,
|
|
53
|
-
}), showBadges: showBadges }));
|
|
54
|
-
}
|
|
55
|
-
}, onEndReached: () => fetchNextPage() })] }));
|
|
33
|
+
return (_jsx(View, { style: styles.container, children: _jsx(FlatList, { data: data, keyExtractor: item => item.id.toString(), contentContainerStyle: styles.contentContainer, onRefresh: refetch, refreshing: !isFetched && isRefetching, ListHeaderComponent: ListHeaderComponent, ListEmptyComponent: _jsx(ConversationsBlankState, { isFilterApplied: isFilterApplied, canCreateConversations: canCreateConversations }), renderItem: ({ item }) => {
|
|
34
|
+
if (item.type === 'loading') {
|
|
35
|
+
return _jsx(ConversationPreviewSkeleton, {});
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return (_jsx(ConversationPreview, { conversation: item.resource, onPress: () => navigation.navigate('Conversation', {
|
|
39
|
+
conversation_id: item.resource.id,
|
|
40
|
+
title: item.resource.title,
|
|
41
|
+
badge: item.resource.badges?.[0],
|
|
42
|
+
deleted: item.resource.deleted,
|
|
43
|
+
muted: item.resource.muted,
|
|
44
|
+
}), showBadges: showBadges }));
|
|
45
|
+
}
|
|
46
|
+
}, onEndReached: () => fetchNextPage() }) }));
|
|
56
47
|
};
|
|
57
48
|
const useStyles = () => {
|
|
58
49
|
const { colors } = useTheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../../src/components/conversations/conversations.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../../src/components/conversations/conversations.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAA;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAA;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAA;AAEtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAA;AACzF,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AAUrE,MAAM,CAAC,MAAM,aAAa,GA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D,MAAM,kBAAkB,GAAmB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC9E,IAAI,EAAE,SAAS;IACf,EAAE,EAAE,UAAU,CAAC,EAAE;CAClB,CAAC,CAAC,CAAA","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport React, { useMemo } from 'react'\nimport { FlatList, StyleSheet, View } from 'react-native'\nimport { useConversationsContext } from '../../contexts/conversations_context'\nimport { useTheme } from '../../hooks'\nimport { useCanCreateConversations } from '../../hooks/use_chat_permissions'\nimport { useConversationsJoltEvents } from '../../hooks/use_conversations_jolt_events'\nimport { ConversationResource } from '../../types'\nimport { throwResponseError } from '../../utils/response_error'\nimport { ConversationPreview, ConversationPreviewSkeleton } from './conversation_preview'\nimport { ConversationsBlankState } from './conversations_blank_state'\n\ninterface ConversationsProps {\n ListHeaderComponent?:\n | React.ComponentType<any>\n | React.ReactElement<any, string | React.JSXElementConstructor<any>>\n | null\n | undefined\n}\n\nexport const Conversations = ({ ListHeaderComponent }: ConversationsProps) => {\n const styles = useStyles()\n const {\n conversations,\n isLoading,\n fetchNextPage,\n refetch,\n isRefetching,\n isFetched,\n isError,\n error,\n args: { chat_group_graph_id, group_source_app_name },\n } = useConversationsContext()\n const navigation = useNavigation()\n const canCreateConversations = useCanCreateConversations()\n const isFilterApplied = !!chat_group_graph_id || !!group_source_app_name\n\n const showBadges = !chat_group_graph_id\n\n const data: FlatListItem[] = useMemo(() => {\n if (isLoading) {\n return loadingPlaceholder\n }\n return conversations.map(conversation => ({\n type: 'conversation' as const,\n id: conversation.id,\n resource: conversation,\n }))\n }, [conversations, isLoading])\n\n if (isError) {\n throwResponseError(error)\n }\n\n useConversationsJoltEvents()\n\n return (\n <View style={styles.container}>\n <FlatList\n data={data}\n keyExtractor={item => item.id.toString()}\n contentContainerStyle={styles.contentContainer}\n onRefresh={refetch}\n refreshing={!isFetched && isRefetching}\n ListHeaderComponent={ListHeaderComponent}\n ListEmptyComponent={\n <ConversationsBlankState\n isFilterApplied={isFilterApplied}\n canCreateConversations={canCreateConversations}\n />\n }\n renderItem={({ item }) => {\n if (item.type === 'loading') {\n return <ConversationPreviewSkeleton />\n } else {\n return (\n <ConversationPreview\n conversation={item.resource}\n onPress={() =>\n navigation.navigate('Conversation', {\n conversation_id: item.resource.id,\n title: item.resource.title,\n badge: item.resource.badges?.[0],\n deleted: item.resource.deleted,\n muted: item.resource.muted,\n })\n }\n showBadges={showBadges}\n />\n )\n }\n }}\n onEndReached={() => fetchNextPage()}\n />\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n container: { flex: 1 },\n contentContainer: { paddingVertical: 16 },\n listItem: { color: colors.fillColorNeutral020 },\n })\n}\n\ninterface FlatListLoadingItem {\n type: 'loading'\n id: string\n}\ninterface FlatListConversationItem {\n type: 'conversation'\n resource: ConversationResource\n id: number\n}\ntype FlatListItem = FlatListLoadingItem | FlatListConversationItem\n\nconst loadingPlaceholder: FlatListItem[] = Array.from({ length: 5 }, (_, i) => ({\n type: 'loading',\n id: `loading${i}`,\n}))\n"]}
|
|
@@ -5,12 +5,18 @@ import type { ButtonProps, TextButtonProps } from '../display';
|
|
|
5
5
|
import { IconString } from '../display';
|
|
6
6
|
/**
|
|
7
7
|
* Screen options for the formsheet's NativeStackNavigation route
|
|
8
|
+
*
|
|
9
|
+
* Returns a factory rather than an object because callers assign it at module
|
|
10
|
+
* scope, which runs before ChatProvider reports the host's liquid glass
|
|
11
|
+
* capability. React Navigation calls the factory per render, so the sheet
|
|
12
|
+
* corner radius is resolved once that capability is known.
|
|
13
|
+
*
|
|
8
14
|
* @param {string} options.headerTitle - Doesn't show in UI but good to have for semantic reasons.
|
|
9
15
|
* @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.
|
|
10
16
|
* @param {NativeStackNavigationOptions} [options.rest] - Adds or overrides any valid NativeStackNavigationOptions
|
|
11
|
-
* @returns {NativeStackNavigationOptions}
|
|
17
|
+
* @returns {() => NativeStackNavigationOptions} Factory producing merged NativeStackNavigationOptions
|
|
12
18
|
*/
|
|
13
|
-
export declare const getFormSheetScreenOptions: ({ headerTitle, sheetAllowedDetents, ...rest }?: NativeStackNavigationOptions) => NativeStackNavigationOptions;
|
|
19
|
+
export declare const getFormSheetScreenOptions: ({ headerTitle, sheetAllowedDetents, ...rest }?: NativeStackNavigationOptions) => () => NativeStackNavigationOptions;
|
|
14
20
|
type FormSheetComponents = {
|
|
15
21
|
Root: React.FC<FormSheetRootProps>;
|
|
16
22
|
Action: React.FC<FormSheetActionProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form_sheet.d.ts","sourceRoot":"","sources":["../../../src/components/primitive/form_sheet.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAKL,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAA;AAIrB,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC9D,OAAO,EAAyB,UAAU,EAAoB,MAAM,YAAY,CAAA;AAMhF
|
|
1
|
+
{"version":3,"file":"form_sheet.d.ts","sourceRoot":"","sources":["../../../src/components/primitive/form_sheet.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAKL,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAA;AAIrB,OAAO,KAAK,EAA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EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC7B;AAkBD,UAAU,yBAAyB;IACjC,QAAQ,EAAE,SAAS,CAAA;CACpB;AAsBD,UAAU,2BAA2B;IACnC,QAAQ,EAAE,SAAS,CAAA;CACpB;AAiBD,UAAU,8BACR,SAAQ,IAAI,CAAC,eAAe,EAAE,uBAAuB,GAAG,aAAa,CAAC;IACtE,QAAQ,EAAE,MAAM,CAAA;CACjB;AAoBD,UAAU,0BACR,SAAQ,IAAI,CAAC,WAAW,EAAE,uBAAuB,GAAG,aAAa,CAAC;CAAG;AAmBvE,QAAA,MAAM,6BAA6B;;;CAGzB,CAAA;AAEV,KAAK,8BAA8B,GACjC,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,OAAO,6BAA6B,CAAC,CAAA;AAEpF,UAAU,oBAAoB;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,UAAU,CAAA;IACrB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACrC,UAAU,CAAC,EAAE,8BAA8B,CAAA;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB"}
|
|
@@ -10,12 +10,18 @@ import { Button, Heading, Icon, Text, TextButton } from '../display';
|
|
|
10
10
|
// =================================
|
|
11
11
|
/**
|
|
12
12
|
* Screen options for the formsheet's NativeStackNavigation route
|
|
13
|
+
*
|
|
14
|
+
* Returns a factory rather than an object because callers assign it at module
|
|
15
|
+
* scope, which runs before ChatProvider reports the host's liquid glass
|
|
16
|
+
* capability. React Navigation calls the factory per render, so the sheet
|
|
17
|
+
* corner radius is resolved once that capability is known.
|
|
18
|
+
*
|
|
13
19
|
* @param {string} options.headerTitle - Doesn't show in UI but good to have for semantic reasons.
|
|
14
20
|
* @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.
|
|
15
21
|
* @param {NativeStackNavigationOptions} [options.rest] - Adds or overrides any valid NativeStackNavigationOptions
|
|
16
|
-
* @returns {NativeStackNavigationOptions}
|
|
22
|
+
* @returns {() => NativeStackNavigationOptions} Factory producing merged NativeStackNavigationOptions
|
|
17
23
|
*/
|
|
18
|
-
export const getFormSheetScreenOptions = ({ headerTitle, sheetAllowedDetents = [0.25], ...rest } = {}) => ({
|
|
24
|
+
export const getFormSheetScreenOptions = ({ headerTitle, sheetAllowedDetents = [0.25], ...rest } = {}) => () => ({
|
|
19
25
|
presentation: 'formSheet',
|
|
20
26
|
headerShown: false,
|
|
21
27
|
sheetAllowedDetents,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form_sheet.js","sourceRoot":"","sources":["../../../src/components/primitive/form_sheet.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAG/E,OAAO,EACL,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,mBAAmB,GAIpB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,oBAAoB,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAA;AAErF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAc,IAAI,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEhF,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,EACxC,WAAW,EACX,mBAAmB,GAAG,CAAC,IAAI,CAAC,EAC5B,GAAG,IAAI,KACyB,EAAE,EAAgC,E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AE,EAAE;SACb;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable, useHeaderHeight } from '@react-navigation/elements'\nimport { NativeStackNavigationOptions } from '@react-navigation/native-stack'\nimport React, { ReactNode } from 'react'\nimport {\n Platform,\n StyleSheet,\n View,\n useWindowDimensions,\n type AccessibilityRole,\n type StyleProp,\n type ViewStyle,\n} from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { useTheme } from '../../hooks'\nimport { isLiquidGlassEnabled, MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils'\nimport type { ButtonProps, TextButtonProps } from '../display'\nimport { Button, Heading, Icon, IconString, Text, TextButton } from '../display'\n\n// =================================\n// ====== Exports ==================\n// =================================\n\n/**\n * Screen options for the formsheet's NativeStackNavigation route\n * @param {string} options.headerTitle - Doesn't show in UI but good to have for semantic reasons.\n * @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.\n * @param {NativeStackNavigationOptions} [options.rest] - Adds or overrides any valid NativeStackNavigationOptions\n * @returns {NativeStackNavigationOptions} Merged NativeStackNavigationOptions\n */\nexport const getFormSheetScreenOptions = ({\n headerTitle,\n sheetAllowedDetents = [0.25],\n ...rest\n}: NativeStackNavigationOptions = {}): NativeStackNavigationOptions => ({\n presentation: 'formSheet',\n headerShown: false,\n sheetAllowedDetents,\n sheetCornerRadius: isLiquidGlassEnabled() ? undefined : 16,\n sheetGrabberVisible: true,\n headerTitle,\n ...rest,\n})\n\nconst FormSheet = {\n Root: FormSheetRoot,\n Action: FormSheetAction,\n Header: FormSheetHeader,\n HeaderTitle: FormSheetHeaderTitle,\n HeaderActions: FormSheetHeaderActions,\n HeaderTextButton: FormSheetHeaderTextButton,\n HeaderButton: FormSheetHeaderButton,\n} as const\n\ntype FormSheetComponents = {\n Root: React.FC<FormSheetRootProps>\n Action: React.FC<FormSheetActionProps>\n Header: React.FC<FormSheetHeaderProps>\n HeaderTitle: React.FC<FormSheetHeaderTitleProps>\n HeaderActions: React.FC<FormSheetHeaderActionsProps>\n HeaderTextButton: React.FC<FormSheetHeaderTextButtonProps>\n HeaderButton: React.FC<FormSheetHeaderButtonProps>\n}\n\nexport default FormSheet as FormSheetComponents\nexport type {\n FormSheetActionProps,\n FormSheetHeaderActionsProps,\n FormSheetHeaderButtonProps,\n FormSheetHeaderProps,\n FormSheetHeaderTextButtonProps,\n FormSheetHeaderTitleProps,\n FormSheetRootProps,\n}\n\n// ====================================\n// ====== ActionsFormSheetRoot ========\n// ====================================\n\ninterface FormSheetRootProps {\n children: ReactNode\n style?: StyleProp<ViewStyle>\n contentStyle?: StyleProp<ViewStyle>\n showAndroidSheetGrabber?: boolean\n}\n\nexport function FormSheetRoot({\n children,\n style,\n contentStyle,\n showAndroidSheetGrabber = true,\n}: FormSheetRootProps) {\n const styles = useStyles()\n\n return (\n <View style={[styles.container, style]} collapsable={false}>\n <View style={[styles.content, contentStyle]}>{children}</View>\n {showAndroidSheetGrabber && <AndroidSheetGrabber />}\n </View>\n )\n}\n\nFormSheetRoot.displayName = 'FormSheet.Root'\n\n// ====================================\n// ====== AndroidSheetGrabber =========\n// ====================================\n\nfunction AndroidSheetGrabber() {\n const styles = useStyles()\n\n return Platform.select({\n android: <View style={styles.androidSheetGrabber} />,\n ios: null,\n })\n}\n\n// ====================================\n// ====== FormSheetHeader =============\n// ====================================\n\ninterface FormSheetHeaderProps {\n children: ReactNode\n style?: StyleProp<ViewStyle>\n}\n\nfunction FormSheetHeader({ children, style }: FormSheetHeaderProps) {\n const styles = useStyles()\n\n return (\n <View style={[styles.header, style]}>\n <View style={styles.headerContent}>{children}</View>\n </View>\n )\n}\n\nFormSheetHeader.displayName = 'FormSheet.Header'\n\n// ====================================\n// ====== FormSheetHeaderTitle ========\n// ====================================\n\ninterface FormSheetHeaderTitleProps {\n children: ReactNode\n}\n\nfunction FormSheetHeaderTitle({ children }: FormSheetHeaderTitleProps) {\n const styles = useStyles()\n\n return (\n <Heading\n variant=\"h3\"\n style={styles.headerTitle}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n >\n {children}\n </Heading>\n )\n}\n\nFormSheetHeaderTitle.displayName = 'FormSheet.HeaderTitle'\n\n// ====================================\n// ====== FormSheetHeaderActions ======\n// ====================================\n\ninterface FormSheetHeaderActionsProps {\n children: ReactNode\n}\n\nfunction FormSheetHeaderActions({ children }: FormSheetHeaderActionsProps) {\n const styles = useStyles()\n\n return <View style={styles.headerActions}>{children}</View>\n}\n\nFormSheetHeaderActions.displayName = 'FormSheet.HeaderActions'\n\n// ===========================================\n// ====== FormSheetHeaderTextButton ==========\n// ===========================================\n\n// We are omitting `onLongPress` because we are instead supporting `accessibilityShowsLargeContentViewer`.\n// This is triggered by an `onLongPress` event when an iOS device is in Apple's accessible font scale range.\n// Triggering this prop will display an almost full screen iOS a11y button.\ninterface FormSheetHeaderTextButtonProps\n extends Omit<TextButtonProps, 'maxFontSizeMultiplier' | 'onLongPress'> {\n children: string\n}\n\nfunction FormSheetHeaderTextButton(props: FormSheetHeaderTextButtonProps) {\n return (\n <TextButton\n {...props}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n accessibilityShowsLargeContentViewer\n accessibilityLargeContentTitle={props.children}\n />\n )\n}\n\nFormSheetHeaderTextButton.displayName = 'FormSheet.HeaderTextButton'\n\n// =========================================\n// ====== FormSheetHeaderButton ============\n// =========================================\n\n// Same `onLongPress`note as `FormSheetHeaderTextButtonProps`\ninterface FormSheetHeaderButtonProps\n extends Omit<ButtonProps, 'maxFontSizeMultiplier' | 'onLongPress'> {}\n\nfunction FormSheetHeaderButton(props: FormSheetHeaderButtonProps) {\n return (\n <Button\n {...props}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n accessibilityShowsLargeContentViewer\n accessibilityLargeContentTitle={props.title}\n />\n )\n}\n\nFormSheetHeaderButton.displayName = 'FormSheet.HeaderButton'\n\n// ====================================\n// ====== ActionsFormSheetAction ======\n// ====================================\n\nconst FORM_SHEET_ACTION_APPEARANCES = {\n neutral: 'neutral',\n danger: 'danger',\n} as const\n\ntype FormSheetActionAppearanceUnion =\n (typeof FORM_SHEET_ACTION_APPEARANCES)[keyof typeof FORM_SHEET_ACTION_APPEARANCES]\n\ninterface FormSheetActionProps {\n title: string\n iconName?: IconString\n onPress: () => void\n accessibilityLabel?: string\n accessibilityHint?: string\n accessibilityRole?: AccessibilityRole\n appearance?: FormSheetActionAppearanceUnion\n disabled?: boolean\n disabledReason?: string\n}\n\nfunction FormSheetAction({\n title,\n iconName,\n onPress,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole = 'button',\n appearance = 'neutral',\n disabled = false,\n disabledReason,\n}: FormSheetActionProps) {\n const styles = useStyles({ appearance, disabled })\n\n return (\n <PlatformPressable\n onPress={onPress}\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={\n accessibilityHint ?? (disabled && disabledReason ? disabledReason : undefined)\n }\n accessibilityRole={accessibilityRole}\n style={styles.actionPressable}\n disabled={disabled}\n >\n {iconName && (\n <Icon name={iconName} size={16} accessibilityElementsHidden style={styles.actionIcon} />\n )}\n <View style={styles.actionTextBlock}>\n <Text style={styles.actionTitle}>{title}</Text>\n {disabled && disabledReason && (\n <Text style={styles.actionDisabledReason}>{disabledReason}</Text>\n )}\n </View>\n </PlatformPressable>\n )\n}\n\nFormSheetAction.displayName = 'FormSheet.Action'\n\n// ==================================\n// ====== Styles ====================\n// ==================================\n\ninterface Styles {\n appearance?: FormSheetActionAppearanceUnion\n disabled?: boolean\n}\n\nconst useStyles = ({ appearance = 'neutral', disabled = false }: Styles = {}) => {\n const { colors } = useTheme()\n const { height } = useWindowDimensions()\n const { bottom, top } = useSafeAreaInsets()\n const headerHeight = useHeaderHeight()\n\n const containerHeight = Platform.select({\n ios: height - top - headerHeight,\n default: null,\n })\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 justifyContent: 'flex-start',\n paddingBottom: bottom,\n width: '100%',\n backgroundColor: colors.fillColorNeutral100Inverted,\n height: containerHeight,\n ...Platform.select({\n ios: {\n flexGrow: 1, // Ensures the FormSheet children respond to the formsheet height changing on iOS\n },\n android: {\n maxHeight: '100%', // Ensures lists to scroll on Android\n },\n }),\n },\n androidSheetGrabber: {\n position: 'absolute',\n top: 5,\n width: 34,\n height: 5,\n backgroundColor: colors.fillColorNeutral040,\n borderRadius: 100,\n alignSelf: 'center',\n },\n content: {\n ...Platform.select({\n android: {\n maxHeight: '100%', // Ensures content above a list (e.g. FormSheet.Header) don't subtract from the FormSheet's height\n },\n }),\n },\n header: {\n paddingHorizontal: 16,\n paddingTop: 20,\n paddingBottom: 16,\n backgroundColor: colors.fillColorNeutral100Inverted,\n gap: 16,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n headerContent: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n headerTitle: {\n textAlign: 'left',\n flex: 1,\n },\n headerActions: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 16,\n },\n actionPressable: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingVertical: 12,\n paddingHorizontal: 16,\n gap: 8,\n },\n actionIcon: {\n color: disabled ? colors.textColorDefaultDisabled : appearanceColorsMap[appearance].iconColor,\n },\n actionTextBlock: {\n flex: 1,\n },\n actionTitle: {\n color: disabled ? colors.textColorDefaultDisabled : appearanceColorsMap[appearance].textColor,\n },\n actionDisabledReason: {\n color: colors.textColorDefaultDisabled,\n fontSize: 12,\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"form_sheet.js","sourceRoot":"","sources":["../../../src/components/primitive/form_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AAI,EAAE,CAAC;SACR;QACD,aAAa,EAAE;YACb,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,EAAE;SACR;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,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,SAAS;SAC9F;QACD,eAAe,EAAE;YACf,IAAI,EAAE,CAAC;SACR;QACD,WAAW,EAAE;YACX,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,SAAS;SAC9F;QACD,oBAAoB,EAAE;YACpB,KAAK,EAAE,MAAM,CAAC,wBAAwB;YACtC,QAAQ,EAAE,EAAE;SACb;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable, useHeaderHeight } from '@react-navigation/elements'\nimport { NativeStackNavigationOptions } from '@react-navigation/native-stack'\nimport React, { ReactNode } from 'react'\nimport {\n Platform,\n StyleSheet,\n View,\n useWindowDimensions,\n type AccessibilityRole,\n type StyleProp,\n type ViewStyle,\n} from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { useTheme } from '../../hooks'\nimport { isLiquidGlassEnabled, MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils'\nimport type { ButtonProps, TextButtonProps } from '../display'\nimport { Button, Heading, Icon, IconString, Text, TextButton } from '../display'\n\n// =================================\n// ====== Exports ==================\n// =================================\n\n/**\n * Screen options for the formsheet's NativeStackNavigation route\n *\n * Returns a factory rather than an object because callers assign it at module\n * scope, which runs before ChatProvider reports the host's liquid glass\n * capability. React Navigation calls the factory per render, so the sheet\n * corner radius is resolved once that capability is known.\n *\n * @param {string} options.headerTitle - Doesn't show in UI but good to have for semantic reasons.\n * @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.\n * @param {NativeStackNavigationOptions} [options.rest] - Adds or overrides any valid NativeStackNavigationOptions\n * @returns {() => NativeStackNavigationOptions} Factory producing merged NativeStackNavigationOptions\n */\nexport const getFormSheetScreenOptions =\n ({ headerTitle, sheetAllowedDetents = [0.25], ...rest }: NativeStackNavigationOptions = {}) =>\n (): NativeStackNavigationOptions => ({\n presentation: 'formSheet',\n headerShown: false,\n sheetAllowedDetents,\n sheetCornerRadius: isLiquidGlassEnabled() ? undefined : 16,\n sheetGrabberVisible: true,\n headerTitle,\n ...rest,\n })\n\nconst FormSheet = {\n Root: FormSheetRoot,\n Action: FormSheetAction,\n Header: FormSheetHeader,\n HeaderTitle: FormSheetHeaderTitle,\n HeaderActions: FormSheetHeaderActions,\n HeaderTextButton: FormSheetHeaderTextButton,\n HeaderButton: FormSheetHeaderButton,\n} as const\n\ntype FormSheetComponents = {\n Root: React.FC<FormSheetRootProps>\n Action: React.FC<FormSheetActionProps>\n Header: React.FC<FormSheetHeaderProps>\n HeaderTitle: React.FC<FormSheetHeaderTitleProps>\n HeaderActions: React.FC<FormSheetHeaderActionsProps>\n HeaderTextButton: React.FC<FormSheetHeaderTextButtonProps>\n HeaderButton: React.FC<FormSheetHeaderButtonProps>\n}\n\nexport default FormSheet as FormSheetComponents\nexport type {\n FormSheetActionProps,\n FormSheetHeaderActionsProps,\n FormSheetHeaderButtonProps,\n FormSheetHeaderProps,\n FormSheetHeaderTextButtonProps,\n FormSheetHeaderTitleProps,\n FormSheetRootProps,\n}\n\n// ====================================\n// ====== ActionsFormSheetRoot ========\n// ====================================\n\ninterface FormSheetRootProps {\n children: ReactNode\n style?: StyleProp<ViewStyle>\n contentStyle?: StyleProp<ViewStyle>\n showAndroidSheetGrabber?: boolean\n}\n\nexport function FormSheetRoot({\n children,\n style,\n contentStyle,\n showAndroidSheetGrabber = true,\n}: FormSheetRootProps) {\n const styles = useStyles()\n\n return (\n <View style={[styles.container, style]} collapsable={false}>\n <View style={[styles.content, contentStyle]}>{children}</View>\n {showAndroidSheetGrabber && <AndroidSheetGrabber />}\n </View>\n )\n}\n\nFormSheetRoot.displayName = 'FormSheet.Root'\n\n// ====================================\n// ====== AndroidSheetGrabber =========\n// ====================================\n\nfunction AndroidSheetGrabber() {\n const styles = useStyles()\n\n return Platform.select({\n android: <View style={styles.androidSheetGrabber} />,\n ios: null,\n })\n}\n\n// ====================================\n// ====== FormSheetHeader =============\n// ====================================\n\ninterface FormSheetHeaderProps {\n children: ReactNode\n style?: StyleProp<ViewStyle>\n}\n\nfunction FormSheetHeader({ children, style }: FormSheetHeaderProps) {\n const styles = useStyles()\n\n return (\n <View style={[styles.header, style]}>\n <View style={styles.headerContent}>{children}</View>\n </View>\n )\n}\n\nFormSheetHeader.displayName = 'FormSheet.Header'\n\n// ====================================\n// ====== FormSheetHeaderTitle ========\n// ====================================\n\ninterface FormSheetHeaderTitleProps {\n children: ReactNode\n}\n\nfunction FormSheetHeaderTitle({ children }: FormSheetHeaderTitleProps) {\n const styles = useStyles()\n\n return (\n <Heading\n variant=\"h3\"\n style={styles.headerTitle}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n >\n {children}\n </Heading>\n )\n}\n\nFormSheetHeaderTitle.displayName = 'FormSheet.HeaderTitle'\n\n// ====================================\n// ====== FormSheetHeaderActions ======\n// ====================================\n\ninterface FormSheetHeaderActionsProps {\n children: ReactNode\n}\n\nfunction FormSheetHeaderActions({ children }: FormSheetHeaderActionsProps) {\n const styles = useStyles()\n\n return <View style={styles.headerActions}>{children}</View>\n}\n\nFormSheetHeaderActions.displayName = 'FormSheet.HeaderActions'\n\n// ===========================================\n// ====== FormSheetHeaderTextButton ==========\n// ===========================================\n\n// We are omitting `onLongPress` because we are instead supporting `accessibilityShowsLargeContentViewer`.\n// This is triggered by an `onLongPress` event when an iOS device is in Apple's accessible font scale range.\n// Triggering this prop will display an almost full screen iOS a11y button.\ninterface FormSheetHeaderTextButtonProps\n extends Omit<TextButtonProps, 'maxFontSizeMultiplier' | 'onLongPress'> {\n children: string\n}\n\nfunction FormSheetHeaderTextButton(props: FormSheetHeaderTextButtonProps) {\n return (\n <TextButton\n {...props}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n accessibilityShowsLargeContentViewer\n accessibilityLargeContentTitle={props.children}\n />\n )\n}\n\nFormSheetHeaderTextButton.displayName = 'FormSheet.HeaderTextButton'\n\n// =========================================\n// ====== FormSheetHeaderButton ============\n// =========================================\n\n// Same `onLongPress`note as `FormSheetHeaderTextButtonProps`\ninterface FormSheetHeaderButtonProps\n extends Omit<ButtonProps, 'maxFontSizeMultiplier' | 'onLongPress'> {}\n\nfunction FormSheetHeaderButton(props: FormSheetHeaderButtonProps) {\n return (\n <Button\n {...props}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n accessibilityShowsLargeContentViewer\n accessibilityLargeContentTitle={props.title}\n />\n )\n}\n\nFormSheetHeaderButton.displayName = 'FormSheet.HeaderButton'\n\n// ====================================\n// ====== ActionsFormSheetAction ======\n// ====================================\n\nconst FORM_SHEET_ACTION_APPEARANCES = {\n neutral: 'neutral',\n danger: 'danger',\n} as const\n\ntype FormSheetActionAppearanceUnion =\n (typeof FORM_SHEET_ACTION_APPEARANCES)[keyof typeof FORM_SHEET_ACTION_APPEARANCES]\n\ninterface FormSheetActionProps {\n title: string\n iconName?: IconString\n onPress: () => void\n accessibilityLabel?: string\n accessibilityHint?: string\n accessibilityRole?: AccessibilityRole\n appearance?: FormSheetActionAppearanceUnion\n disabled?: boolean\n disabledReason?: string\n}\n\nfunction FormSheetAction({\n title,\n iconName,\n onPress,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole = 'button',\n appearance = 'neutral',\n disabled = false,\n disabledReason,\n}: FormSheetActionProps) {\n const styles = useStyles({ appearance, disabled })\n\n return (\n <PlatformPressable\n onPress={onPress}\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={\n accessibilityHint ?? (disabled && disabledReason ? disabledReason : undefined)\n }\n accessibilityRole={accessibilityRole}\n style={styles.actionPressable}\n disabled={disabled}\n >\n {iconName && (\n <Icon name={iconName} size={16} accessibilityElementsHidden style={styles.actionIcon} />\n )}\n <View style={styles.actionTextBlock}>\n <Text style={styles.actionTitle}>{title}</Text>\n {disabled && disabledReason && (\n <Text style={styles.actionDisabledReason}>{disabledReason}</Text>\n )}\n </View>\n </PlatformPressable>\n )\n}\n\nFormSheetAction.displayName = 'FormSheet.Action'\n\n// ==================================\n// ====== Styles ====================\n// ==================================\n\ninterface Styles {\n appearance?: FormSheetActionAppearanceUnion\n disabled?: boolean\n}\n\nconst useStyles = ({ appearance = 'neutral', disabled = false }: Styles = {}) => {\n const { colors } = useTheme()\n const { height } = useWindowDimensions()\n const { bottom, top } = useSafeAreaInsets()\n const headerHeight = useHeaderHeight()\n\n const containerHeight = Platform.select({\n ios: height - top - headerHeight,\n default: null,\n })\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 justifyContent: 'flex-start',\n paddingBottom: bottom,\n width: '100%',\n backgroundColor: colors.fillColorNeutral100Inverted,\n height: containerHeight,\n ...Platform.select({\n ios: {\n flexGrow: 1, // Ensures the FormSheet children respond to the formsheet height changing on iOS\n },\n android: {\n maxHeight: '100%', // Ensures lists to scroll on Android\n },\n }),\n },\n androidSheetGrabber: {\n position: 'absolute',\n top: 5,\n width: 34,\n height: 5,\n backgroundColor: colors.fillColorNeutral040,\n borderRadius: 100,\n alignSelf: 'center',\n },\n content: {\n ...Platform.select({\n android: {\n maxHeight: '100%', // Ensures content above a list (e.g. FormSheet.Header) don't subtract from the FormSheet's height\n },\n }),\n },\n header: {\n paddingHorizontal: 16,\n paddingTop: 20,\n paddingBottom: 16,\n backgroundColor: colors.fillColorNeutral100Inverted,\n gap: 16,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n headerContent: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n headerTitle: {\n textAlign: 'left',\n flex: 1,\n },\n headerActions: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 16,\n },\n actionPressable: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingVertical: 12,\n paddingHorizontal: 16,\n gap: 8,\n },\n actionIcon: {\n color: disabled ? colors.textColorDefaultDisabled : appearanceColorsMap[appearance].iconColor,\n },\n actionTextBlock: {\n flex: 1,\n },\n actionTitle: {\n color: disabled ? colors.textColorDefaultDisabled : appearanceColorsMap[appearance].textColor,\n },\n actionDisabledReason: {\n color: colors.textColorDefaultDisabled,\n fontSize: 12,\n },\n })\n}\n"]}
|
|
@@ -73,7 +73,7 @@ export declare const NewConversationStack: import("@react-navigation/core").Type
|
|
|
73
73
|
};
|
|
74
74
|
readonly ConversationFilterRecipients: {
|
|
75
75
|
readonly screen: ({ route, }: import("../screens/conversation_filter_recipients/types").ConversationFilterRecipientsScreenProps) => import("react/jsx-runtime").JSX.Element;
|
|
76
|
-
readonly options: NativeStackNavigationOptions;
|
|
76
|
+
readonly options: () => NativeStackNavigationOptions;
|
|
77
77
|
};
|
|
78
78
|
readonly ConversationNew: {
|
|
79
79
|
readonly screen: ({ route }: {
|
|
@@ -98,7 +98,7 @@ export declare const NewConversationStack: import("@react-navigation/core").Type
|
|
|
98
98
|
};
|
|
99
99
|
readonly AvatarPicker: {
|
|
100
100
|
readonly screen: typeof AvatarPickerScreen;
|
|
101
|
-
readonly options: NativeStackNavigationOptions;
|
|
101
|
+
readonly options: () => NativeStackNavigationOptions;
|
|
102
102
|
};
|
|
103
103
|
};
|
|
104
104
|
}>;
|
|
@@ -126,7 +126,7 @@ export declare const ChatStack: import("@react-navigation/core").TypedNavigator<
|
|
|
126
126
|
};
|
|
127
127
|
readonly ConversationFilters: {
|
|
128
128
|
readonly screen: (_props: import("..").ConversationFiltersScreenProps) => import("react/jsx-runtime").JSX.Element;
|
|
129
|
-
readonly options: NativeStackNavigationOptions;
|
|
129
|
+
readonly options: () => NativeStackNavigationOptions;
|
|
130
130
|
};
|
|
131
131
|
readonly Conversation: {
|
|
132
132
|
readonly screen: typeof ConversationScreen;
|
|
@@ -163,7 +163,7 @@ export declare const ChatStack: import("@react-navigation/core").TypedNavigator<
|
|
|
163
163
|
};
|
|
164
164
|
readonly AvatarPicker: {
|
|
165
165
|
readonly screen: typeof AvatarPickerScreen;
|
|
166
|
-
readonly options: NativeStackNavigationOptions;
|
|
166
|
+
readonly options: () => NativeStackNavigationOptions;
|
|
167
167
|
};
|
|
168
168
|
readonly ChatSettings: {
|
|
169
169
|
readonly screen: typeof SettingsScreen;
|
|
@@ -199,11 +199,11 @@ export declare const ChatStack: import("@react-navigation/core").TypedNavigator<
|
|
|
199
199
|
};
|
|
200
200
|
readonly GroupNotificationLevelSelect: {
|
|
201
201
|
readonly screen: typeof GroupNotificationLevelSelectScreen;
|
|
202
|
-
readonly options: NativeStackNavigationOptions;
|
|
202
|
+
readonly options: () => NativeStackNavigationOptions;
|
|
203
203
|
};
|
|
204
204
|
readonly ConversationNotificationLevelSelect: {
|
|
205
205
|
readonly screen: typeof ConversationNotificationLevelSelectScreen;
|
|
206
|
-
readonly options: NativeStackNavigationOptions;
|
|
206
|
+
readonly options: () => NativeStackNavigationOptions;
|
|
207
207
|
};
|
|
208
208
|
readonly New: {
|
|
209
209
|
readonly screen: import("@react-navigation/core").TypedNavigator<{
|
|
@@ -256,7 +256,7 @@ export declare const ChatStack: import("@react-navigation/core").TypedNavigator<
|
|
|
256
256
|
};
|
|
257
257
|
readonly ConversationFilterRecipients: {
|
|
258
258
|
readonly screen: ({ route, }: import("../screens/conversation_filter_recipients/types").ConversationFilterRecipientsScreenProps) => import("react/jsx-runtime").JSX.Element;
|
|
259
|
-
readonly options: NativeStackNavigationOptions;
|
|
259
|
+
readonly options: () => NativeStackNavigationOptions;
|
|
260
260
|
};
|
|
261
261
|
readonly ConversationNew: {
|
|
262
262
|
readonly screen: ({ route }: {
|
|
@@ -281,7 +281,7 @@ export declare const ChatStack: import("@react-navigation/core").TypedNavigator<
|
|
|
281
281
|
};
|
|
282
282
|
readonly AvatarPicker: {
|
|
283
283
|
readonly screen: typeof AvatarPickerScreen;
|
|
284
|
-
readonly options: NativeStackNavigationOptions;
|
|
284
|
+
readonly options: () => NativeStackNavigationOptions;
|
|
285
285
|
};
|
|
286
286
|
};
|
|
287
287
|
}>;
|
|
@@ -315,11 +315,11 @@ export declare const ChatStack: import("@react-navigation/core").TypedNavigator<
|
|
|
315
315
|
};
|
|
316
316
|
readonly SendGiphy: {
|
|
317
317
|
readonly screen: typeof SendGiphyScreen;
|
|
318
|
-
readonly options: NativeStackNavigationOptions;
|
|
318
|
+
readonly options: () => NativeStackNavigationOptions;
|
|
319
319
|
};
|
|
320
320
|
readonly MessageActions: {
|
|
321
321
|
readonly screen: typeof MessageActionsScreen;
|
|
322
|
-
readonly options: NativeStackNavigationOptions;
|
|
322
|
+
readonly options: () => NativeStackNavigationOptions;
|
|
323
323
|
};
|
|
324
324
|
readonly MessageReport: {
|
|
325
325
|
readonly screen: typeof MessageReportScreen;
|
|
@@ -327,23 +327,23 @@ export declare const ChatStack: import("@react-navigation/core").TypedNavigator<
|
|
|
327
327
|
};
|
|
328
328
|
readonly AttachmentActions: {
|
|
329
329
|
readonly screen: typeof AttachmentActionsScreen;
|
|
330
|
-
readonly options: NativeStackNavigationOptions;
|
|
330
|
+
readonly options: () => NativeStackNavigationOptions;
|
|
331
331
|
};
|
|
332
332
|
readonly ConversationSelectType: {
|
|
333
333
|
readonly screen: typeof ConversationSelectTypeScreen;
|
|
334
|
-
readonly options: NativeStackNavigationOptions;
|
|
334
|
+
readonly options: () => NativeStackNavigationOptions;
|
|
335
335
|
};
|
|
336
336
|
readonly Reactions: {
|
|
337
337
|
readonly screen: typeof ReactionsScreen;
|
|
338
|
-
readonly options: NativeStackNavigationOptions;
|
|
338
|
+
readonly options: () => NativeStackNavigationOptions;
|
|
339
339
|
};
|
|
340
340
|
readonly SystemMessagePeople: {
|
|
341
341
|
readonly screen: typeof SystemMessagePeopleScreen;
|
|
342
|
-
readonly options: NativeStackNavigationOptions;
|
|
342
|
+
readonly options: () => NativeStackNavigationOptions;
|
|
343
343
|
};
|
|
344
344
|
readonly MessageReadReceipts: {
|
|
345
345
|
readonly screen: typeof MessageReadReceiptsScreen;
|
|
346
|
-
readonly options: NativeStackNavigationOptions;
|
|
346
|
+
readonly options: () => NativeStackNavigationOptions;
|
|
347
347
|
};
|
|
348
348
|
readonly BugReport: {
|
|
349
349
|
readonly screen: typeof BugReportScreen;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
|
-
export declare const AttachmentActionsScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
2
|
+
export declare const AttachmentActionsScreenOptions: () => import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
3
3
|
export type AttachmentActionsScreenProps = StaticScreenProps<{
|
|
4
4
|
attachmentId: string;
|
|
5
5
|
attachmentContentType: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment_actions_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/attachment_actions/attachment_actions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAM3E,eAAO,MAAM,8BAA8B,
|
|
1
|
+
{"version":3,"file":"attachment_actions_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/attachment_actions/attachment_actions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAM3E,eAAO,MAAM,8BAA8B,6EAEzC,CAAA;AAEF,MAAM,MAAM,4BAA4B,GAAG,iBAAiB,CAAC;IAC3D,YAAY,EAAE,MAAM,CAAA;IACpB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,4BAA4B,EAAE,OAAO,CAAA;IACrC,SAAS,EAAE,OAAO,CAAA;CACnB,CAAC,CAAA;AAEF,wBAAgB,uBAAuB,CAAC,EAAE,KAAK,EAAE,EAAE,4BAA4B,2CAgE9E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
2
|
import { type AvatarUpdatePayload } from '../../hooks/use_conversation_avatar_update';
|
|
3
|
-
export declare const AvatarPickerScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
4
|
-
export declare const AvatarPickerCreateScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
3
|
+
export declare const AvatarPickerScreenOptions: () => import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
4
|
+
export declare const AvatarPickerCreateScreenOptions: () => import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
5
5
|
export type AvatarPickerScreenProps = StaticScreenProps<{
|
|
6
6
|
conversation_id?: number;
|
|
7
7
|
source_params?: Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar_picker_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/avatar_picker_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAWzF,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,4CAA4C,CAAA;AAoBnD,eAAO,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"avatar_picker_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/avatar_picker_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAWzF,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,4CAA4C,CAAA;AAoBnD,eAAO,MAAM,yBAAyB,6EAIpC,CAAA;AAEF,eAAO,MAAM,+BAA+B,6EAI1C,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;IACtD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACvC,gBAAgB,CAAC,EAAE,mBAAmB,CAAA;CACvC,CAAC,CAAA;AAUF,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,EAAE,uBAAuB,2CAMpE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
|
-
export declare const MessageReadReceiptsScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
2
|
+
export declare const MessageReadReceiptsScreenOptions: () => import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
3
3
|
export type MessageReadReceiptsScreenProps = StaticScreenProps<{
|
|
4
4
|
conversation_id: number;
|
|
5
5
|
message_id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message_read_receipts_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation/message_read_receipts_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAa3E,eAAO,MAAM,gCAAgC,
|
|
1
|
+
{"version":3,"file":"message_read_receipts_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation/message_read_receipts_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAa3E,eAAO,MAAM,gCAAgC,6EAM3C,CAAA;AAEF,MAAM,MAAM,8BAA8B,GAAG,iBAAiB,CAAC;IAC7D,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAC,CAAA;AAEF,wBAAgB,yBAAyB,CAAC,EAAE,KAAK,EAAE,EAAE,8BAA8B,2CAmDlF"}
|
package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ConversationFilterRecipientsScreenProps } from './types';
|
|
2
|
-
export declare const ConversationFilterReceipientsScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
2
|
+
export declare const ConversationFilterReceipientsScreenOptions: () => import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
3
3
|
export declare const ConversationFilterRecipientsScreen: ({ route, }: ConversationFilterRecipientsScreenProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=conversation_filter_recipients_screen.d.ts.map
|
package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_filter_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,uCAAuC,EAAiC,MAAM,SAAS,CAAA;AAKhG,eAAO,MAAM,0CAA0C,
|
|
1
|
+
{"version":3,"file":"conversation_filter_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,uCAAuC,EAAiC,MAAM,SAAS,CAAA;AAKhG,eAAO,MAAM,0CAA0C,6EAMrD,CAAA;AAEF,eAAO,MAAM,kCAAkC,GAAI,YAEhD,uCAAuC,4CAwHzC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ConversationFiltersScreenProps } from './conversation_filters/screen_props';
|
|
2
|
-
export declare const ConversationFiltersScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
2
|
+
export declare const ConversationFiltersScreenOptions: () => import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
3
3
|
export declare const ConversationFiltersScreen: (_props: ConversationFiltersScreenProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=conversation_filters_screen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_filters_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_filters_screen.tsx"],"names":[],"mappings":"AAcA,OAAO,EACL,8BAA8B,EAE/B,MAAM,qCAAqC,CAAA;AAG5C,eAAO,MAAM,gCAAgC,
|
|
1
|
+
{"version":3,"file":"conversation_filters_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_filters_screen.tsx"],"names":[],"mappings":"AAcA,OAAO,EACL,8BAA8B,EAE/B,MAAM,qCAAqC,CAAA;AAG5C,eAAO,MAAM,gCAAgC,6EAO3C,CAAA;AAuDF,eAAO,MAAM,yBAAyB,GAAI,QAAQ,8BAA8B,4CAW/E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_filters_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_filters_screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,KAAK,qBAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAa,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAA;AAC3E,OAAc,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAqB,QAAQ,EAAE,UAAU,EAA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AAA;IAED,OAAO,CACL,KAAC,IAAI,IAAC,QAAQ,EAAE,2BAA2B,YACzC,MAAC,SAAS,CAAC,MAAM,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,aACpC,KAAC,SAAS,CAAC,WAAW,0BAAgC,EACtD,MAAC,SAAS,CAAC,aAAa,eACtB,KAAC,SAAS,CAAC,gBAAgB,IAAC,OAAO,EAAE,WAAW,sBAAoC,EACpF,KAAC,SAAS,CAAC,YAAY,IAAC,KAAK,EAAC,OAAO,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,GAAI,IAC3D,IACT,GACd,CACR,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;IAEtC,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,gBAAgB,EAAE;YAChB,MAAM,EAAE,eAAe;SACxB;QACD,MAAM,EAAE;YACN,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC;gBAC1B,GAAG,EAAE,EAAE;gBACP,OAAO,EAAE,EAAE,GAAG,GAAG;aAClB,CAAC;
|
|
1
|
+
{"version":3,"file":"conversation_filters_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_filters_screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,KAAK,qBAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAa,QAAQ,EAAE,MAAM,0BAA0B,CAAA;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cesContent":["import { useHeaderHeight } from '@react-navigation/elements'\nimport * as ReactNavigationNative from '@react-navigation/native'\nimport { RouteProp, useRoute } from '@react-navigation/native'\nimport { createNativeStackNavigator } from '@react-navigation/native-stack'\nimport React, { useCallback } from 'react'\nimport { LayoutChangeEvent, Platform, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'\nimport { ConversationFilters } from './conversation_filters/components/conversation_filters'\nimport {\n FilterProvider,\n useFilterContext,\n} from './conversation_filters/context/conversation_filter_context'\nimport { GroupFilters } from './conversation_filters/group_filters'\nimport {\n ConversationFiltersScreenProps,\n ConversationFilterStackParamList,\n} from './conversation_filters/screen_props'\nimport { TeamFilters } from './conversation_filters/team_filters'\n\nexport const ConversationFiltersScreenOptions = getFormSheetScreenOptions({\n presentation: Platform.select({ android: 'modal', ios: 'formSheet' }),\n sheetAllowedDetents: Platform.select({\n ios: [0.75, 1],\n default: [1],\n }),\n headerTitle: 'Filters',\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\n// tree.getComponent() doesn't exist on every host's installed\n// react-navigation/core — hosts on an older version would throw here.\n// Where it does exist, it's the real implementation (the \"deprecated\"\n// createComponentForStaticNavigation is just a console.warn wrapper around\n// the same call on current versions), so prefer it and only reach for the\n// old function on cores where getComponent() genuinely isn't there yet.\nfunction createStaticNavigationComponent<P extends object>(\n tree: { getComponent?: () => React.ComponentType<P> },\n name: string\n): React.ComponentType<P> {\n if (typeof tree.getComponent === 'function') return tree.getComponent()\n\n const { createComponentForStaticNavigation } = ReactNavigationNative as {\n createComponentForStaticNavigation: (tree: unknown, name: string) => React.ComponentType<P>\n }\n\n return createComponentForStaticNavigation(tree, name)\n}\n\nconst Filters = createStaticNavigationComponent(FilterNavigator, 'Filters')\n\nexport const ConversationFiltersScreen = (_props: ConversationFiltersScreenProps) => {\n const styles = useStyles()\n\n return (\n <FilterProvider>\n <FormSheet.Root contentStyle={styles.contentContainer} showAndroidSheetGrabber={false}>\n <FormSheetHeaderWithContext />\n <Filters />\n </FormSheet.Root>\n </FilterProvider>\n )\n}\n\nconst FormSheetHeaderWithContext = () => {\n const { resetFilter, applyFilters, setFormSheetHeaderHeight } = useFilterContext()\n const route = useRoute<RouteProp<ConversationFiltersScreenProps['route']>>()\n const styles = useStyles()\n\n const handleFormSheetHeaderLayout = useCallback(\n (event: LayoutChangeEvent) => {\n setFormSheetHeaderHeight(event.nativeEvent.layout.height)\n },\n [setFormSheetHeaderHeight]\n )\n\n return (\n <View onLayout={handleFormSheetHeaderLayout}>\n <FormSheet.Header style={styles.header}>\n <FormSheet.HeaderTitle>Filters</FormSheet.HeaderTitle>\n <FormSheet.HeaderActions>\n <FormSheet.HeaderTextButton onPress={resetFilter}>Reset</FormSheet.HeaderTextButton>\n <FormSheet.HeaderButton title=\"Apply\" onPress={() => applyFilters(route.params)} />\n </FormSheet.HeaderActions>\n </FormSheet.Header>\n </View>\n )\n}\n\nconst useStyles = () => {\n const { top } = useSafeAreaInsets()\n const { height } = useWindowDimensions()\n const headerHeight = useHeaderHeight()\n\n const containerHeight = Platform.select({\n android: height,\n ios: height - top - headerHeight,\n })\n\n return StyleSheet.create({\n contentContainer: {\n height: containerHeight,\n },\n header: {\n paddingTop: Platform.select({\n ios: 20,\n android: 20 + top,\n }),\n // The filter list scrolls under it, so the sheet header doesn't need a\n // separator the way the non-scrolling reaction sheet does.\n borderBottomWidth: 0,\n },\n })\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
|
-
export declare const ConversationNotificationLevelSelectScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
2
|
+
export declare const ConversationNotificationLevelSelectScreenOptions: () => import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
3
3
|
export type ConversationNotificationLevelSelectScreenProps = StaticScreenProps<{
|
|
4
4
|
conversation_id: number;
|
|
5
5
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_notification_level_select_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_notification_level_select_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAU3E,eAAO,MAAM,gDAAgD,
|
|
1
|
+
{"version":3,"file":"conversation_notification_level_select_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_notification_level_select_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAU3E,eAAO,MAAM,gDAAgD,6EAG3D,CAAA;AAEF,MAAM,MAAM,8CAA8C,GAAG,iBAAiB,CAAC;IAC7E,eAAe,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF,wBAAgB,yCAAyC,CAAC,EACxD,KAAK,GACN,EAAE,8CAA8C,2CAuChD"}
|
|
@@ -2,7 +2,7 @@ import { StaticScreenProps } from '@react-navigation/native';
|
|
|
2
2
|
import type { NewConversationFromFilter } from '../hooks/use_new_conversation_from_filter';
|
|
3
3
|
import { AppName } from '../types/resources/app_name';
|
|
4
4
|
import { GraphId } from '../types/resources/group_resource';
|
|
5
|
-
export declare const ConversationSelectTypeScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
5
|
+
export declare const ConversationSelectTypeScreenOptions: () => import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
6
6
|
export type ConversationSelectTypeScreenProps = StaticScreenProps<{
|
|
7
7
|
chat_group_graph_id?: GraphId;
|
|
8
8
|
group_source_app_name?: AppName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_select_type_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_select_type_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAK3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAA;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAA;AAG3D,eAAO,MAAM,mCAAmC,
|
|
1
|
+
{"version":3,"file":"conversation_select_type_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_select_type_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAK3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAA;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAA;AAG3D,eAAO,MAAM,mCAAmC,6EAE9C,CAAA;AAEF,MAAM,MAAM,iCAAiC,GAAG,iBAAiB,CAAC;IAChE,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,yBAAyB,CAAC,EAAE,yBAAyB,CAAA;CACtD,CAAC,CAAA;AAOF,wBAAgB,4BAA4B,CAAC,EAAE,KAAK,EAAE,EAAE,iCAAiC,2CA+FxF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
|
-
export declare const GroupNotificationLevelSelectScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
2
|
+
export declare const GroupNotificationLevelSelectScreenOptions: () => import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
3
3
|
export type GroupNotificationLevelSelectScreenProps = StaticScreenProps<{
|
|
4
4
|
groupId: number | string;
|
|
5
5
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group_notification_level_select_screen.d.ts","sourceRoot":"","sources":["../../src/screens/group_notification_level_select_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAQ3E,eAAO,MAAM,yCAAyC,
|
|
1
|
+
{"version":3,"file":"group_notification_level_select_screen.d.ts","sourceRoot":"","sources":["../../src/screens/group_notification_level_select_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAQ3E,eAAO,MAAM,yCAAyC,6EAGpD,CAAA;AAEF,MAAM,MAAM,uCAAuC,GAAG,iBAAiB,CAAC;IACtE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;CACzB,CAAC,CAAA;AAEF,wBAAgB,kCAAkC,CAAC,EACjD,KAAK,GACN,EAAE,uCAAuC,2CA+BzC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
|
-
export declare const MessageActionsScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
2
|
+
export declare const MessageActionsScreenOptions: () => import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
3
3
|
export type MessageActionsScreenProps = StaticScreenProps<{
|
|
4
4
|
message_id: string;
|
|
5
5
|
reply_root_author_name?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message_actions_screen.d.ts","sourceRoot":"","sources":["../../src/screens/message_actions_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgB,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAkBzF,eAAO,MAAM,2BAA2B,
|
|
1
|
+
{"version":3,"file":"message_actions_screen.d.ts","sourceRoot":"","sources":["../../src/screens/message_actions_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgB,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAkBzF,eAAO,MAAM,2BAA2B,6EAGtC,CAAA;AAEF,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,CAAC;IACxD,UAAU,EAAE,MAAM,CAAA;IAClB,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,eAAe,EAAE,MAAM,CAAA;IACvB,4BAA4B,CAAC,EAAE,OAAO,CAAA;IACtC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAC,CAAA;AAEF,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,EAAE,yBAAyB,kDA6BxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification_settings_screen.d.ts","sourceRoot":"","sources":["../../src/screens/notification_settings_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AA2C3E,MAAM,MAAM,+BAA+B,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAA;AAEnE,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,+BAA+B,
|
|
1
|
+
{"version":3,"file":"notification_settings_screen.d.ts","sourceRoot":"","sources":["../../src/screens/notification_settings_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AA2C3E,MAAM,MAAM,+BAA+B,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAA;AAEnE,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,+BAA+B,2CAgJ7E"}
|
|
@@ -25,7 +25,6 @@ export function NotificationSettingsScreen({}) {
|
|
|
25
25
|
const styles = useStyles();
|
|
26
26
|
const { data: chatTypes } = useChatTypes();
|
|
27
27
|
const { data: groups } = useGroups();
|
|
28
|
-
const debugInsets = useSafeAreaInsets();
|
|
29
28
|
// Build section data
|
|
30
29
|
const listData = [
|
|
31
30
|
{
|
|
@@ -84,32 +83,25 @@ export function NotificationSettingsScreen({}) {
|
|
|
84
83
|
const headerIndices = listData
|
|
85
84
|
.map(({ type }, index) => (type === SectionTypes.header ? index : undefined))
|
|
86
85
|
.filter(isDefined);
|
|
87
|
-
return (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
case SectionTypes.link:
|
|
107
|
-
return (_jsx(ListSection, { isStart: isStart, isEnd: isEnd, showBottomBorder: item?.showBottomBorder, outerStyle: item?.sectionOuterStyle, innerStyle: item?.sectionInnerStyle, children: _jsx(LinkRow, { ...item.data }) }));
|
|
108
|
-
case SectionTypes.hidden:
|
|
109
|
-
default:
|
|
110
|
-
return null;
|
|
111
|
-
}
|
|
112
|
-
} })] }));
|
|
86
|
+
return (_jsx(View, { style: styles.listContainer, children: _jsx(FlatList, { data: listData, contentContainerStyle: styles.contentContainer, renderItem: ({ item, index }) => {
|
|
87
|
+
const [isStart, isEnd] = [
|
|
88
|
+
index === 0 || headerIndices.includes(index),
|
|
89
|
+
index === listData.length - 1 || headerIndices.includes(index + 1),
|
|
90
|
+
];
|
|
91
|
+
switch (item.type) {
|
|
92
|
+
case SectionTypes.header:
|
|
93
|
+
return (_jsx(ListSection, { isStart: isStart, isEnd: isEnd, showBottomBorder: item?.showBottomBorder, outerStyle: item?.sectionOuterStyle, innerStyle: item?.sectionInnerStyle, children: _jsx(Heading, { variant: "h2", children: item.data.title }) }));
|
|
94
|
+
case SectionTypes.setting:
|
|
95
|
+
return (_jsx(ListSection, { isStart: isStart, isEnd: isEnd, showBottomBorder: item?.showBottomBorder, outerStyle: item?.sectionOuterStyle, innerStyle: item?.sectionInnerStyle, children: _jsx(SettingRow, { ...item.data }) }));
|
|
96
|
+
case SectionTypes.view:
|
|
97
|
+
return (_jsx(ListSection, { isStart: isStart, isEnd: isEnd, showBottomBorder: item?.showBottomBorder, outerStyle: item?.sectionOuterStyle, innerStyle: item?.sectionInnerStyle, children: _jsx(View, { ...item.data, style: item.data.style }) }));
|
|
98
|
+
case SectionTypes.link:
|
|
99
|
+
return (_jsx(ListSection, { isStart: isStart, isEnd: isEnd, showBottomBorder: item?.showBottomBorder, outerStyle: item?.sectionOuterStyle, innerStyle: item?.sectionInnerStyle, children: _jsx(LinkRow, { ...item.data }) }));
|
|
100
|
+
case SectionTypes.hidden:
|
|
101
|
+
default:
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
} }) }));
|
|
113
105
|
}
|
|
114
106
|
function ListSection({ isStart, isEnd, showBottomBorder, outerStyle, innerStyle, children, }) {
|
|
115
107
|
const styles = useStyles({ isStart, isEnd });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification_settings_screen.js","sourceRoot":"","sources":["../../src/screens/notification_settings_screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE3E,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAkC,MAAM,cAAc,CAAA;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACpC,OAAO,EA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AAc,EAAE,eAAe;YAC/B,GAAG,EAAE,EAAE;SACR;QACD,WAAW,EAAE;YACX,IAAI,EAAE,CAAC;YACP,GAAG,EAAE,CAAC;SACP;QACD,YAAY,EAAE;YACZ,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;SACP;QACD,KAAK,EAAE,EAAE;QACT,cAAc,EAAE;YACd,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,yBAAyB;SAC9C;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,wBAAwB;SAC7C;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport { type ReactNode } from 'react'\nimport { FlatList, Platform, StyleSheet, View, type ViewProps, type ViewStyle } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Badge, Heading, Icon, Text } from '../components'\nimport { useTheme } from '../hooks'\nimport { isDefined } from '../types'\nimport { chatTypeLabel } from '../utils'\nimport { useGroups } from './notification_settings/hooks/groups'\nimport { useChatTypes } from './preferred_app/hooks/use_chat_types'\n\n// =========================================\n// ====== Factory Constants & Types ========\n// =========================================\n\nenum SectionTypes {\n header,\n hidden,\n setting,\n view,\n link,\n}\n\ntype SectionListData = Array<\n | DataItem<{ title: string }, SectionTypes.header>\n | DataItem<ViewProps, SectionTypes.view>\n | DataItem<SettingRowProps, SectionTypes.setting>\n | DataItem<LinkRowProps, SectionTypes.link>\n | DataItem<any, SectionTypes.hidden>\n>\n\ninterface DataItem<T, TName extends SectionTypes> {\n type: TName\n data: T\n sectionOuterStyle?: ViewStyle\n sectionInnerStyle?: ViewStyle\n showBottomBorder?: boolean\n}\n\n// =================================\n// ====== Components ===============\n// =================================\n\nexport type NotificationSettingsScreenProps = StaticScreenProps<{}>\n\nexport function NotificationSettingsScreen({}: NotificationSettingsScreenProps) {\n const navigation = useNavigation()\n const styles = useStyles()\n const { data: chatTypes } = useChatTypes()\n const { data: groups } = useGroups()\n const debugInsets = useSafeAreaInsets()\n\n // Build section data\n const listData = [\n {\n type: SectionTypes.header,\n data: { title: 'Preferred app' },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: SectionTypes.view,\n data: {\n children: (\n <Text variant=\"tertiary\" style={styles.sectionDescription}>\n Choose which app receives each type of chat notification\n </Text>\n ),\n },\n showBottomBorder: true,\n },\n ...chatTypes.map(type => ({\n type: SectionTypes.link,\n data: {\n title: chatTypeLabel(type.title),\n rightLabel: type.preferredApp,\n onPress: () =>\n navigation.navigate('PreferredAppSelection', {\n chatTypeId: type.id,\n }),\n },\n sectionInnerStyle: { paddingVertical: 0 },\n showBottomBorder: true,\n })),\n {\n type: groups.length === 0 ? SectionTypes.hidden : SectionTypes.header,\n data: {\n title: 'Manage chat settings',\n },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: groups.length === 0 ? SectionTypes.hidden : SectionTypes.view,\n data: {\n children: (\n <Text variant=\"tertiary\" style={styles.sectionDescription}>\n Notification settings for all of your group, team and event related conversations\n </Text>\n ),\n },\n showBottomBorder: true,\n },\n ...groups.map(group => ({\n type: SectionTypes.link,\n data: {\n title: group.name,\n subtitle: group.myGroupMembership?.notificationLevelDescription,\n rightLabel: group.sourceType,\n onPress: () =>\n navigation.navigate('GroupNotificationSettings', {\n groupId: group.id,\n title: group.name || 'Group',\n }),\n },\n sectionInnerStyle: { paddingVertical: 0 },\n showBottomBorder: true,\n })),\n ].filter(item => item.type !== SectionTypes.hidden)\n\n const headerIndices = listData\n .map(({ type }, index) => (type === SectionTypes.header ? index : undefined))\n .filter(isDefined)\n\n return (\n <View style={styles.listContainer}>\n <View\n style={{\n position: 'absolute',\n top: 0,\n right: 0,\n zIndex: 999,\n backgroundColor: 'magenta',\n padding: 8,\n }}\n >\n <Text style={{ color: 'white' }}>\n bottom={debugInsets.bottom} top={debugInsets.top}\n </Text>\n </View>\n <FlatList\n data={listData as SectionListData}\n contentContainerStyle={styles.contentContainer}\n renderItem={({ item, index }) => {\n const [isStart, isEnd] = [\n index === 0 || headerIndices.includes(index),\n index === listData.length - 1 || headerIndices.includes(index + 1),\n ]\n\n switch (item.type) {\n case SectionTypes.header:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Heading variant=\"h2\">{item.data.title}</Heading>\n </ListSection>\n )\n case SectionTypes.setting:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <SettingRow {...item.data} />\n </ListSection>\n )\n case SectionTypes.view:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <View {...item.data} style={item.data.style} />\n </ListSection>\n )\n case SectionTypes.link:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <LinkRow {...item.data} />\n </ListSection>\n )\n case SectionTypes.hidden:\n default:\n return null\n }\n }}\n />\n </View>\n )\n}\n\ninterface ListSectionProps {\n isStart?: boolean\n isEnd?: boolean\n showBottomBorder?: boolean\n outerStyle?: ViewStyle\n innerStyle?: ViewStyle\n children: ReactNode\n}\n\nfunction ListSection({\n isStart,\n isEnd,\n showBottomBorder,\n outerStyle,\n innerStyle,\n children,\n}: ListSectionProps) {\n const styles = useStyles({ isStart, isEnd })\n const bottomBorder = showBottomBorder ? styles.sectionInnerBottomBorder : {}\n\n return (\n <View style={[styles.sectionOuterBase, outerStyle]}>\n <View style={[styles.sectionInnerBase, bottomBorder, innerStyle]}>{children}</View>\n </View>\n )\n}\n\ninterface SettingRowProps {\n title: string\n style?: ViewStyle\n rightItem?: ReactNode\n rightLabel?: string\n rightItemStyle?: ViewStyle\n}\n\nfunction SettingRow({ title, style, rightLabel, rightItem, rightItemStyle = {} }: SettingRowProps) {\n const styles = useStyles()\n\n return (\n <View style={[styles.settingRow, style]}>\n <View style={styles.settingRowContent}>\n <Text variant=\"plain\" style={styles.settingRowText}>\n {title}\n </Text>\n {Boolean(rightLabel) && <Text variant=\"footnote\">{rightLabel}</Text>}\n </View>\n {Boolean(rightItem) && <View style={rightItemStyle}>{rightItem}</View>}\n </View>\n )\n}\n\ninterface LinkRowProps {\n title: string\n subtitle?: string\n rightLabel: string\n onPress: () => void\n}\n\nfunction LinkRow({ title, subtitle, rightLabel, onPress }: LinkRowProps) {\n const styles = useLinkRowStyles()\n const isSourceType = rightLabel === 'Team' || rightLabel === 'Group' || rightLabel === 'PlanTeam'\n\n return (\n <PlatformPressable\n style={styles.row}\n onPress={onPress}\n accessibilityRole=\"link\"\n accessibilityLabel={title}\n accessibilityHint={`Navigate to ${title} settings`}\n >\n <View style={styles.innerContainer}>\n <View style={styles.leftContent}>\n <Text style={styles.title} numberOfLines={2}>\n {title}\n </Text>\n {Boolean(subtitle) && <Text variant=\"tertiary\">{subtitle}</Text>}\n </View>\n <View style={styles.rightContent}>\n {isSourceType ? (\n <Badge label={rightLabel} appearance=\"neutral\" variant=\"meta\" />\n ) : (\n <Text numberOfLines={1} style={styles.rightLabelText}>\n {rightLabel}\n </Text>\n )}\n {Platform.OS === 'ios' && (\n <Icon name=\"general.rightChevron\" size={16} style={styles.icon} />\n )}\n </View>\n </View>\n </PlatformPressable>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({}: { isStart?: boolean; isEnd?: boolean } = {}) => {\n const { colors } = useTheme()\n const { bottom } = useSafeAreaInsets()\n const headerBottomPadding = 0\n\n return StyleSheet.create({\n listContainer: {\n flex: 1,\n },\n contentContainer: {\n paddingBottom: bottom,\n },\n sectionOuterBase: {\n paddingLeft: 16,\n },\n sectionInnerBase: {\n paddingRight: 16,\n paddingVertical: 16,\n },\n sectionInnerHeader: {\n paddingTop: 24,\n paddingBottom: headerBottomPadding,\n },\n sectionInnerBottomBorder: {\n borderBottomColor: colors.borderColorDefaultBase,\n borderBottomWidth: 1,\n },\n sectionDescription: {\n color: colors.textColorDefaultSecondary,\n },\n settingRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n gap: 8,\n },\n settingRowContent: {\n flex: 1,\n },\n settingRowText: {\n lineHeight: 20,\n },\n })\n}\n\nconst useLinkRowStyles = () => {\n const theme = useTheme()\n\n return StyleSheet.create({\n row: {\n paddingLeft: 0,\n paddingVertical: 16,\n },\n innerContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 12,\n },\n leftContent: {\n flex: 1,\n gap: 4,\n },\n rightContent: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 8,\n },\n title: {},\n rightLabelText: {\n color: theme.colors.textColorDefaultSecondary,\n },\n icon: {\n color: theme.colors.iconColorDefaultDisabled,\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"notification_settings_screen.js","sourceRoot":"","sources":["../../src/screens/notification_settings_screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE3E,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAkC,MAAM,cAAc,CAAA;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,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;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,wBAAwB;SAC7C;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport { type ReactNode } from 'react'\nimport { FlatList, Platform, StyleSheet, View, type ViewProps, type ViewStyle } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Badge, Heading, Icon, Text } from '../components'\nimport { useTheme } from '../hooks'\nimport { isDefined } from '../types'\nimport { chatTypeLabel } from '../utils'\nimport { useGroups } from './notification_settings/hooks/groups'\nimport { useChatTypes } from './preferred_app/hooks/use_chat_types'\n\n// =========================================\n// ====== Factory Constants & Types ========\n// =========================================\n\nenum SectionTypes {\n header,\n hidden,\n setting,\n view,\n link,\n}\n\ntype SectionListData = Array<\n | DataItem<{ title: string }, SectionTypes.header>\n | DataItem<ViewProps, SectionTypes.view>\n | DataItem<SettingRowProps, SectionTypes.setting>\n | DataItem<LinkRowProps, SectionTypes.link>\n | DataItem<any, SectionTypes.hidden>\n>\n\ninterface DataItem<T, TName extends SectionTypes> {\n type: TName\n data: T\n sectionOuterStyle?: ViewStyle\n sectionInnerStyle?: ViewStyle\n showBottomBorder?: boolean\n}\n\n// =================================\n// ====== Components ===============\n// =================================\n\nexport type NotificationSettingsScreenProps = StaticScreenProps<{}>\n\nexport function NotificationSettingsScreen({}: NotificationSettingsScreenProps) {\n const navigation = useNavigation()\n const styles = useStyles()\n const { data: chatTypes } = useChatTypes()\n const { data: groups } = useGroups()\n\n // Build section data\n const listData = [\n {\n type: SectionTypes.header,\n data: { title: 'Preferred app' },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: SectionTypes.view,\n data: {\n children: (\n <Text variant=\"tertiary\" style={styles.sectionDescription}>\n Choose which app receives each type of chat notification\n </Text>\n ),\n },\n showBottomBorder: true,\n },\n ...chatTypes.map(type => ({\n type: SectionTypes.link,\n data: {\n title: chatTypeLabel(type.title),\n rightLabel: type.preferredApp,\n onPress: () =>\n navigation.navigate('PreferredAppSelection', {\n chatTypeId: type.id,\n }),\n },\n sectionInnerStyle: { paddingVertical: 0 },\n showBottomBorder: true,\n })),\n {\n type: groups.length === 0 ? SectionTypes.hidden : SectionTypes.header,\n data: {\n title: 'Manage chat settings',\n },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: groups.length === 0 ? SectionTypes.hidden : SectionTypes.view,\n data: {\n children: (\n <Text variant=\"tertiary\" style={styles.sectionDescription}>\n Notification settings for all of your group, team and event related conversations\n </Text>\n ),\n },\n showBottomBorder: true,\n },\n ...groups.map(group => ({\n type: SectionTypes.link,\n data: {\n title: group.name,\n subtitle: group.myGroupMembership?.notificationLevelDescription,\n rightLabel: group.sourceType,\n onPress: () =>\n navigation.navigate('GroupNotificationSettings', {\n groupId: group.id,\n title: group.name || 'Group',\n }),\n },\n sectionInnerStyle: { paddingVertical: 0 },\n showBottomBorder: true,\n })),\n ].filter(item => item.type !== SectionTypes.hidden)\n\n const headerIndices = listData\n .map(({ type }, index) => (type === SectionTypes.header ? index : undefined))\n .filter(isDefined)\n\n return (\n <View style={styles.listContainer}>\n <FlatList\n data={listData as SectionListData}\n contentContainerStyle={styles.contentContainer}\n renderItem={({ item, index }) => {\n const [isStart, isEnd] = [\n index === 0 || headerIndices.includes(index),\n index === listData.length - 1 || headerIndices.includes(index + 1),\n ]\n\n switch (item.type) {\n case SectionTypes.header:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Heading variant=\"h2\">{item.data.title}</Heading>\n </ListSection>\n )\n case SectionTypes.setting:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <SettingRow {...item.data} />\n </ListSection>\n )\n case SectionTypes.view:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <View {...item.data} style={item.data.style} />\n </ListSection>\n )\n case SectionTypes.link:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <LinkRow {...item.data} />\n </ListSection>\n )\n case SectionTypes.hidden:\n default:\n return null\n }\n }}\n />\n </View>\n )\n}\n\ninterface ListSectionProps {\n isStart?: boolean\n isEnd?: boolean\n showBottomBorder?: boolean\n outerStyle?: ViewStyle\n innerStyle?: ViewStyle\n children: ReactNode\n}\n\nfunction ListSection({\n isStart,\n isEnd,\n showBottomBorder,\n outerStyle,\n innerStyle,\n children,\n}: ListSectionProps) {\n const styles = useStyles({ isStart, isEnd })\n const bottomBorder = showBottomBorder ? styles.sectionInnerBottomBorder : {}\n\n return (\n <View style={[styles.sectionOuterBase, outerStyle]}>\n <View style={[styles.sectionInnerBase, bottomBorder, innerStyle]}>{children}</View>\n </View>\n )\n}\n\ninterface SettingRowProps {\n title: string\n style?: ViewStyle\n rightItem?: ReactNode\n rightLabel?: string\n rightItemStyle?: ViewStyle\n}\n\nfunction SettingRow({ title, style, rightLabel, rightItem, rightItemStyle = {} }: SettingRowProps) {\n const styles = useStyles()\n\n return (\n <View style={[styles.settingRow, style]}>\n <View style={styles.settingRowContent}>\n <Text variant=\"plain\" style={styles.settingRowText}>\n {title}\n </Text>\n {Boolean(rightLabel) && <Text variant=\"footnote\">{rightLabel}</Text>}\n </View>\n {Boolean(rightItem) && <View style={rightItemStyle}>{rightItem}</View>}\n </View>\n )\n}\n\ninterface LinkRowProps {\n title: string\n subtitle?: string\n rightLabel: string\n onPress: () => void\n}\n\nfunction LinkRow({ title, subtitle, rightLabel, onPress }: LinkRowProps) {\n const styles = useLinkRowStyles()\n const isSourceType = rightLabel === 'Team' || rightLabel === 'Group' || rightLabel === 'PlanTeam'\n\n return (\n <PlatformPressable\n style={styles.row}\n onPress={onPress}\n accessibilityRole=\"link\"\n accessibilityLabel={title}\n accessibilityHint={`Navigate to ${title} settings`}\n >\n <View style={styles.innerContainer}>\n <View style={styles.leftContent}>\n <Text style={styles.title} numberOfLines={2}>\n {title}\n </Text>\n {Boolean(subtitle) && <Text variant=\"tertiary\">{subtitle}</Text>}\n </View>\n <View style={styles.rightContent}>\n {isSourceType ? (\n <Badge label={rightLabel} appearance=\"neutral\" variant=\"meta\" />\n ) : (\n <Text numberOfLines={1} style={styles.rightLabelText}>\n {rightLabel}\n </Text>\n )}\n {Platform.OS === 'ios' && (\n <Icon name=\"general.rightChevron\" size={16} style={styles.icon} />\n )}\n </View>\n </View>\n </PlatformPressable>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({}: { isStart?: boolean; isEnd?: boolean } = {}) => {\n const { colors } = useTheme()\n const { bottom } = useSafeAreaInsets()\n const headerBottomPadding = 0\n\n return StyleSheet.create({\n listContainer: {\n flex: 1,\n },\n contentContainer: {\n paddingBottom: bottom,\n },\n sectionOuterBase: {\n paddingLeft: 16,\n },\n sectionInnerBase: {\n paddingRight: 16,\n paddingVertical: 16,\n },\n sectionInnerHeader: {\n paddingTop: 24,\n paddingBottom: headerBottomPadding,\n },\n sectionInnerBottomBorder: {\n borderBottomColor: colors.borderColorDefaultBase,\n borderBottomWidth: 1,\n },\n sectionDescription: {\n color: colors.textColorDefaultSecondary,\n },\n settingRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n gap: 8,\n },\n settingRowContent: {\n flex: 1,\n },\n settingRowText: {\n lineHeight: 20,\n },\n })\n}\n\nconst useLinkRowStyles = () => {\n const theme = useTheme()\n\n return StyleSheet.create({\n row: {\n paddingLeft: 0,\n paddingVertical: 16,\n },\n innerContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 12,\n },\n leftContent: {\n flex: 1,\n gap: 4,\n },\n rightContent: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 8,\n },\n title: {},\n rightLabelText: {\n color: theme.colors.textColorDefaultSecondary,\n },\n icon: {\n color: theme.colors.iconColorDefaultDisabled,\n },\n })\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
|
-
export declare const ReactionsScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
2
|
+
export declare const ReactionsScreenOptions: () => import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
3
3
|
export type ReactionScreenProps = StaticScreenProps<{
|
|
4
4
|
message_id: string;
|
|
5
5
|
conversation_id: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactions_screen.d.ts","sourceRoot":"","sources":["../../src/screens/reactions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAe5D,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"reactions_screen.d.ts","sourceRoot":"","sources":["../../src/screens/reactions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAe5D,eAAO,MAAM,sBAAsB,6EAMjC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;IAClD,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,EAAE,mBAAmB,2CAkE7D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
|
-
export declare const SendGiphyScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
2
|
+
export declare const SendGiphyScreenOptions: () => import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
3
3
|
export type SendGiphyScreenProps = StaticScreenProps<{
|
|
4
4
|
conversation_id: number;
|
|
5
5
|
search_term: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send_giphy_screen.d.ts","sourceRoot":"","sources":["../../src/screens/send_giphy_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAYzF,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"send_giphy_screen.d.ts","sourceRoot":"","sources":["../../src/screens/send_giphy_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAYzF,eAAO,MAAM,sBAAsB,6EAGjC,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;IACnD,eAAe,EAAE,MAAM,CAAA;IACvB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAC,CAAA;AAEF,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,EAAE,oBAAoB,2CA6G9D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
|
-
export declare const SystemMessagePeopleScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
2
|
+
export declare const SystemMessagePeopleScreenOptions: () => import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
3
3
|
export type SystemMessagePeopleScreenProps = StaticScreenProps<{
|
|
4
4
|
conversation_id: number;
|
|
5
5
|
person_ids: number[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system_message_people_screen.d.ts","sourceRoot":"","sources":["../../src/screens/system_message_people_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAU5D,eAAO,MAAM,gCAAgC,
|
|
1
|
+
{"version":3,"file":"system_message_people_screen.d.ts","sourceRoot":"","sources":["../../src/screens/system_message_people_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAU5D,eAAO,MAAM,gCAAgC,6EAM3C,CAAA;AAEF,MAAM,MAAM,8BAA8B,GAAG,iBAAiB,CAAC;IAC7D,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB,CAAC,CAAA;AAEF,wBAAgB,yBAAyB,CAAC,EAAE,KAAK,EAAE,EAAE,8BAA8B,2CA8BlF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/chat-react-native",
|
|
3
|
-
"version": "3.43.1-qa-858.
|
|
3
|
+
"version": "3.43.1-qa-858.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"react-native": "./src/index.tsx",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
|
28
28
|
"@fortawesome/react-native-fontawesome": "^0.3.2",
|
|
29
|
-
"@planningcenter/emoji-keyboard": "3.43.1-qa-858.
|
|
29
|
+
"@planningcenter/emoji-keyboard": "3.43.1-qa-858.1",
|
|
30
30
|
"lodash-inflection": "^1.5.0",
|
|
31
31
|
"react-compiler-runtime": "^1.0.0"
|
|
32
32
|
},
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"sf-symbols-typescript": "^2.2.0",
|
|
74
74
|
"typescript": "~6.0.3"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "06ee4a86be619508aa1b9011ff64e155ce0c10b0"
|
|
77
77
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useNavigation } from '@react-navigation/native'
|
|
2
2
|
import React, { useMemo } from 'react'
|
|
3
|
-
import { FlatList, StyleSheet,
|
|
4
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
3
|
+
import { FlatList, StyleSheet, View } from 'react-native'
|
|
5
4
|
import { useConversationsContext } from '../../contexts/conversations_context'
|
|
6
5
|
import { useTheme } from '../../hooks'
|
|
7
6
|
import { useCanCreateConversations } from '../../hooks/use_chat_permissions'
|
|
@@ -37,7 +36,6 @@ export const Conversations = ({ ListHeaderComponent }: ConversationsProps) => {
|
|
|
37
36
|
const isFilterApplied = !!chat_group_graph_id || !!group_source_app_name
|
|
38
37
|
|
|
39
38
|
const showBadges = !chat_group_graph_id
|
|
40
|
-
const debugInsets = useSafeAreaInsets()
|
|
41
39
|
|
|
42
40
|
const data: FlatListItem[] = useMemo(() => {
|
|
43
41
|
if (isLoading) {
|
|
@@ -58,20 +56,6 @@ export const Conversations = ({ ListHeaderComponent }: ConversationsProps) => {
|
|
|
58
56
|
|
|
59
57
|
return (
|
|
60
58
|
<View style={styles.container}>
|
|
61
|
-
<View
|
|
62
|
-
style={{
|
|
63
|
-
position: 'absolute',
|
|
64
|
-
top: 0,
|
|
65
|
-
right: 0,
|
|
66
|
-
zIndex: 999,
|
|
67
|
-
backgroundColor: 'magenta',
|
|
68
|
-
padding: 8,
|
|
69
|
-
}}
|
|
70
|
-
>
|
|
71
|
-
<Text style={{ color: 'white' }}>
|
|
72
|
-
bottom={debugInsets.bottom} top={debugInsets.top}
|
|
73
|
-
</Text>
|
|
74
|
-
</View>
|
|
75
59
|
<FlatList
|
|
76
60
|
data={data}
|
|
77
61
|
keyExtractor={item => item.id.toString()}
|
|
@@ -22,24 +22,28 @@ import { Button, Heading, Icon, IconString, Text, TextButton } from '../display'
|
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Screen options for the formsheet's NativeStackNavigation route
|
|
25
|
+
*
|
|
26
|
+
* Returns a factory rather than an object because callers assign it at module
|
|
27
|
+
* scope, which runs before ChatProvider reports the host's liquid glass
|
|
28
|
+
* capability. React Navigation calls the factory per render, so the sheet
|
|
29
|
+
* corner radius is resolved once that capability is known.
|
|
30
|
+
*
|
|
25
31
|
* @param {string} options.headerTitle - Doesn't show in UI but good to have for semantic reasons.
|
|
26
32
|
* @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.
|
|
27
33
|
* @param {NativeStackNavigationOptions} [options.rest] - Adds or overrides any valid NativeStackNavigationOptions
|
|
28
|
-
* @returns {NativeStackNavigationOptions}
|
|
34
|
+
* @returns {() => NativeStackNavigationOptions} Factory producing merged NativeStackNavigationOptions
|
|
29
35
|
*/
|
|
30
|
-
export const getFormSheetScreenOptions =
|
|
31
|
-
headerTitle,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
...rest,
|
|
42
|
-
})
|
|
36
|
+
export const getFormSheetScreenOptions =
|
|
37
|
+
({ headerTitle, sheetAllowedDetents = [0.25], ...rest }: NativeStackNavigationOptions = {}) =>
|
|
38
|
+
(): NativeStackNavigationOptions => ({
|
|
39
|
+
presentation: 'formSheet',
|
|
40
|
+
headerShown: false,
|
|
41
|
+
sheetAllowedDetents,
|
|
42
|
+
sheetCornerRadius: isLiquidGlassEnabled() ? undefined : 16,
|
|
43
|
+
sheetGrabberVisible: true,
|
|
44
|
+
headerTitle,
|
|
45
|
+
...rest,
|
|
46
|
+
})
|
|
43
47
|
|
|
44
48
|
const FormSheet = {
|
|
45
49
|
Root: FormSheetRoot,
|
|
@@ -137,6 +137,9 @@ const useStyles = () => {
|
|
|
137
137
|
ios: 20,
|
|
138
138
|
android: 20 + top,
|
|
139
139
|
}),
|
|
140
|
+
// The filter list scrolls under it, so the sheet header doesn't need a
|
|
141
|
+
// separator the way the non-scrolling reaction sheet does.
|
|
142
|
+
borderBottomWidth: 0,
|
|
140
143
|
},
|
|
141
144
|
})
|
|
142
145
|
}
|
|
@@ -49,7 +49,6 @@ export function NotificationSettingsScreen({}: NotificationSettingsScreenProps)
|
|
|
49
49
|
const styles = useStyles()
|
|
50
50
|
const { data: chatTypes } = useChatTypes()
|
|
51
51
|
const { data: groups } = useGroups()
|
|
52
|
-
const debugInsets = useSafeAreaInsets()
|
|
53
52
|
|
|
54
53
|
// Build section data
|
|
55
54
|
const listData = [
|
|
@@ -123,20 +122,6 @@ export function NotificationSettingsScreen({}: NotificationSettingsScreenProps)
|
|
|
123
122
|
|
|
124
123
|
return (
|
|
125
124
|
<View style={styles.listContainer}>
|
|
126
|
-
<View
|
|
127
|
-
style={{
|
|
128
|
-
position: 'absolute',
|
|
129
|
-
top: 0,
|
|
130
|
-
right: 0,
|
|
131
|
-
zIndex: 999,
|
|
132
|
-
backgroundColor: 'magenta',
|
|
133
|
-
padding: 8,
|
|
134
|
-
}}
|
|
135
|
-
>
|
|
136
|
-
<Text style={{ color: 'white' }}>
|
|
137
|
-
bottom={debugInsets.bottom} top={debugInsets.top}
|
|
138
|
-
</Text>
|
|
139
|
-
</View>
|
|
140
125
|
<FlatList
|
|
141
126
|
data={listData as SectionListData}
|
|
142
127
|
contentContainerStyle={styles.contentContainer}
|