@planningcenter/chat-react-native 3.7.0-rc.7 → 3.7.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/primitive/form_sheet.d.ts +41 -0
- package/build/components/primitive/form_sheet.d.ts.map +1 -0
- package/build/components/primitive/{actions_form_sheet.js → form_sheet.js} +43 -24
- package/build/components/primitive/form_sheet.js.map +1 -0
- package/build/navigation/index.d.ts +1 -72
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +1 -4
- package/build/navigation/index.js.map +1 -1
- package/build/screens/attachment_actions/attachment_actions_screen.d.ts.map +1 -1
- package/build/screens/attachment_actions/attachment_actions_screen.js +8 -6
- package/build/screens/attachment_actions/attachment_actions_screen.js.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/message_read_receipts_screen.js +28 -39
- package/build/screens/conversation/message_read_receipts_screen.js.map +1 -1
- package/build/screens/conversation_filters_screen.d.ts.map +1 -1
- package/build/screens/conversation_filters_screen.js +1 -4
- package/build/screens/conversation_filters_screen.js.map +1 -1
- package/build/utils/index.d.ts +0 -1
- package/build/utils/index.d.ts.map +1 -1
- package/build/utils/index.js +0 -1
- package/build/utils/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/primitive/{actions_form_sheet.tsx → form_sheet.tsx} +61 -35
- package/src/navigation/index.tsx +1 -4
- package/src/screens/attachment_actions/attachment_actions_screen.tsx +8 -8
- package/src/screens/conversation/message_read_receipts_screen.tsx +37 -51
- package/src/screens/conversation_filters_screen.tsx +1 -4
- package/src/utils/index.ts +0 -1
- package/build/components/primitive/actions_form_sheet.d.ts +0 -34
- package/build/components/primitive/actions_form_sheet.d.ts.map +0 -1
- package/build/components/primitive/actions_form_sheet.js.map +0 -1
- package/build/utils/navigation_constants.d.ts +0 -2
- package/build/utils/navigation_constants.d.ts.map +0 -1
- package/build/utils/navigation_constants.js +0 -11
- package/build/utils/navigation_constants.js.map +0 -1
- package/src/utils/navigation_constants.ts +0 -12
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
import { AccessibilityRole } from 'react-native';
|
|
4
|
+
import { IconString } from '../display';
|
|
5
|
+
/**
|
|
6
|
+
* Screen options for the formsheet's NativeStackNavigation route
|
|
7
|
+
* @param {string} options.headerTitle - Doesn't show in UI but good to have for semantic reasons.
|
|
8
|
+
* @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.
|
|
9
|
+
* @param {NativeStackNavigationOptions} [options.rest] - Adds or overrides any valid NativeStackNavigationOptions
|
|
10
|
+
* @returns {NativeStackNavigationOptions} Merged NativeStackNavigationOptions
|
|
11
|
+
*/
|
|
12
|
+
export declare const getFormSheetScreenOptions: ({ headerTitle, sheetAllowedDetents, ...rest }?: NativeStackNavigationOptions) => NativeStackNavigationOptions;
|
|
13
|
+
type FormSheetComponents = {
|
|
14
|
+
Root: React.FC<FormSheetRootProps>;
|
|
15
|
+
Action: React.FC<FormSheetActionProps>;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: FormSheetComponents;
|
|
18
|
+
export default _default;
|
|
19
|
+
export type { FormSheetRootProps, FormSheetActionProps };
|
|
20
|
+
interface FormSheetRootProps {
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export declare function FormSheetRoot({ children }: FormSheetRootProps): React.JSX.Element;
|
|
24
|
+
export declare namespace FormSheetRoot {
|
|
25
|
+
var displayName: string;
|
|
26
|
+
}
|
|
27
|
+
declare const FORM_SHEET_ACTION_APPEARANCES: {
|
|
28
|
+
readonly neutral: "neutral";
|
|
29
|
+
readonly danger: "danger";
|
|
30
|
+
};
|
|
31
|
+
type FormSheetActionAppearanceUnion = (typeof FORM_SHEET_ACTION_APPEARANCES)[keyof typeof FORM_SHEET_ACTION_APPEARANCES];
|
|
32
|
+
interface FormSheetActionProps {
|
|
33
|
+
title: string;
|
|
34
|
+
iconName: IconString;
|
|
35
|
+
onPress: () => void;
|
|
36
|
+
accessibilityLabel?: string;
|
|
37
|
+
accessibilityHint?: string;
|
|
38
|
+
accessibilityRole?: AccessibilityRole;
|
|
39
|
+
appearance?: FormSheetActionAppearanceUnion;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=form_sheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form_sheet.d.ts","sourceRoot":"","sources":["../../../src/components/primitive/form_sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAA8B,MAAM,cAAc,CAAA;AAI5E,OAAO,EAAQ,UAAU,EAAQ,MAAM,YAAY,CAAA;AAMnD;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,mDAInC,4BAA4B,KAAQ,4BAQrC,CAAA;AAOF,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAA;IAClC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAA;CACvC,CAAA;wBAE2B,mBAAmB;AAA/C,wBAA+C;AAC/C,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,CAAA;AAMxD,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,kBAAkB,qBAS7D;yBATe,aAAa;;;AA8B7B,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,EAAE,UAAU,CAAA;IACpB,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;CAC5C"}
|
|
@@ -1,47 +1,66 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { StyleSheet, View } from 'react-native';
|
|
2
|
+
import { Platform, StyleSheet, View } from 'react-native';
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
4
|
import { useTheme } from '../../hooks';
|
|
5
|
-
import { PLATFORM_SHEET_ALLOWED_DETENTS_FIT_TO_CONTENTS } from '../../utils/navigation_constants';
|
|
6
5
|
import { PlatformPressable } from '@react-navigation/elements';
|
|
7
6
|
import { Icon, Text } from '../display';
|
|
8
7
|
// =================================
|
|
9
8
|
// ====== Exports ==================
|
|
10
9
|
// =================================
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Screen options for the formsheet's NativeStackNavigation route
|
|
12
|
+
* @param {string} options.headerTitle - Doesn't show in UI but good to have for semantic reasons.
|
|
13
|
+
* @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.
|
|
14
|
+
* @param {NativeStackNavigationOptions} [options.rest] - Adds or overrides any valid NativeStackNavigationOptions
|
|
15
|
+
* @returns {NativeStackNavigationOptions} Merged NativeStackNavigationOptions
|
|
16
|
+
*/
|
|
17
|
+
export const getFormSheetScreenOptions = ({ headerTitle, sheetAllowedDetents = [0.25], ...rest } = {}) => ({
|
|
12
18
|
presentation: 'formSheet',
|
|
13
19
|
headerShown: false,
|
|
14
|
-
sheetAllowedDetents
|
|
20
|
+
sheetAllowedDetents,
|
|
15
21
|
sheetCornerRadius: 16,
|
|
22
|
+
sheetGrabberVisible: true,
|
|
23
|
+
headerTitle,
|
|
24
|
+
...rest,
|
|
25
|
+
});
|
|
26
|
+
const FormSheet = {
|
|
27
|
+
Root: FormSheetRoot,
|
|
28
|
+
Action: FormSheetAction,
|
|
16
29
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Action: ActionsFormSheetAction,
|
|
20
|
-
};
|
|
21
|
-
export default ActionsFormSheet;
|
|
22
|
-
export function ActionsFormSheetRoot({ children }) {
|
|
30
|
+
export default FormSheet;
|
|
31
|
+
export function FormSheetRoot({ children }) {
|
|
23
32
|
const styles = useStyles();
|
|
24
33
|
return (<View style={styles.container}>
|
|
25
|
-
<
|
|
26
|
-
<View style={styles.
|
|
34
|
+
<AndroidSheetGrabber />
|
|
35
|
+
<View style={styles.content}>{children}</View>
|
|
27
36
|
</View>);
|
|
28
37
|
}
|
|
29
|
-
|
|
38
|
+
FormSheetRoot.displayName = 'FormSheet.Root';
|
|
39
|
+
// ====================================
|
|
40
|
+
// ====== AndroidSheetGrabber =========
|
|
41
|
+
// ====================================
|
|
42
|
+
function AndroidSheetGrabber() {
|
|
43
|
+
const styles = useStyles();
|
|
44
|
+
return Platform.select({
|
|
45
|
+
android: <View style={styles.androidSheetGrabber}/>,
|
|
46
|
+
ios: null,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
30
49
|
// ====================================
|
|
31
50
|
// ====== ActionsFormSheetAction ======
|
|
32
51
|
// ====================================
|
|
33
|
-
const
|
|
52
|
+
const FORM_SHEET_ACTION_APPEARANCES = {
|
|
34
53
|
neutral: 'neutral',
|
|
35
54
|
danger: 'danger',
|
|
36
55
|
};
|
|
37
|
-
function
|
|
56
|
+
function FormSheetAction({ title, iconName, onPress, accessibilityLabel, accessibilityHint, accessibilityRole = 'button', appearance = 'neutral', }) {
|
|
38
57
|
const styles = useStyles({ appearance });
|
|
39
58
|
return (<PlatformPressable onPress={onPress} accessibilityLabel={accessibilityLabel} accessibilityHint={accessibilityHint} accessibilityRole={accessibilityRole} style={styles.actionPressable}>
|
|
40
59
|
<Icon name={iconName} size={16} accessibilityElementsHidden style={styles.actionIcon}/>
|
|
41
60
|
<Text style={styles.actionTitle}>{title}</Text>
|
|
42
61
|
</PlatformPressable>);
|
|
43
62
|
}
|
|
44
|
-
|
|
63
|
+
FormSheetAction.displayName = 'FormSheet.Action';
|
|
45
64
|
const useStyles = ({ appearance = 'neutral' } = {}) => {
|
|
46
65
|
const { colors } = useTheme();
|
|
47
66
|
const { bottom } = useSafeAreaInsets();
|
|
@@ -59,20 +78,20 @@ const useStyles = ({ appearance = 'neutral' } = {}) => {
|
|
|
59
78
|
container: {
|
|
60
79
|
flex: 1,
|
|
61
80
|
justifyContent: 'flex-start',
|
|
62
|
-
paddingTop: 12,
|
|
63
81
|
paddingBottom: bottom,
|
|
64
82
|
width: '100%',
|
|
65
83
|
backgroundColor: colors.fillColorNeutral100Inverted,
|
|
66
84
|
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
85
|
+
androidSheetGrabber: {
|
|
86
|
+
marginTop: 5,
|
|
87
|
+
width: 34,
|
|
88
|
+
height: 5,
|
|
89
|
+
backgroundColor: colors.fillColorNeutral040,
|
|
71
90
|
borderRadius: 100,
|
|
72
91
|
alignSelf: 'center',
|
|
73
92
|
},
|
|
74
|
-
|
|
75
|
-
paddingTop: 20,
|
|
93
|
+
content: {
|
|
94
|
+
paddingTop: Platform.select({ android: 16, ios: 20 }),
|
|
76
95
|
},
|
|
77
96
|
actionPressable: {
|
|
78
97
|
flexDirection: 'row',
|
|
@@ -89,4 +108,4 @@ const useStyles = ({ appearance = 'neutral' } = {}) => {
|
|
|
89
108
|
},
|
|
90
109
|
});
|
|
91
110
|
};
|
|
92
|
-
//# sourceMappingURL=
|
|
111
|
+
//# sourceMappingUR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AK,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC,SAAS;SACjD;QACD,WAAW,EAAE;YACX,KAAK,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC,SAAS;SACjD;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { NativeStackNavigationOptions } from '@react-navigation/native-stack'\nimport React, { ReactNode } from 'react'\nimport { AccessibilityRole, Platform, StyleSheet, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { useTheme } from '../../hooks'\nimport { PlatformPressable } from '@react-navigation/elements'\nimport { Icon, IconString, Text } 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: 16,\n sheetGrabberVisible: true,\n headerTitle,\n ...rest,\n})\n\nconst FormSheet = {\n Root: FormSheetRoot,\n Action: FormSheetAction,\n} as const\n\ntype FormSheetComponents = {\n Root: React.FC<FormSheetRootProps>\n Action: React.FC<FormSheetActionProps>\n}\n\nexport default FormSheet as FormSheetComponents\nexport type { FormSheetRootProps, FormSheetActionProps }\n\n// ====================================\n// ====== ActionsFormSheetRoot ========\n// ====================================\n\ninterface FormSheetRootProps {\n children: ReactNode\n}\n\nexport function FormSheetRoot({ children }: FormSheetRootProps) {\n const styles = useStyles()\n\n return (\n <View style={styles.container}>\n <AndroidSheetGrabber />\n <View style={styles.content}>{children}</View>\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// ====== 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}\n\nfunction FormSheetAction({\n title,\n iconName,\n onPress,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole = 'button',\n appearance = 'neutral',\n}: FormSheetActionProps) {\n const styles = useStyles({ appearance })\n\n return (\n <PlatformPressable\n onPress={onPress}\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n accessibilityRole={accessibilityRole}\n style={styles.actionPressable}\n >\n <Icon name={iconName} size={16} accessibilityElementsHidden style={styles.actionIcon} />\n <Text style={styles.actionTitle}>{title}</Text>\n </PlatformPressable>\n )\n}\n\nFormSheetAction.displayName = 'FormSheet.Action'\n\n// ==================================\n// ====== Styles ====================\n// ==================================\n\ninterface Styles {\n appearance?: FormSheetActionAppearanceUnion\n}\n\nconst useStyles = ({ appearance = 'neutral' }: Styles = {}) => {\n const { colors } = useTheme()\n const { bottom } = useSafeAreaInsets()\n\n const appearanceColorsMap = {\n neutral: {\n iconColor: colors.iconColorDefaultPrimary,\n textColor: colors.textColorDefaultPrimary,\n },\n danger: {\n iconColor: colors.fillColorStatusErrorMedium,\n textColor: colors.fillColorStatusErrorMedium,\n },\n }\n\n return StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'flex-start',\n paddingBottom: bottom,\n width: '100%',\n backgroundColor: colors.fillColorNeutral100Inverted,\n },\n androidSheetGrabber: {\n marginTop: 5,\n width: 34,\n height: 5,\n backgroundColor: colors.fillColorNeutral040,\n borderRadius: 100,\n alignSelf: 'center',\n },\n content: {\n paddingTop: Platform.select({ android: 16, ios: 20 }),\n },\n actionPressable: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingVertical: 12,\n paddingHorizontal: 16,\n gap: 8,\n },\n actionIcon: {\n color: appearanceColorsMap[appearance].iconColor,\n },\n actionTitle: {\n color: appearanceColorsMap[appearance].textColor,\n },\n })\n}\n"]}
|
|
@@ -252,78 +252,7 @@ export declare const ChatStack: import("@react-navigation/native").TypedNavigato
|
|
|
252
252
|
};
|
|
253
253
|
readonly MessageReadReceipts: {
|
|
254
254
|
readonly screen: typeof MessageReadReceiptsScreen;
|
|
255
|
-
readonly options:
|
|
256
|
-
readonly headerTitle: "Read receipts";
|
|
257
|
-
readonly title?: string;
|
|
258
|
-
readonly header?: (props: import("@react-navigation/native-stack").NativeStackHeaderProps) => React.ReactNode;
|
|
259
|
-
readonly headerBackVisible?: boolean;
|
|
260
|
-
readonly headerBackTitle?: string;
|
|
261
|
-
readonly headerBackTitleStyle?: import("react-native").StyleProp<{
|
|
262
|
-
fontFamily?: string;
|
|
263
|
-
fontSize?: number;
|
|
264
|
-
}>;
|
|
265
|
-
readonly headerBackImageSource?: import("react-native").ImageSourcePropType;
|
|
266
|
-
readonly headerLargeStyle?: import("react-native").StyleProp<{
|
|
267
|
-
backgroundColor?: string;
|
|
268
|
-
}>;
|
|
269
|
-
readonly headerLargeTitle?: boolean;
|
|
270
|
-
readonly headerLargeTitleShadowVisible?: boolean;
|
|
271
|
-
readonly headerLargeTitleStyle?: import("react-native").StyleProp<{
|
|
272
|
-
fontFamily?: string;
|
|
273
|
-
fontSize?: number;
|
|
274
|
-
fontWeight?: string;
|
|
275
|
-
color?: string;
|
|
276
|
-
}>;
|
|
277
|
-
readonly headerShown?: boolean;
|
|
278
|
-
readonly headerStyle?: import("react-native").StyleProp<{
|
|
279
|
-
backgroundColor?: string;
|
|
280
|
-
}>;
|
|
281
|
-
readonly headerShadowVisible?: boolean;
|
|
282
|
-
readonly headerTransparent?: boolean;
|
|
283
|
-
readonly headerBlurEffect?: import("react-native-screens").ScreenStackHeaderConfigProps["blurEffect"];
|
|
284
|
-
readonly headerTintColor?: string;
|
|
285
|
-
readonly headerBackground?: () => React.ReactNode;
|
|
286
|
-
readonly headerLeft?: (props: import("@react-navigation/native-stack").NativeStackHeaderLeftProps) => React.ReactNode;
|
|
287
|
-
readonly headerRight?: (props: NativeStackHeaderRightProps) => React.ReactNode;
|
|
288
|
-
readonly headerTitleAlign?: "left" | "center";
|
|
289
|
-
readonly headerTitleStyle?: import("react-native").StyleProp<Pick<import("react-native").TextStyle, "fontFamily" | "fontSize" | "fontWeight"> & {
|
|
290
|
-
color?: string;
|
|
291
|
-
}>;
|
|
292
|
-
readonly headerSearchBarOptions?: import("react-native-screens").SearchBarProps;
|
|
293
|
-
readonly headerBackButtonMenuEnabled?: boolean;
|
|
294
|
-
readonly headerBackButtonDisplayMode?: import("react-native-screens").ScreenStackHeaderConfigProps["backButtonDisplayMode"];
|
|
295
|
-
readonly autoHideHomeIndicator?: boolean;
|
|
296
|
-
readonly keyboardHandlingEnabled?: boolean;
|
|
297
|
-
readonly navigationBarColor?: string;
|
|
298
|
-
readonly navigationBarTranslucent?: boolean;
|
|
299
|
-
readonly navigationBarHidden?: boolean;
|
|
300
|
-
readonly statusBarAnimation?: import("react-native-screens").ScreenProps["statusBarAnimation"];
|
|
301
|
-
readonly statusBarBackgroundColor?: string;
|
|
302
|
-
readonly statusBarHidden?: boolean;
|
|
303
|
-
readonly statusBarStyle?: import("react-native-screens").ScreenProps["statusBarStyle"];
|
|
304
|
-
readonly statusBarTranslucent?: boolean;
|
|
305
|
-
readonly gestureDirection?: import("react-native-screens").ScreenProps["swipeDirection"];
|
|
306
|
-
readonly contentStyle?: import("react-native").StyleProp<import("react-native").ViewStyle>;
|
|
307
|
-
readonly animationMatchesGesture?: boolean;
|
|
308
|
-
readonly fullScreenGestureEnabled?: boolean;
|
|
309
|
-
readonly fullScreenGestureShadowEnabled?: boolean;
|
|
310
|
-
readonly gestureEnabled?: boolean;
|
|
311
|
-
readonly gestureResponseDistance?: import("react-native-screens").ScreenProps["gestureResponseDistance"];
|
|
312
|
-
readonly animationTypeForReplace?: import("react-native-screens").ScreenProps["replaceAnimation"];
|
|
313
|
-
readonly animation?: import("react-native-screens").ScreenProps["stackAnimation"];
|
|
314
|
-
readonly animationDuration?: number;
|
|
315
|
-
readonly presentation?: Exclude<import("react-native-screens").ScreenProps["stackPresentation"], "push"> | "card";
|
|
316
|
-
readonly sheetAllowedDetents?: number[] | "fitToContents";
|
|
317
|
-
readonly sheetElevation?: number;
|
|
318
|
-
readonly sheetExpandsWhenScrolledToEdge?: boolean;
|
|
319
|
-
readonly sheetCornerRadius?: number;
|
|
320
|
-
readonly sheetInitialDetentIndex?: number | "last";
|
|
321
|
-
readonly sheetGrabberVisible?: boolean;
|
|
322
|
-
readonly sheetLargestUndimmedDetentIndex?: number | "none" | "last";
|
|
323
|
-
readonly orientation?: import("react-native-screens").ScreenProps["screenOrientation"];
|
|
324
|
-
readonly freezeOnBlur?: boolean;
|
|
325
|
-
readonly unstable_sheetFooter?: () => React.ReactNode;
|
|
326
|
-
};
|
|
255
|
+
readonly options: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
327
256
|
};
|
|
328
257
|
readonly BugReport: {
|
|
329
258
|
readonly screen: typeof BugReportScreen;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAE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C;IACb,UAAU,eAAe,CAAC;QACxB,UAAU,aAAc,SAAQ,kBAAkB;SAAG;KACtD;CACF"}
|
|
@@ -154,10 +154,7 @@ export const ChatStack = createNativeStackNavigator({
|
|
|
154
154
|
},
|
|
155
155
|
MessageReadReceipts: {
|
|
156
156
|
screen: MessageReadReceiptsScreen,
|
|
157
|
-
options:
|
|
158
|
-
...MessageReadReceiptsScreenOptions,
|
|
159
|
-
headerTitle: 'Read receipts',
|
|
160
|
-
},
|
|
157
|
+
options: MessageReadReceiptsScreenOptions,
|
|
161
158
|
},
|
|
162
159
|
BugReport: {
|
|
163
160
|
screen: BugReportScreen,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EACL,0BAA0B,GAE3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EAEL,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAA;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAA;AAC3F,OAAO,EACL,0CAA0C,EAC1C,kCAAkC,GACnC,MAAM,iFAAiF,CAAA;AACxF,OAAO,EAAE,kCAAkC,EAAE,MAAM,iFAAiF,CAAA;AACpI,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,E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AAC,EACV,CACH;aACF,CAAC;SACH;QACD,mBAAmB,EAAE;YACnB,MAAM,EAAE,yBAAyB;YACjC,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;gBAC5B,YAAY,EAAE,OAAO;gBACrB,KAAK,EAAE,sBAAsB;gBAC7B,WAAW,EAAE,CAAC,KAAkC,EAAE,EAAE,CAAC,CACnD,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CACvD;;UACF,EAAE,iBAAiB,CAAC,CACrB;aACF,CAAC;SACH;QACD,GAAG,EAAE;YACH,MAAM,EAAE,oBAAoB;YAC5B,OAAO,EAAE;gBACP,WAAW,EAAE,KAAK;gBAClB,YAAY,EAAE,OAAO;aACtB;SACF;QACD,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,cAAc,EAAE;YACd,MAAM,EAAE,oBAAoB;YAC5B,gEAAgE;YAChE,OAAO,EAAE,2BAA2B;SACrC;QACD,iBAAiB,EAAE;YACjB,MAAM,EAAE,uBAAuB;YAC/B,OAAO,EAAE,8BAA8B;SACxC;QACD,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,mBAAmB,EAAE;YACnB,MAAM,EAAE,yBAAyB;YACjC,OAAO,EAAE;gBACP,GAAG,gCAAgC;gBACnC,WAAW,EAAE,eAAe;aAC7B;SACF;QACD,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE;gBACP,KAAK,EAAE,KAAK;aACb;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,GAAG;aACV;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import { HeaderBackButton } from '@react-navigation/elements'\nimport { StaticParamList } from '@react-navigation/native'\nimport {\n createNativeStackNavigator,\n NativeStackHeaderRightProps,\n} from '@react-navigation/native-stack'\nimport React from 'react'\nimport { Icon } from '../components'\nimport { ConversationDetailsScreen } from '../screens/conversation_details_screen'\nimport {\n ConversationRouteProps,\n ConversationScreen,\n ConversationScreenTitle,\n} from '../screens/conversation_screen'\nimport { ConversationsScreen } from '../screens/conversations/conversations_screen'\nimport { ConversationNewScreen } from '../screens/conversation_new/conversation_new_screen'\nimport {\n ConversationFilterReceipientsScreenOptions,\n ConversationFilterRecipientsScreen,\n} from '../screens/conversation_filter_recipients/conversation_filter_recipients_screen'\nimport { ConversationSelectRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_recipients_screen'\nimport {\n MessageActionsScreen,\n MessageActionsScreenOptions,\n} from '../screens/message_actions_screen'\nimport { SendGiphyScreen, SendGiphyScreenOptions } from '../screens/send_giphy_screen'\nimport { NotFound } from '../screens/not_found'\nimport { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen'\nimport { HeaderRightButton } from './header'\nimport { ScreenLayout } from './screenLayout'\nimport {\n ConversationFiltersScreen,\n ConversationFiltersScreenOptions,\n} from '../screens/conversation_filters_screen'\nimport { ConversationFiltersParams } from '../screens/conversation_filters/screen_props'\nimport { ConversationSelectGroupRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_group_recipients_screen'\nimport { ConversationSelectTeamsILeadRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen'\nimport { AttachmentActionsScreenOptions } from '../screens/attachment_actions/attachment_actions_screen'\nimport { AttachmentActionsScreen } from '../screens/attachment_actions/attachment_actions_screen'\nimport { BugReportScreen, BugReportScreenOptions } from '../screens/bug_report_screen'\nimport {\n MessageReadReceiptsScreen,\n MessageReadReceiptsScreenOptions,\n} from '../screens/conversation/message_read_receipts_screen'\nimport { Platform } from 'react-native'\n\nconst HEADER_BACK_BUTTON_LAYOUT_RESET_STYLES = {\n marginLeft: Platform.select({ ios: -8, default: -3 }),\n marginRight: Platform.select({ ios: 0, default: 30 }),\n}\n\nexport const NewConversationStack = createNativeStackNavigator({\n initialRouteName: 'ConversationSelectRecipients',\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n ConversationSelectRecipients: {\n screen: ConversationSelectRecipientsScreen,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Cancel\n </HeaderRightButton>\n ),\n headerBackVisible: false,\n }),\n },\n ConversationSelectGroupRecipients: {\n screen: ConversationSelectGroupRecipientsScreen,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton\n {...props}\n onPress={() => navigation.popTo('Conversations', route.params)}\n >\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n ConversationSelectTeamsILeadRecipients: {\n screen: ConversationSelectTeamsILeadRecipientsScreen,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton\n {...props}\n onPress={() => navigation.popTo('Conversations', route.params)}\n >\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n ConversationFilterRecipients: {\n screen: ConversationFilterRecipientsScreen,\n options: ConversationFilterReceipientsScreenOptions,\n },\n ConversationNew: {\n screen: ConversationNewScreen,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerLeft: () => null,\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={() => navigation.getParent()?.goBack()}>\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n },\n})\n\nexport const ChatStack = createNativeStackNavigator({\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n Conversations: {\n screen: ConversationsScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerBackVisible: false,\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderBackButton\n backImage={() => <Icon name=\"general.x\" size={18} color={props.tintColor} />}\n onPress={navigation.goBack}\n {...props}\n />\n ),\n }),\n },\n ConversationFilters: {\n screen: ConversationFiltersScreen,\n options: ConversationFiltersScreenOptions,\n },\n Conversation: {\n screen: ConversationScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (props: NativeStackHeaderRightProps) => {\n const { conversation_id, title, badge, deleted } = route.params as ConversationRouteProps\n\n return (\n <ConversationScreenTitle\n conversation_id={conversation_id}\n badge={badge}\n deleted={deleted}\n {...props}\n >\n {title ?? 'Conversation'}\n </ConversationScreenTitle>\n )\n },\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderBackButton\n backImage={() => <Icon name=\"general.x\" size={18} color={props.tintColor} />}\n onPress={() => navigation.getParent()?.goBack()}\n />\n ),\n headerLeft: props => (\n <HeaderBackButton\n style={HEADER_BACK_BUTTON_LAYOUT_RESET_STYLES}\n displayMode=\"minimal\"\n onPress={() => {\n const params = route.params as ConversationRouteProps\n if ((params as ConversationFiltersParams)?.chat_group_graph_id) {\n // Ensure that conversations with a graph id pass them back to the conversation list\n const { chat_group_graph_id } = params\n navigation.popTo('Conversations', { chat_group_graph_id })\n } else {\n navigation.goBack()\n }\n }}\n {...props}\n />\n ),\n }),\n },\n ConversationDetails: {\n screen: ConversationDetailsScreen,\n options: ({ navigation }) => ({\n presentation: 'modal',\n title: 'Conversation details',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Done\n </HeaderRightButton>\n ),\n }),\n },\n New: {\n screen: NewConversationStack,\n options: {\n headerShown: false,\n presentation: 'modal',\n },\n },\n SendGiphy: {\n screen: SendGiphyScreen,\n options: SendGiphyScreenOptions,\n },\n MessageActions: {\n screen: MessageActionsScreen,\n // Something about sheetAllowedDetents declared inline breaks TS\n options: MessageActionsScreenOptions,\n },\n AttachmentActions: {\n screen: AttachmentActionsScreen,\n options: AttachmentActionsScreenOptions,\n },\n Reactions: {\n screen: ReactionsScreen,\n options: ReactionsScreenOptions,\n },\n MessageReadReceipts: {\n screen: MessageReadReceiptsScreen,\n options: {\n ...MessageReadReceiptsScreenOptions,\n headerTitle: 'Read receipts',\n },\n },\n BugReport: {\n screen: BugReportScreen,\n options: BugReportScreenOptions,\n },\n NotFound: {\n screen: NotFound,\n options: {\n title: '404',\n },\n linking: {\n path: '*',\n },\n },\n },\n})\n\ntype ChatStackParamList = StaticParamList<typeof ChatStack>\n\ndeclare global {\n namespace ReactNavigation {\n interface RootParamList extends ChatStackParamList {}\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EACL,0BAA0B,GAE3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EAEL,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAA;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAA;AAC3F,OAAO,EACL,0CAA0C,EAC1C,kCAAkC,GACnC,MAAM,iFAAiF,CAAA;AACxF,OAAO,EAAE,kCAAkC,EAAE,MAAM,iFAAiF,CAAA;AACpI,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OA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AK,CAAC,EACV,CACH;aACF,CAAC;SACH;QACD,mBAAmB,EAAE;YACnB,MAAM,EAAE,yBAAyB;YACjC,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;gBAC5B,YAAY,EAAE,OAAO;gBACrB,KAAK,EAAE,sBAAsB;gBAC7B,WAAW,EAAE,CAAC,KAAkC,EAAE,EAAE,CAAC,CACnD,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CACvD;;UACF,EAAE,iBAAiB,CAAC,CACrB;aACF,CAAC;SACH;QACD,GAAG,EAAE;YACH,MAAM,EAAE,oBAAoB;YAC5B,OAAO,EAAE;gBACP,WAAW,EAAE,KAAK;gBAClB,YAAY,EAAE,OAAO;aACtB;SACF;QACD,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,cAAc,EAAE;YACd,MAAM,EAAE,oBAAoB;YAC5B,gEAAgE;YAChE,OAAO,EAAE,2BAA2B;SACrC;QACD,iBAAiB,EAAE;YACjB,MAAM,EAAE,uBAAuB;YAC/B,OAAO,EAAE,8BAA8B;SACxC;QACD,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,mBAAmB,EAAE;YACnB,MAAM,EAAE,yBAAyB;YACjC,OAAO,EAAE,gCAAgC;SAC1C;QACD,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE;gBACP,KAAK,EAAE,KAAK;aACb;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,GAAG;aACV;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import { HeaderBackButton } from '@react-navigation/elements'\nimport { StaticParamList } from '@react-navigation/native'\nimport {\n createNativeStackNavigator,\n NativeStackHeaderRightProps,\n} from '@react-navigation/native-stack'\nimport React from 'react'\nimport { Icon } from '../components'\nimport { ConversationDetailsScreen } from '../screens/conversation_details_screen'\nimport {\n ConversationRouteProps,\n ConversationScreen,\n ConversationScreenTitle,\n} from '../screens/conversation_screen'\nimport { ConversationsScreen } from '../screens/conversations/conversations_screen'\nimport { ConversationNewScreen } from '../screens/conversation_new/conversation_new_screen'\nimport {\n ConversationFilterReceipientsScreenOptions,\n ConversationFilterRecipientsScreen,\n} from '../screens/conversation_filter_recipients/conversation_filter_recipients_screen'\nimport { ConversationSelectRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_recipients_screen'\nimport {\n MessageActionsScreen,\n MessageActionsScreenOptions,\n} from '../screens/message_actions_screen'\nimport { SendGiphyScreen, SendGiphyScreenOptions } from '../screens/send_giphy_screen'\nimport { NotFound } from '../screens/not_found'\nimport { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen'\nimport { HeaderRightButton } from './header'\nimport { ScreenLayout } from './screenLayout'\nimport {\n ConversationFiltersScreen,\n ConversationFiltersScreenOptions,\n} from '../screens/conversation_filters_screen'\nimport { ConversationFiltersParams } from '../screens/conversation_filters/screen_props'\nimport { ConversationSelectGroupRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_group_recipients_screen'\nimport { ConversationSelectTeamsILeadRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen'\nimport { AttachmentActionsScreenOptions } from '../screens/attachment_actions/attachment_actions_screen'\nimport { AttachmentActionsScreen } from '../screens/attachment_actions/attachment_actions_screen'\nimport { BugReportScreen, BugReportScreenOptions } from '../screens/bug_report_screen'\nimport {\n MessageReadReceiptsScreen,\n MessageReadReceiptsScreenOptions,\n} from '../screens/conversation/message_read_receipts_screen'\nimport { Platform } from 'react-native'\n\nconst HEADER_BACK_BUTTON_LAYOUT_RESET_STYLES = {\n marginLeft: Platform.select({ ios: -8, default: -3 }),\n marginRight: Platform.select({ ios: 0, default: 30 }),\n}\n\nexport const NewConversationStack = createNativeStackNavigator({\n initialRouteName: 'ConversationSelectRecipients',\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n ConversationSelectRecipients: {\n screen: ConversationSelectRecipientsScreen,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Cancel\n </HeaderRightButton>\n ),\n headerBackVisible: false,\n }),\n },\n ConversationSelectGroupRecipients: {\n screen: ConversationSelectGroupRecipientsScreen,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton\n {...props}\n onPress={() => navigation.popTo('Conversations', route.params)}\n >\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n ConversationSelectTeamsILeadRecipients: {\n screen: ConversationSelectTeamsILeadRecipientsScreen,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton\n {...props}\n onPress={() => navigation.popTo('Conversations', route.params)}\n >\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n ConversationFilterRecipients: {\n screen: ConversationFilterRecipientsScreen,\n options: ConversationFilterReceipientsScreenOptions,\n },\n ConversationNew: {\n screen: ConversationNewScreen,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerLeft: () => null,\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={() => navigation.getParent()?.goBack()}>\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n },\n})\n\nexport const ChatStack = createNativeStackNavigator({\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n Conversations: {\n screen: ConversationsScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerBackVisible: false,\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderBackButton\n backImage={() => <Icon name=\"general.x\" size={18} color={props.tintColor} />}\n onPress={navigation.goBack}\n {...props}\n />\n ),\n }),\n },\n ConversationFilters: {\n screen: ConversationFiltersScreen,\n options: ConversationFiltersScreenOptions,\n },\n Conversation: {\n screen: ConversationScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (props: NativeStackHeaderRightProps) => {\n const { conversation_id, title, badge, deleted } = route.params as ConversationRouteProps\n\n return (\n <ConversationScreenTitle\n conversation_id={conversation_id}\n badge={badge}\n deleted={deleted}\n {...props}\n >\n {title ?? 'Conversation'}\n </ConversationScreenTitle>\n )\n },\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderBackButton\n backImage={() => <Icon name=\"general.x\" size={18} color={props.tintColor} />}\n onPress={() => navigation.getParent()?.goBack()}\n />\n ),\n headerLeft: props => (\n <HeaderBackButton\n style={HEADER_BACK_BUTTON_LAYOUT_RESET_STYLES}\n displayMode=\"minimal\"\n onPress={() => {\n const params = route.params as ConversationRouteProps\n if ((params as ConversationFiltersParams)?.chat_group_graph_id) {\n // Ensure that conversations with a graph id pass them back to the conversation list\n const { chat_group_graph_id } = params\n navigation.popTo('Conversations', { chat_group_graph_id })\n } else {\n navigation.goBack()\n }\n }}\n {...props}\n />\n ),\n }),\n },\n ConversationDetails: {\n screen: ConversationDetailsScreen,\n options: ({ navigation }) => ({\n presentation: 'modal',\n title: 'Conversation details',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Done\n </HeaderRightButton>\n ),\n }),\n },\n New: {\n screen: NewConversationStack,\n options: {\n headerShown: false,\n presentation: 'modal',\n },\n },\n SendGiphy: {\n screen: SendGiphyScreen,\n options: SendGiphyScreenOptions,\n },\n MessageActions: {\n screen: MessageActionsScreen,\n // Something about sheetAllowedDetents declared inline breaks TS\n options: MessageActionsScreenOptions,\n },\n AttachmentActions: {\n screen: AttachmentActionsScreen,\n options: AttachmentActionsScreenOptions,\n },\n Reactions: {\n screen: ReactionsScreen,\n options: ReactionsScreenOptions,\n },\n MessageReadReceipts: {\n screen: MessageReadReceiptsScreen,\n options: MessageReadReceiptsScreenOptions,\n },\n BugReport: {\n screen: BugReportScreen,\n options: BugReportScreenOptions,\n },\n NotFound: {\n screen: NotFound,\n options: {\n title: '404',\n },\n linking: {\n path: '*',\n },\n },\n },\n})\n\ntype ChatStackParamList = StaticParamList<typeof ChatStack>\n\ndeclare global {\n namespace ReactNavigation {\n interface RootParamList extends ChatStackParamList {}\n }\n}\n"]}
|
|
@@ -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;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
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;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,8BAA8B,uEAEzC,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,qBA6C9E"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { useNavigation } from '@react-navigation/native';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Linking } from 'react-native';
|
|
4
|
-
import
|
|
4
|
+
import FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet';
|
|
5
5
|
import { useDeleteAttachment } from './hooks/useDeleteAttachment';
|
|
6
|
-
export const AttachmentActionsScreenOptions =
|
|
6
|
+
export const AttachmentActionsScreenOptions = getFormSheetScreenOptions({
|
|
7
|
+
headerTitle: 'Attachment actions',
|
|
8
|
+
});
|
|
7
9
|
export function AttachmentActionsScreen({ route }) {
|
|
8
10
|
const navigation = useNavigation();
|
|
9
11
|
const { attachmentId, attachmentContentType, attachmentUrl, conversation_id, canDeleteNonAuthoredMessages, myMessage, } = route.params;
|
|
@@ -18,10 +20,10 @@ export function AttachmentActionsScreen({ route }) {
|
|
|
18
20
|
Linking.openURL(attachmentUrl);
|
|
19
21
|
navigation.goBack();
|
|
20
22
|
};
|
|
21
|
-
return (<
|
|
22
|
-
<
|
|
23
|
-
{canDelete && (<
|
|
24
|
-
</
|
|
23
|
+
return (<FormSheet.Root>
|
|
24
|
+
<FormSheet.Action iconName="general.newWindow" title="Open in browser" accessibilityRole="link" accessibilityLabel={`Open ${attachmentName} in browser`} accessibilityHint={`${attachmentName} can be downloaded and shared through the browser.`} onPress={handleOpenInBrowser}/>
|
|
25
|
+
{canDelete && (<FormSheet.Action appearance="danger" iconName="publishing.trash" title={`Delete ${attachmentName}`} onPress={handleDeleteAttachment}/>)}
|
|
26
|
+
</FormSheet.Root>);
|
|
25
27
|
}
|
|
26
28
|
function getAttachmentLabelName(contentType) {
|
|
27
29
|
if (contentType.startsWith('image/'))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment_actions_screen.js","sourceRoot":"","sources":["../../../src/screens/attachment_actions/attachment_actions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"attachment_actions_screen.js","sourceRoot":"","sources":["../../../src/screens/attachment_actions/attachment_actions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,SAAS,EAAE,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAA;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE,MAAM,CAAC,MAAM,8BAA8B,GAAG,yBAAyB,CAAC;IACtE,WAAW,EAAE,oBAAoB;CAClC,CAAC,CAAA;AAWF,MAAM,UAAU,uBAAuB,CAAC,EAAE,KAAK,EAAgC;IAC7E,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,EACJ,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,4BAA4B,EAC5B,SAAS,GACV,GAAG,KAAK,CAAC,MAAM,CAAA;IAEhB,MAAM,cAAc,GAAG,sBAAsB,CAAC,qBAAqB,CAAC,CAAA;IACpE,MAAM,SAAS,GAAG,SAAS,IAAI,4BAA4B,CAAA;IAE3D,MAAM,EAAE,sBAAsB,EAAE,GAAG,mBAAmB,CAAC;QACrD,eAAe;QACf,YAAY;QACZ,cAAc;KACf,CAAC,CAAA;IAEF,MAAM,mBAAmB,GAAG,GAAG,EAAE;QAC/B,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;QAC9B,UAAU,CAAC,MAAM,EAAE,CAAA;IACrB,CAAC,CAAA;IAED,OAAO,CACL,CAAC,SAAS,CAAC,IAAI,CACb;MAAA,CAAC,SAAS,CAAC,MAAM,CACf,QAAQ,CAAC,mBAAmB,CAC5B,KAAK,CAAC,iBAAiB,CACvB,iBAAiB,CAAC,MAAM,CACxB,kBAAkB,CAAC,CAAC,QAAQ,cAAc,aAAa,CAAC,CACxD,iBAAiB,CAAC,CAAC,GAAG,cAAc,oDAAoD,CAAC,CACzF,OAAO,CAAC,CAAC,mBAAmB,CAAC,EAE/B;MAAA,CAAC,SAAS,IAAI,CACZ,CAAC,SAAS,CAAC,MAAM,CACf,UAAU,CAAC,QAAQ,CACnB,QAAQ,CAAC,kBAAkB,CAC3B,KAAK,CAAC,CAAC,UAAU,cAAc,EAAE,CAAC,CAClC,OAAO,CAAC,CAAC,sBAAsB,CAAC,EAChC,CACH,CACH;IAAA,EAAE,SAAS,CAAC,IAAI,CAAC,CAClB,CAAA;AACH,CAAC;AAED,SAAS,sBAAsB,CAAC,WAAmB;IACjD,IAAI,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,OAAO,CAAA;IACpD,IAAI,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,OAAO,CAAA;IACpD,IAAI,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,OAAO,CAAA;IACpD,IAAI,WAAW,KAAK,iBAAiB;QAAE,OAAO,KAAK,CAAA;IACnD,IAAI,WAAW,CAAC,UAAU,CAAC,cAAc,CAAC;QAAE,OAAO,MAAM,CAAA;IAEzD,OAAO,EAAE,CAAA;AACX,CAAC","sourcesContent":["import { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { Linking } from 'react-native'\nimport FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet'\nimport { useDeleteAttachment } from './hooks/useDeleteAttachment'\n\nexport const AttachmentActionsScreenOptions = getFormSheetScreenOptions({\n headerTitle: 'Attachment actions',\n})\n\nexport type AttachmentActionsScreenProps = StaticScreenProps<{\n attachmentId: string\n attachmentContentType: string\n attachmentUrl: string\n conversation_id: number\n canDeleteNonAuthoredMessages: boolean\n myMessage: boolean\n}>\n\nexport function AttachmentActionsScreen({ route }: AttachmentActionsScreenProps) {\n const navigation = useNavigation()\n const {\n attachmentId,\n attachmentContentType,\n attachmentUrl,\n conversation_id,\n canDeleteNonAuthoredMessages,\n myMessage,\n } = route.params\n\n const attachmentName = getAttachmentLabelName(attachmentContentType)\n const canDelete = myMessage || canDeleteNonAuthoredMessages\n\n const { handleDeleteAttachment } = useDeleteAttachment({\n conversation_id,\n attachmentId,\n attachmentName,\n })\n\n const handleOpenInBrowser = () => {\n Linking.openURL(attachmentUrl)\n navigation.goBack()\n }\n\n return (\n <FormSheet.Root>\n <FormSheet.Action\n iconName=\"general.newWindow\"\n title=\"Open in browser\"\n accessibilityRole=\"link\"\n accessibilityLabel={`Open ${attachmentName} in browser`}\n accessibilityHint={`${attachmentName} can be downloaded and shared through the browser.`}\n onPress={handleOpenInBrowser}\n />\n {canDelete && (\n <FormSheet.Action\n appearance=\"danger\"\n iconName=\"publishing.trash\"\n title={`Delete ${attachmentName}`}\n onPress={handleDeleteAttachment}\n />\n )}\n </FormSheet.Root>\n )\n}\n\nfunction getAttachmentLabelName(contentType: string) {\n if (contentType.startsWith('image/')) return 'image'\n if (contentType.startsWith('video/')) return 'video'\n if (contentType.startsWith('audio/')) return 'audio'\n if (contentType === 'application/pdf') return 'PDF'\n if (contentType.startsWith('application/')) return 'file'\n\n return ''\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { StaticScreenProps } from '@react-navigation/native';
|
|
3
2
|
import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
|
|
3
|
+
import React from 'react';
|
|
4
4
|
export declare const MessageReadReceiptsScreenOptions: NativeStackNavigationOptions;
|
|
5
5
|
export type MessageReadReceiptsScreenProps = StaticScreenProps<{
|
|
6
6
|
conversation_id: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message_read_receipts_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation/message_read_receipts_screen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"message_read_receipts_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation/message_read_receipts_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,KAAe,MAAM,OAAO,CAAA;AASnC,eAAO,MAAM,gCAAgC,EAAE,4BAU9C,CAAA;AAED,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,qBA4BlF"}
|
|
@@ -1,75 +1,64 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { useHeaderHeight } from '@react-navigation/elements';
|
|
2
|
+
import React, { memo } from 'react';
|
|
3
|
+
import { Platform, StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
3
4
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
5
|
import { Avatar, Heading, Text } from '../../components';
|
|
5
6
|
import { useTheme } from '../../hooks';
|
|
6
|
-
import { useNavigation } from '@react-navigation/native';
|
|
7
7
|
import { useReadReceipts } from '../../hooks/use_read_receipts';
|
|
8
|
-
import {
|
|
9
|
-
import { useHeaderHeight } from '@react-navigation/elements';
|
|
10
|
-
const SCREEN_HEIGHT_RATIO_QUARTER = 0.25; // 25% of the screen height
|
|
11
|
-
const SCREEN_HEIGHT_RATIO_HALF = 0.5; // 50% of the screen height
|
|
12
|
-
const SCREEN_HEIGHT_RATIO_FULL = 1; // 100% of the screen height
|
|
8
|
+
import { FlatList } from 'react-native-gesture-handler';
|
|
13
9
|
export const MessageReadReceiptsScreenOptions = {
|
|
14
|
-
presentation:
|
|
10
|
+
presentation: 'formSheet',
|
|
15
11
|
sheetAllowedDetents: Platform.select({
|
|
16
|
-
|
|
17
|
-
default:
|
|
12
|
+
android: [0.25, 0.94], // Going straight to full 0.94 preserves height of screen on Android
|
|
13
|
+
default: [0.25, 0.5, 1],
|
|
18
14
|
}),
|
|
19
15
|
sheetGrabberVisible: true,
|
|
20
|
-
headerShown:
|
|
16
|
+
headerShown: false,
|
|
21
17
|
sheetCornerRadius: 16,
|
|
18
|
+
headerTitle: 'Read receipts',
|
|
22
19
|
};
|
|
23
20
|
export function MessageReadReceiptsScreen({ route }) {
|
|
24
21
|
const styles = useStyles();
|
|
25
|
-
const navigation = useNavigation();
|
|
26
22
|
const { conversation_id, message_id } = route.params;
|
|
27
23
|
const { data: receipts, totalCount, fetchNextPage, } = useReadReceipts({ conversation_id, message_id });
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return (<View style={styles.container}>
|
|
34
|
-
<FlashList data={receipts} contentContainerStyle={styles.contentContainer} keyExtractor={item => item.id.toString()} estimatedItemSize={24} renderItem={({ item }) => (<View style={styles.receiptRow}>
|
|
35
|
-
<Avatar sourceUri={item.avatar} size="sm"/>
|
|
36
|
-
<Text variant="tertiary" numberOfLines={2} style={styles.name}>
|
|
37
|
-
{item.name}
|
|
38
|
-
</Text>
|
|
39
|
-
</View>)} ListHeaderComponent={() => PlatformListHeader({ totalCount })} ListFooterComponent={<View style={styles.footer}/>} ListEmptyComponent={<Text style={styles.emptyText}>No one has read this message yet.</Text>} onEndReached={fetchNextPage} onEndReachedThreshold={0.2}/>
|
|
24
|
+
return (<View style={styles.container} collapsable={false}>
|
|
25
|
+
<Heading variant="h3" style={styles.header}>
|
|
26
|
+
Read receipts ({totalCount})
|
|
27
|
+
</Heading>
|
|
28
|
+
<FlatList data={receipts} style={styles.contentContainer} keyExtractor={item => item.id.toString()} renderItem={({ item }) => <Receipt receipt={item}/>} nestedScrollEnabled ListFooterComponent={<View style={styles.footer}/>} ListEmptyComponent={<Text style={styles.emptyText}>No one has read this message yet.</Text>} onEndReached={() => fetchNextPage()} onEndReachedThreshold={0.2}/>
|
|
40
29
|
</View>);
|
|
41
30
|
}
|
|
42
|
-
|
|
31
|
+
const Receipt = memo(({ receipt }) => {
|
|
43
32
|
const styles = useStyles();
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
33
|
+
return (<View style={styles.receiptRow}>
|
|
34
|
+
<Avatar sourceUri={receipt.avatar} size="sm"/>
|
|
35
|
+
<Text variant="tertiary" numberOfLines={2} style={styles.name}>
|
|
36
|
+
{receipt.name}
|
|
37
|
+
</Text>
|
|
38
|
+
</View>);
|
|
39
|
+
});
|
|
51
40
|
const useStyles = () => {
|
|
52
41
|
const theme = useTheme();
|
|
53
42
|
const { height } = useWindowDimensions();
|
|
54
43
|
const { bottom, top } = useSafeAreaInsets();
|
|
55
44
|
const headerHeight = useHeaderHeight();
|
|
56
45
|
const containerHeight = Platform.select({
|
|
57
|
-
android:
|
|
46
|
+
android: null,
|
|
58
47
|
ios: height - top - headerHeight,
|
|
59
48
|
});
|
|
60
49
|
return StyleSheet.create({
|
|
61
50
|
container: {
|
|
62
|
-
|
|
51
|
+
paddingTop: 16,
|
|
63
52
|
backgroundColor: theme.colors.fillColorNeutral100Inverted,
|
|
64
53
|
height: containerHeight,
|
|
65
54
|
flex: 1,
|
|
66
55
|
},
|
|
67
56
|
contentContainer: {
|
|
68
|
-
|
|
57
|
+
paddingHorizontal: 16,
|
|
69
58
|
},
|
|
70
59
|
header: {
|
|
71
|
-
|
|
72
|
-
|
|
60
|
+
paddingHorizontal: 16,
|
|
61
|
+
paddingBottom: 8,
|
|
73
62
|
},
|
|
74
63
|
receiptRow: {
|
|
75
64
|
flexDirection: 'row',
|
|
@@ -82,7 +71,7 @@ const useStyles = () => {
|
|
|
82
71
|
flex: 1,
|
|
83
72
|
},
|
|
84
73
|
footer: {
|
|
85
|
-
height: bottom +
|
|
74
|
+
height: bottom + 16,
|
|
86
75
|
},
|
|
87
76
|
emptyText: {
|
|
88
77
|
textAlign: 'center',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message_read_receipts_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation/message_read_receipts_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"message_read_receipts_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation/message_read_receipts_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAG5D,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAGvD,MAAM,CAAC,MAAM,gCAAgC,GAAiC;IAC5E,YAAY,EAAE,WAAW;IACzB,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC;QACnC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,oEAAoE;QAC3F,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;KACxB,CAAC;IACF,mBAAmB,EAAE,IAAI;IACzB,WAAW,EAAE,KAAK;IAClB,iBAAiB,EAAE,EAAE;IACrB,WAAW,EAAE,eAAe;CAC7B,CAAA;AAOD,MAAM,UAAU,yBAAyB,CAAC,EAAE,KAAK,EAAkC;IACjF,MAAM,MAAM,GAAG,SAAS,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K;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;YACN,eAAe,EAAE,CAAC;YAClB,IAAI,EAAE,CAAC;SACR;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,CAAC;SACR;QACD,MAAM,EAAE;YACN,MAAM,EAAE,MAAM,GAAG,EAAE;SACpB;QACD,SAAS,EAAE;YACT,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,MAAM;YACb,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;SACb;QACD,cAAc,EAAE;YACd,IAAI,EAAE,CAAC;YACP,cAAc,EAAE,QAAQ;SACzB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useHeaderHeight } from '@react-navigation/elements'\nimport { StaticScreenProps } from '@react-navigation/native'\nimport { NativeStackNavigationOptions } from '@react-navigation/native-stack'\nimport React, { memo } from 'react'\nimport { Platform, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Avatar, Heading, Text } from '../../components'\nimport { useTheme } from '../../hooks'\nimport { useReadReceipts } from '../../hooks/use_read_receipts'\nimport { FlatList } from 'react-native-gesture-handler'\nimport { ReadReceiptResource } from '../../types/resources/read_receipt'\n\nexport const MessageReadReceiptsScreenOptions: NativeStackNavigationOptions = {\n presentation: 'formSheet',\n sheetAllowedDetents: Platform.select({\n android: [0.25, 0.94], // Going straight to full 0.94 preserves height of screen on Android\n default: [0.25, 0.5, 1],\n }),\n sheetGrabberVisible: true,\n headerShown: false,\n sheetCornerRadius: 16,\n headerTitle: 'Read receipts',\n}\n\nexport type MessageReadReceiptsScreenProps = StaticScreenProps<{\n conversation_id: number\n message_id: string\n}>\n\nexport function MessageReadReceiptsScreen({ route }: MessageReadReceiptsScreenProps) {\n const styles = useStyles()\n\n const { conversation_id, message_id } = route.params\n const {\n data: receipts,\n totalCount,\n fetchNextPage,\n } = useReadReceipts({ conversation_id, message_id })\n\n return (\n <View style={styles.container} collapsable={false}>\n <Heading variant=\"h3\" style={styles.header}>\n Read receipts ({totalCount})\n </Heading>\n <FlatList\n data={receipts}\n style={styles.contentContainer}\n keyExtractor={item => item.id.toString()}\n renderItem={({ item }) => <Receipt receipt={item} />}\n nestedScrollEnabled\n ListFooterComponent={<View style={styles.footer} />}\n ListEmptyComponent={<Text style={styles.emptyText}>No one has read this message yet.</Text>}\n onEndReached={() => fetchNextPage()}\n onEndReachedThreshold={0.2}\n />\n </View>\n )\n}\n\nconst Receipt = memo(({ receipt }: { receipt: ReadReceiptResource }) => {\n const styles = useStyles()\n\n return (\n <View style={styles.receiptRow}>\n <Avatar sourceUri={receipt.avatar} size=\"sm\" />\n <Text variant=\"tertiary\" numberOfLines={2} style={styles.name}>\n {receipt.name}\n </Text>\n </View>\n )\n})\n\nconst useStyles = () => {\n const theme = useTheme()\n const { height } = useWindowDimensions()\n const { bottom, top } = useSafeAreaInsets()\n const headerHeight = useHeaderHeight()\n\n const containerHeight = Platform.select({\n android: null,\n ios: height - top - headerHeight,\n })\n\n return StyleSheet.create({\n container: {\n paddingTop: 16,\n backgroundColor: theme.colors.fillColorNeutral100Inverted,\n height: containerHeight,\n flex: 1,\n },\n contentContainer: {\n paddingHorizontal: 16,\n },\n header: {\n paddingHorizontal: 16,\n paddingBottom: 8,\n },\n receiptRow: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 8,\n paddingVertical: 8,\n flex: 1,\n },\n name: {\n flex: 1,\n },\n footer: {\n height: bottom + 16,\n },\n emptyText: {\n textAlign: 'center',\n color: '#888',\n marginTop: 32,\n fontSize: 16,\n },\n emptyContainer: {\n flex: 1,\n justifyContent: 'center',\n },\n })\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_filters_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_filters_screen.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,4BAA4B,EAC7B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,OAAO,EACL,8BAA8B,EAE/B,MAAM,qCAAqC,CAAA;AA8B5C,eAAO,MAAM,gCAAgC,EAAE,
|
|
1
|
+
{"version":3,"file":"conversation_filters_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_filters_screen.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,4BAA4B,EAC7B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,OAAO,EACL,8BAA8B,EAE/B,MAAM,qCAAqC,CAAA;AA8B5C,eAAO,MAAM,gCAAgC,EAAE,4BAS9C,CAAA;AAoCD,eAAO,MAAM,yBAAyB,WAAY,8BAA8B,sBAU/E,CAAA"}
|