@planningcenter/chat-react-native 3.7.1-rc.0 → 3.7.1-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/build/components/primitive/form_sheet.d.ts +4 -2
  2. package/build/components/primitive/form_sheet.d.ts.map +1 -1
  3. package/build/components/primitive/form_sheet.js +3 -3
  4. package/build/components/primitive/form_sheet.js.map +1 -1
  5. package/build/navigation/index.d.ts +2 -2
  6. package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts +3 -2
  7. package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts.map +1 -1
  8. package/build/screens/conversation_filter_recipients/components/checkbox_row.js +1 -3
  9. package/build/screens/conversation_filter_recipients/components/checkbox_row.js.map +1 -1
  10. package/build/screens/conversation_filter_recipients/components/header_row.d.ts +3 -2
  11. package/build/screens/conversation_filter_recipients/components/header_row.d.ts.map +1 -1
  12. package/build/screens/conversation_filter_recipients/components/header_row.js +1 -3
  13. package/build/screens/conversation_filter_recipients/components/header_row.js.map +1 -1
  14. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts +2 -3
  15. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -1
  16. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js +40 -39
  17. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
  18. package/build/screens/conversation_filter_recipients/types.d.ts +3 -0
  19. package/build/screens/conversation_filter_recipients/types.d.ts.map +1 -1
  20. package/build/screens/conversation_filter_recipients/types.js.map +1 -1
  21. package/build/screens/message_actions_screen.js +3 -2
  22. package/build/screens/message_actions_screen.js.map +1 -1
  23. package/build/screens/reactions_screen.d.ts +1 -2
  24. package/build/screens/reactions_screen.d.ts.map +1 -1
  25. package/build/screens/reactions_screen.js +51 -37
  26. package/build/screens/reactions_screen.js.map +1 -1
  27. package/package.json +2 -2
  28. package/src/components/primitive/form_sheet.tsx +7 -3
  29. package/src/screens/conversation_filter_recipients/components/checkbox_row.tsx +8 -4
  30. package/src/screens/conversation_filter_recipients/components/header_row.tsx +7 -4
  31. package/src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx +97 -70
  32. package/src/screens/conversation_filter_recipients/types.tsx +2 -0
  33. package/src/screens/message_actions_screen.tsx +3 -2
  34. package/src/screens/reactions_screen.tsx +59 -41
  35. package/build/screens/conversation_filter_recipients/components/navigation_header.d.ts +0 -5
  36. package/build/screens/conversation_filter_recipients/components/navigation_header.d.ts.map +0 -1
  37. package/build/screens/conversation_filter_recipients/components/navigation_header.js +0 -46
  38. package/build/screens/conversation_filter_recipients/components/navigation_header.js.map +0 -1
  39. package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.d.ts +0 -17
  40. package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.d.ts.map +0 -1
  41. package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.js +0 -37
  42. package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.js.map +0 -1
  43. package/src/screens/conversation_filter_recipients/components/navigation_header.tsx +0 -68
  44. package/src/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.tsx +0 -53
@@ -1,6 +1,6 @@
1
1
  import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
2
2
  import React, { ReactNode } from 'react';
3
- import { type AccessibilityRole } from 'react-native';
3
+ import { type AccessibilityRole, type StyleProp, type ViewStyle } from 'react-native';
4
4
  import { IconString } from '../display';
5
5
  /**
6
6
  * Screen options for the formsheet's NativeStackNavigation route
@@ -20,8 +20,10 @@ export default _default;
20
20
  export type { FormSheetRootProps, FormSheetActionProps, FormSheetHeaderProps };
21
21
  interface FormSheetRootProps {
22
22
  children: ReactNode;
23
+ style?: StyleProp<ViewStyle>;
24
+ contentStyle?: StyleProp<ViewStyle>;
23
25
  }
24
- export declare function FormSheetRoot({ children }: FormSheetRootProps): React.JSX.Element;
26
+ export declare function FormSheetRoot({ children, style, contentStyle }: FormSheetRootProps): React.JSX.Element;
25
27
  export declare namespace FormSheetRoot {
26
28
  var displayName: string;
27
29
  }
@@ -1 +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,EAKL,KAAK,iBAAiB,EACvB,MAAM,cAAc,CAAA;AAIrB,OAAO,EAAiB,UAAU,EAAQ,MAAM,YAAY,CAAA;AAM5D;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,mDAInC,4BAA4B,KAAQ,4BAQrC,CAAA;AAQF,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAA;IAClC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAA;IACtC,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,oBAAoB,EAAE,CAAA;AAM9E,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,kBAAkB,qBAS7D;yBATe,aAAa;;;AA8B7B,UAAU,oBAAoB;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,eAAe,CAAC,EAAE,SAAS,CAAA;IAC3B,aAAa,CAAC,EAAE,SAAS,CAAA;CAC1B;AA0BD,QAAA,MAAM,6BAA6B;;;CAGzB,CAAA;AAEV,KAAK,8BAA8B,GACjC,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,OAAO,6BAA6B,CAAC,CA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AAC,CAAA;CACpC;AAED,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,kBAAkB,qBASlF;yBATe,aAAa;;;AA8B7B,UAAU,oBAAoB;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,eAAe,CAAC,EAAE,SAAS,CAAA;IAC3B,aAAa,CAAC,EAAE,SAAS,CAAA;CAC1B;AA0BD,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;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB"}
@@ -29,11 +29,11 @@ const FormSheet = {
29
29
  Header: FormSheetHeader,
30
30
  };
31
31
  export default FormSheet;
32
- export function FormSheetRoot({ children }) {
32
+ export function FormSheetRoot({ children, style, contentStyle }) {
33
33
  const styles = useStyles();
34
- return (<View style={styles.container} collapsable={false}>
34
+ return (<View style={[styles.container, style]} collapsable={false}>
35
35
  <AndroidSheetGrabber />
36
- <View style={styles.content}>{children}</View>
36
+ <View style={[styles.content, contentStyle]}>{children}</View>
37
37
  </View>);
38
38
  }
39
39
  FormSheetRoot.displayName = 'FormSheet.Root';
@@ -1 +1 @@
1
- {"version":3,"file":"form_sheet.js","sourceRoot":"","sources":["../../../src/components/primitive/form_sheet.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAA;AACxC,OAAO,EACL,QAAQ,EACR,UAA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AQ;YACpB,eAAe,EAAE,EAAE;YACnB,iBAAiB,EAAE,EAAE;YACrB,GAAG,EAAE,CAAC;SACP;QACD,UAAU,EAAE;YACV,KAAK,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC,SAAS;SACjD;QACD,WAAW,EAAE;YACX,KAAK,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC,SAAS;SACjD;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { NativeStackNavigationOptions } from '@react-navigation/native-stack'\nimport React, { ReactNode } from 'react'\nimport {\n Platform,\n StyleSheet,\n View,\n useWindowDimensions,\n type AccessibilityRole,\n} from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { useTheme } from '../../hooks'\nimport { PlatformPressable, useHeaderHeight } from '@react-navigation/elements'\nimport { Heading, 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 Header: FormSheetHeader,\n} as const\n\ntype FormSheetComponents = {\n Root: React.FC<FormSheetRootProps>\n Action: React.FC<FormSheetActionProps>\n Header: React.FC<FormSheetHeaderProps>\n}\n\nexport default FormSheet as FormSheetComponents\nexport type { FormSheetRootProps, FormSheetActionProps, FormSheetHeaderProps }\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} collapsable={false}>\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// ====== FormSheetHeader =============\n// ====================================\n\ninterface FormSheetHeaderProps {\n title: string\n secondaryButton?: ReactNode\n primaryButton?: ReactNode\n}\nfunction FormSheetHeader({ title, secondaryButton, primaryButton }: FormSheetHeaderProps) {\n const styles = useStyles()\n const hasActions = Boolean(secondaryButton) || Boolean(primaryButton)\n\n return (\n <View style={styles.header}>\n <Heading variant=\"h3\" style={styles.headerTitle}>\n {title}\n </Heading>\n {hasActions && (\n <View style={styles.headerActions}>\n {secondaryButton}\n {primaryButton}\n </View>\n )}\n </View>\n )\n}\n\nFormSheetHeader.displayName = 'FormSheet.Header'\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}\n\nfunction FormSheetAction({\n title,\n iconName,\n onPress,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole = 'button',\n appearance = 'neutral',\n disabled = false,\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 disabled={disabled}\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 { 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 flex: 1,\n justifyContent: 'flex-start',\n paddingBottom: bottom,\n width: '100%',\n backgroundColor: colors.fillColorNeutral100Inverted,\n height: containerHeight,\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 header: {\n backgroundColor: colors.fillColorNeutral100Inverted,\n paddingHorizontal: 16,\n paddingBottom: 16,\n gap: 16,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n headerTitle: {\n textAlign: 'left',\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: appearanceColorsMap[appearance].iconColor,\n },\n actionTitle: {\n color: appearanceColorsMap[appearance].textColor,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"form_sheet.js","sourceRoot":"","sources":["../../../src/components/primitive/form_sheet.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAA;AACxC,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,iBAAiB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC/E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAc,IAAI,EAAE,MAAM,YAAY,CAAA;AAE5D,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,EAAE,CAAC,CAAC;IACtE,YAAY,EAAE,WAAW;IACzB,WAAW,EAAE,KAAK;IAClB,mBAAmB;IACnB,iBAAiB,EAAE,EAAE;IACrB,mBAAmB,EAAE,IAAI;IACzB,WAAW;IACX,GAAG,IAAI;CACR,CAAC,CAAA;AAEF,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,aAAa;IACnB,MAAM,EAAE,eAAe;IACvB,MAAM,EAAE,eAAe;CACf,CAAA;AAQV,eAAe,SAAgC,CAAA;AAa/C,MAAM,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,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MAAM,CAAC,2BAA2B;YACnD,iBAAiB,EAAE,EAAE;YACrB,aAAa,EAAE,EAAE;YACjB,GAAG,EAAE,EAAE;YACP,iBAAiB,EAAE,CAAC;YACpB,iBAAiB,EAAE,MAAM,CAAC,sBAAsB;YAChD,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,eAAe;SAChC;QACD,WAAW,EAAE;YACX,SAAS,EAAE,MAAM;SAClB;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,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 {\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 { PlatformPressable, useHeaderHeight } from '@react-navigation/elements'\nimport { Heading, 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 Header: FormSheetHeader,\n} as const\n\ntype FormSheetComponents = {\n Root: React.FC<FormSheetRootProps>\n Action: React.FC<FormSheetActionProps>\n Header: React.FC<FormSheetHeaderProps>\n}\n\nexport default FormSheet as FormSheetComponents\nexport type { FormSheetRootProps, FormSheetActionProps, FormSheetHeaderProps }\n\n// ====================================\n// ====== ActionsFormSheetRoot ========\n// ====================================\n\ninterface FormSheetRootProps {\n children: ReactNode\n style?: StyleProp<ViewStyle>\n contentStyle?: StyleProp<ViewStyle>\n}\n\nexport function FormSheetRoot({ children, style, contentStyle }: FormSheetRootProps) {\n const styles = useStyles()\n\n return (\n <View style={[styles.container, style]} collapsable={false}>\n <AndroidSheetGrabber />\n <View style={[styles.content, contentStyle]}>{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// ====== FormSheetHeader =============\n// ====================================\n\ninterface FormSheetHeaderProps {\n title: string\n secondaryButton?: ReactNode\n primaryButton?: ReactNode\n}\nfunction FormSheetHeader({ title, secondaryButton, primaryButton }: FormSheetHeaderProps) {\n const styles = useStyles()\n const hasActions = Boolean(secondaryButton) || Boolean(primaryButton)\n\n return (\n <View style={styles.header}>\n <Heading variant=\"h3\" style={styles.headerTitle}>\n {title}\n </Heading>\n {hasActions && (\n <View style={styles.headerActions}>\n {secondaryButton}\n {primaryButton}\n </View>\n )}\n </View>\n )\n}\n\nFormSheetHeader.displayName = 'FormSheet.Header'\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}\n\nfunction FormSheetAction({\n title,\n iconName,\n onPress,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole = 'button',\n appearance = 'neutral',\n disabled = false,\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 disabled={disabled}\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 { 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 flex: 1,\n justifyContent: 'flex-start',\n paddingBottom: bottom,\n width: '100%',\n backgroundColor: colors.fillColorNeutral100Inverted,\n height: containerHeight,\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 header: {\n backgroundColor: colors.fillColorNeutral100Inverted,\n paddingHorizontal: 16,\n paddingBottom: 16,\n gap: 16,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n headerTitle: {\n textAlign: 'left',\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: appearanceColorsMap[appearance].iconColor,\n },\n actionTitle: {\n color: appearanceColorsMap[appearance].textColor,\n },\n })\n}\n"]}
@@ -64,7 +64,7 @@ export declare const NewConversationStack: import("@react-navigation/native").Ty
64
64
  };
65
65
  };
66
66
  readonly ConversationFilterRecipients: {
67
- readonly screen: ({}: import("../screens/conversation_filter_recipients/types").ConversationFilterRecipientsScreenProps) => React.JSX.Element;
67
+ readonly screen: ({ route, }: import("../screens/conversation_filter_recipients/types").ConversationFilterRecipientsScreenProps) => React.JSX.Element;
68
68
  readonly options: import("@react-navigation/native-stack").NativeStackNavigationOptions;
69
69
  };
70
70
  readonly ConversationNew: {
@@ -201,7 +201,7 @@ export declare const ChatStack: import("@react-navigation/native").TypedNavigato
201
201
  };
202
202
  };
203
203
  readonly ConversationFilterRecipients: {
204
- readonly screen: ({}: import("../screens/conversation_filter_recipients/types").ConversationFilterRecipientsScreenProps) => React.JSX.Element;
204
+ readonly screen: ({ route, }: import("../screens/conversation_filter_recipients/types").ConversationFilterRecipientsScreenProps) => React.JSX.Element;
205
205
  readonly options: import("@react-navigation/native-stack").NativeStackNavigationOptions;
206
206
  };
207
207
  readonly ConversationNew: {
@@ -1,10 +1,11 @@
1
1
  import { type ViewStyle } from 'react-native';
2
- import { TeamProps } from '../types';
2
+ import { SetTeamFilters, TeamProps } from '../types';
3
3
  interface TeamRowProps {
4
4
  data: TeamProps;
5
5
  style?: ViewStyle;
6
6
  accessibilityLabelledBy: string;
7
+ setTeamFilters: SetTeamFilters;
7
8
  }
8
- export declare const CheckboxRow: ({ data, style, accessibilityLabelledBy }: TeamRowProps) => import("react").JSX.Element;
9
+ export declare const CheckboxRow: ({ data, style, accessibilityLabelledBy, setTeamFilters, }: TeamRowProps) => import("react").JSX.Element;
9
10
  export {};
10
11
  //# sourceMappingURL=checkbox_row.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox_row.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/checkbox_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAI1E,OAAO,EAA2C,SAAS,EAAE,MAAM,UAAU,CAAA;AAI7E,UAAU,YAAY;IACpB,IAAI,EAAE,SAAS,CAAA;IACf,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,uBAAuB,EAAE,MAAM,CAAA;CAChC;AAED,eAAO,MAAM,WAAW,6CAA8C,YAAY,gCAiCjF,CAAA"}
1
+ {"version":3,"file":"checkbox_row.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/checkbox_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAI1E,OAAO,EAA2C,cAAc,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAG7F,UAAU,YAAY;IACpB,IAAI,EAAE,SAAS,CAAA;IACf,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,uBAAuB,EAAE,MAAM,CAAA;IAC/B,cAAc,EAAE,cAAc,CAAA;CAC/B;AAED,eAAO,MAAM,WAAW,8DAKrB,YAAY,gCAgCd,CAAA"}
@@ -3,11 +3,9 @@ import { useTheme } from '../../../hooks';
3
3
  import { Icon, Text } from '../../../components';
4
4
  import { tokens } from '../../../vendor/tapestry/tokens';
5
5
  import { useRoute } from '@react-navigation/native';
6
- import { useFilterRecipientsContext } from '../context/conversation_filter_recipients_context';
7
- export const CheckboxRow = ({ data, style, accessibilityLabelledBy }) => {
6
+ export const CheckboxRow = ({ data, style, accessibilityLabelledBy, setTeamFilters, }) => {
8
7
  const styles = useStyles();
9
8
  const route = useRoute();
10
- const { setTeamFilters } = useFilterRecipientsContext();
11
9
  const { teamId, teamName } = data;
12
10
  const { team_ids: currentTeamIds } = route.params;
13
11
  const checked = currentTeamIds?.includes(teamId) ?? false;
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/checkbox_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAA;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAExD,OAAO,EAAkB,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mDAAmD,CAAA;AAQ9F,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,uBAAuB,EAAgB,EAAE,EAAE;IACpF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,KAAK,GAAG,QAAQ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kBAAkB,EAAE;YAClB,GAAG,kBAAkB;YACrB,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,MAAM,CAAC,wBAAwB;SAC7C;QACD,WAAW,EAAE;YACX,KAAK,EAAE,MAAM,CAAC,oBAAoB;SACnC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { Pressable, View, StyleSheet, type ViewStyle } from 'react-native'\nimport { useTheme } from '../../../hooks'\nimport { Icon, Text } from '../../../components'\nimport { tokens } from '../../../vendor/tapestry/tokens'\nimport { ConversationFilterRecipientsScreenProps, TeamProps } from '../types'\nimport { type RouteProp, useRoute } from '@react-navigation/native'\nimport { useFilterRecipientsContext } from '../context/conversation_filter_recipients_context'\n\ninterface TeamRowProps {\n data: TeamProps\n style?: ViewStyle\n accessibilityLabelledBy: string\n}\n\nexport const CheckboxRow = ({ data, style, accessibilityLabelledBy }: TeamRowProps) => {\n const styles = useStyles()\n const route = useRoute<RouteProp<ConversationFilterRecipientsScreenProps['route']>>()\n const { setTeamFilters } = useFilterRecipientsContext()\n\n const { teamId, teamName } = data\n const { team_ids: currentTeamIds } = route.params\n\n const checked = currentTeamIds?.includes(teamId) ?? false\n const newTeamIdAdded = [...(currentTeamIds ?? []), teamId]\n const newTeamIdRemoved = (currentTeamIds ?? []).filter(currentId => currentId !== teamId)\n\n const handlePress = () => {\n setTeamFilters({\n team_ids: checked ? newTeamIdRemoved : newTeamIdAdded,\n })\n }\n\n return (\n <Pressable\n style={({ pressed }) => [styles.checkboxRow, pressed && styles.checkboxRowPressed, style]}\n onPress={handlePress}\n accessibilityRole=\"checkbox\"\n accessibilityState={{ checked }}\n accessibilityLabelledBy={accessibilityLabelledBy}\n accessibilityLabel={`${teamName} team`}\n >\n <CheckboxIcon checked={checked} />\n <Text style={styles.label} numberOfLines={2}>\n {teamName}\n </Text>\n </Pressable>\n )\n}\n\nfunction CheckboxIcon({ checked }: { checked: boolean }) {\n const styles = useStyles()\n const checkedStyle = checked ? styles.checkedContainer : styles.uncheckedContainer\n\n return (\n <View style={checkedStyle}>\n {checked && <Icon name=\"general.thickCheckmark\" style={styles.checkedIcon} />}\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n const baseCheckboxStyles: ViewStyle = {\n width: 20,\n height: 20,\n borderRadius: 40,\n alignItems: 'center',\n justifyContent: 'center',\n }\n\n return StyleSheet.create({\n checkboxRow: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n padding: 16,\n borderTopWidth: 1,\n borderTopColor: colors.borderColorDefaultDim,\n backgroundColor: colors.surfaceColor100,\n },\n checkboxRowPressed: {\n opacity: 0.5,\n },\n label: {\n flex: 1,\n },\n checkedContainer: {\n ...baseCheckboxStyles,\n backgroundColor: colors.statusSuccessIcon,\n },\n uncheckedContainer: {\n ...baseCheckboxStyles,\n borderWidth: 2,\n borderColor: colors.borderColorDefaultDarker,\n },\n checkedIcon: {\n color: tokens.colorNeutral100White,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"checkbox_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/checkbox_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAA;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAExD,OAAO,EAAkB,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AASnE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,IAAI,EACJ,KAAK,EACL,uBAAuB,EACvB,cAAc,GACD,EAAE,EAAE;IACjB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,KAAK,GAAG,QAAQ,EAA+D,CAAA;IAErF,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE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AAE;YACX,KAAK,EAAE,MAAM,CAAC,oBAAoB;SACnC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { Pressable, View, StyleSheet, type ViewStyle } from 'react-native'\nimport { useTheme } from '../../../hooks'\nimport { Icon, Text } from '../../../components'\nimport { tokens } from '../../../vendor/tapestry/tokens'\nimport { ConversationFilterRecipientsScreenProps, SetTeamFilters, TeamProps } from '../types'\nimport { type RouteProp, useRoute } from '@react-navigation/native'\n\ninterface TeamRowProps {\n data: TeamProps\n style?: ViewStyle\n accessibilityLabelledBy: string\n setTeamFilters: SetTeamFilters\n}\n\nexport const CheckboxRow = ({\n data,\n style,\n accessibilityLabelledBy,\n setTeamFilters,\n}: TeamRowProps) => {\n const styles = useStyles()\n const route = useRoute<RouteProp<ConversationFilterRecipientsScreenProps['route']>>()\n\n const { teamId, teamName } = data\n const { team_ids: currentTeamIds } = route.params\n\n const checked = currentTeamIds?.includes(teamId) ?? false\n const newTeamIdAdded = [...(currentTeamIds ?? []), teamId]\n const newTeamIdRemoved = (currentTeamIds ?? []).filter(currentId => currentId !== teamId)\n\n const handlePress = () => {\n setTeamFilters({\n team_ids: checked ? newTeamIdRemoved : newTeamIdAdded,\n })\n }\n\n return (\n <Pressable\n style={({ pressed }) => [styles.checkboxRow, pressed && styles.checkboxRowPressed, style]}\n onPress={handlePress}\n accessibilityRole=\"checkbox\"\n accessibilityState={{ checked }}\n accessibilityLabelledBy={accessibilityLabelledBy}\n accessibilityLabel={`${teamName} team`}\n >\n <CheckboxIcon checked={checked} />\n <Text style={styles.label} numberOfLines={2}>\n {teamName}\n </Text>\n </Pressable>\n )\n}\n\nfunction CheckboxIcon({ checked }: { checked: boolean }) {\n const styles = useStyles()\n const checkedStyle = checked ? styles.checkedContainer : styles.uncheckedContainer\n\n return (\n <View style={checkedStyle}>\n {checked && <Icon name=\"general.thickCheckmark\" style={styles.checkedIcon} />}\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n const baseCheckboxStyles: ViewStyle = {\n width: 20,\n height: 20,\n borderRadius: 40,\n alignItems: 'center',\n justifyContent: 'center',\n }\n\n return StyleSheet.create({\n checkboxRow: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n padding: 16,\n borderTopWidth: 1,\n borderTopColor: colors.borderColorDefaultDim,\n backgroundColor: colors.surfaceColor100,\n },\n checkboxRowPressed: {\n opacity: 0.5,\n },\n label: {\n flex: 1,\n },\n checkedContainer: {\n ...baseCheckboxStyles,\n backgroundColor: colors.statusSuccessIcon,\n },\n uncheckedContainer: {\n ...baseCheckboxStyles,\n borderWidth: 2,\n borderColor: colors.borderColorDefaultDarker,\n },\n checkedIcon: {\n color: tokens.colorNeutral100White,\n },\n })\n}\n"]}
@@ -1,10 +1,11 @@
1
1
  import { type ViewStyle } from 'react-native';
2
- import type { ServiceTypeProps } from '../types';
2
+ import type { ServiceTypeProps, SetTeamFilters } from '../types';
3
3
  interface HeaderRowProps {
4
4
  data: ServiceTypeProps;
5
5
  nativeID: string;
6
6
  style?: ViewStyle;
7
+ setTeamFilters: SetTeamFilters;
7
8
  }
8
- export declare const HeaderRow: ({ data, nativeID, style }: HeaderRowProps) => import("react").JSX.Element;
9
+ export declare const HeaderRow: ({ data, nativeID, style, setTeamFilters }: HeaderRowProps) => import("react").JSX.Element;
9
10
  export {};
10
11
  //# sourceMappingURL=header_row.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"header_row.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/header_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAG/D,OAAO,KAAK,EAA2C,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAQzF,UAAU,cAAc;IACtB,IAAI,EAAE,gBAAgB,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB;AAED,eAAO,MAAM,SAAS,8BAA+B,cAAc,gCAkDlE,CAAA"}
1
+ {"version":3,"file":"header_row.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/header_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAG/D,OAAO,KAAK,EAEV,gBAAgB,EAChB,cAAc,EACf,MAAM,UAAU,CAAA;AAOjB,UAAU,cAAc;IACtB,IAAI,EAAE,gBAAgB,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,cAAc,EAAE,cAAc,CAAA;CAC/B;AAED,eAAO,MAAM,SAAS,8CAA+C,cAAc,gCAiDlF,CAAA"}
@@ -4,11 +4,9 @@ import { Icon, Heading, TextButton } from '../../../components';
4
4
  import { tokens } from '../../../vendor/tapestry/tokens';
5
5
  import { pluralize } from '../../../utils';
6
6
  import { useRoute } from '@react-navigation/native';
7
- import { useFilterRecipientsContext } from '../context/conversation_filter_recipients_context';
8
7
  const BULK_SELECT_LIMIT = 10;
9
- export const HeaderRow = ({ data, nativeID, style }) => {
8
+ export const HeaderRow = ({ data, nativeID, style, setTeamFilters }) => {
10
9
  const styles = useStyles();
11
- const { setTeamFilters } = useFilterRecipientsContext();
12
10
  const route = useRoute();
13
11
  const { serviceTypeName, teamIdsForServiceType } = data;
14
12
  const { team_ids: currentTeamIds = [] } = route.params;
@@ -1 +1 @@
1
- {"version":3,"file":"header_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/header_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CA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vB,SAAS,EAAE;YACT,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;YAC/B,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE,EAAE;YACX,GAAG,EAAE,EAAE;YACP,eAAe,EAAE,MAAM,CAAC,eAAe;SACxC;QACD,UAAU,EAAE;YACV,UAAU,EAAE,QAAQ;YACpB,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,MAAM,CAAC,uBAAuB;YACrC,QAAQ,EAAE,MAAM,CAAC,UAAU;SAC5B;QACD,aAAa,EAAE;YACb,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,EAAE;YACP,IAAI,EAAE,CAAC;SACR;QACD,UAAU,EAAE;YACV,KAAK,EAAE,MAAM,CAAC,WAAW;YACzB,QAAQ,EAAE,MAAM,CAAC,UAAU;SAC5B;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { View, StyleSheet, type ViewStyle } from 'react-native'\nimport { useTheme } from '../../../hooks'\nimport { Icon, Heading, TextButton } from '../../../components'\nimport type { ConversationFilterRecipientsScreenProps, ServiceTypeProps } from '../types'\nimport { tokens } from '../../../vendor/tapestry/tokens'\nimport { pluralize } from '../../../utils'\nimport { useRoute, type RouteProp } from '@react-navigation/native'\nimport { useFilterRecipientsContext } from '../context/conversation_filter_recipients_context'\n\nconst BULK_SELECT_LIMIT = 10\n\ninterface HeaderRowProps {\n data: ServiceTypeProps\n nativeID: string\n style?: ViewStyle\n}\n\nexport const HeaderRow = ({ data, nativeID, style }: HeaderRowProps) => {\n const styles = useStyles()\n const { setTeamFilters } = useFilterRecipientsContext()\n const route = useRoute<RouteProp<ConversationFilterRecipientsScreenProps['route']>>()\n\n const { serviceTypeName, teamIdsForServiceType } = data\n const { team_ids: currentTeamIds = [] } = route.params\n\n const newTeamIdsAdded = [...new Set([...currentTeamIds, ...teamIdsForServiceType])]\n const newTeamIdsRemoved = currentTeamIds.filter(id => !teamIdsForServiceType.includes(id))\n\n const allTeamsSelected = teamIdsForServiceType.every(id => currentTeamIds.includes(id))\n const showSelectAll = teamIdsForServiceType.length <= BULK_SELECT_LIMIT\n const selectLabel = allTeamsSelected ? 'Deselect' : 'Select'\n\n const headingAccessibilityHint = `${pluralize(teamIdsForServiceType.length, 'team')} available to select`\n const selectAllAccessibilityLabel = `${selectLabel} ${pluralize(teamIdsForServiceType.length, 'team')} for ${serviceTypeName}`\n\n const handleSelectAll = () => {\n setTeamFilters({\n team_ids: allTeamsSelected ? newTeamIdsRemoved : newTeamIdsAdded,\n })\n }\n\n return (\n <View style={[styles.headerRow, style]}>\n <View style={styles.headerContent}>\n <Icon name=\"services.folderClosed\" style={styles.headerIcon} />\n <Heading\n variant=\"h3\"\n style={styles.headerText}\n numberOfLines={2}\n nativeID={nativeID}\n accessibilityHint={headingAccessibilityHint}\n >\n {serviceTypeName}\n </Heading>\n </View>\n\n {showSelectAll && (\n <TextButton\n variant=\"tertiary\"\n onPress={handleSelectAll}\n accessibilityLabel={selectAllAccessibilityLabel}\n >\n {selectLabel} all\n </TextButton>\n )}\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n headerRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 16,\n gap: 12,\n backgroundColor: colors.surfaceColor100,\n },\n headerText: {\n fontWeight: 'normal',\n flex: 1,\n color: colors.textColorDefaultPrimary,\n fontSize: tokens.fontSizeSm,\n },\n headerContent: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n flex: 1,\n },\n headerIcon: {\n color: colors.interaction,\n fontSize: tokens.fontSizeMd,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"header_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/header_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAE,QAAQ,EAAE,M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AA;IAE7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;YAC/B,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE,EAAE;YACX,GAAG,EAAE,EAAE;YACP,eAAe,EAAE,MAAM,CAAC,eAAe;SACxC;QACD,UAAU,EAAE;YACV,UAAU,EAAE,QAAQ;YACpB,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,MAAM,CAAC,uBAAuB;YACrC,QAAQ,EAAE,MAAM,CAAC,UAAU;SAC5B;QACD,aAAa,EAAE;YACb,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,EAAE;YACP,IAAI,EAAE,CAAC;SACR;QACD,UAAU,EAAE;YACV,KAAK,EAAE,MAAM,CAAC,WAAW;YACzB,QAAQ,EAAE,MAAM,CAAC,UAAU;SAC5B;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { View, StyleSheet, type ViewStyle } from 'react-native'\nimport { useTheme } from '../../../hooks'\nimport { Icon, Heading, TextButton } from '../../../components'\nimport type {\n ConversationFilterRecipientsScreenProps,\n ServiceTypeProps,\n SetTeamFilters,\n} from '../types'\nimport { tokens } from '../../../vendor/tapestry/tokens'\nimport { pluralize } from '../../../utils'\nimport { useRoute, type RouteProp } from '@react-navigation/native'\n\nconst BULK_SELECT_LIMIT = 10\n\ninterface HeaderRowProps {\n data: ServiceTypeProps\n nativeID: string\n style?: ViewStyle\n setTeamFilters: SetTeamFilters\n}\n\nexport const HeaderRow = ({ data, nativeID, style, setTeamFilters }: HeaderRowProps) => {\n const styles = useStyles()\n const route = useRoute<RouteProp<ConversationFilterRecipientsScreenProps['route']>>()\n\n const { serviceTypeName, teamIdsForServiceType } = data\n const { team_ids: currentTeamIds = [] } = route.params\n\n const newTeamIdsAdded = [...new Set([...currentTeamIds, ...teamIdsForServiceType])]\n const newTeamIdsRemoved = currentTeamIds.filter(id => !teamIdsForServiceType.includes(id))\n\n const allTeamsSelected = teamIdsForServiceType.every(id => currentTeamIds.includes(id))\n const showSelectAll = teamIdsForServiceType.length <= BULK_SELECT_LIMIT\n const selectLabel = allTeamsSelected ? 'Deselect' : 'Select'\n\n const headingAccessibilityHint = `${pluralize(teamIdsForServiceType.length, 'team')} available to select`\n const selectAllAccessibilityLabel = `${selectLabel} ${pluralize(teamIdsForServiceType.length, 'team')} for ${serviceTypeName}`\n\n const handleSelectAll = () => {\n setTeamFilters({\n team_ids: allTeamsSelected ? newTeamIdsRemoved : newTeamIdsAdded,\n })\n }\n\n return (\n <View style={[styles.headerRow, style]}>\n <View style={styles.headerContent}>\n <Icon name=\"services.folderClosed\" style={styles.headerIcon} />\n <Heading\n variant=\"h3\"\n style={styles.headerText}\n numberOfLines={2}\n nativeID={nativeID}\n accessibilityHint={headingAccessibilityHint}\n >\n {serviceTypeName}\n </Heading>\n </View>\n\n {showSelectAll && (\n <TextButton\n variant=\"tertiary\"\n onPress={handleSelectAll}\n accessibilityLabel={selectAllAccessibilityLabel}\n >\n {selectLabel} all\n </TextButton>\n )}\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n headerRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 16,\n gap: 12,\n backgroundColor: colors.surfaceColor100,\n },\n headerText: {\n fontWeight: 'normal',\n flex: 1,\n color: colors.textColorDefaultPrimary,\n fontSize: tokens.fontSizeSm,\n },\n headerContent: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n flex: 1,\n },\n headerIcon: {\n color: colors.interaction,\n fontSize: tokens.fontSizeMd,\n },\n })\n}\n"]}
@@ -1,6 +1,5 @@
1
- import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
2
1
  import React from 'react';
3
2
  import { ConversationFilterRecipientsScreenProps } from './types';
4
- export declare const ConversationFilterReceipientsScreenOptions: NativeStackNavigationOptions;
5
- export declare const ConversationFilterRecipientsScreen: ({}: ConversationFilterRecipientsScreenProps) => React.JSX.Element;
3
+ export declare const ConversationFilterReceipientsScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
4
+ export declare const ConversationFilterRecipientsScreen: ({ route, }: ConversationFilterRecipientsScreenProps) => React.JSX.Element;
6
5
  //# sourceMappingURL=conversation_filter_recipients_screen.d.ts.map
@@ -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":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,EAAE,uCAAuC,EAAgB,MAAM,SAAS,CAAA;AAW/E,eAAO,MAAM,0CAA0C,EAAE,4BAYxD,CAAA;AAED,eAAO,MAAM,kCAAkC,OAAQ,uCAAuC,sBAmD7F,CAAA"}
1
+ {"version":3,"file":"conversation_filter_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAO1C,OAAO,EAAE,uCAAuC,EAAgB,MAAM,SAAS,CAAA;AAU/E,eAAO,MAAM,0CAA0C,uEAMrD,CAAA;AAEF,eAAO,MAAM,kCAAkC,eAE5C,uCAAuC,sBA8FzC,CAAA"}
@@ -1,75 +1,76 @@
1
- import React from 'react';
2
- import { Platform, StyleSheet, useWindowDimensions, View } from 'react-native';
1
+ import React, { useCallback } from 'react';
2
+ import { Platform, StyleSheet } from 'react-native';
3
3
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
- import { FlashList } from '@shopify/flash-list';
5
- import { Heading } from '../../components';
4
+ import { FlatList } from 'react-native-gesture-handler';
5
+ import { Button, Heading, TextButton } from '../../components';
6
6
  import { useTheme } from '../../hooks';
7
7
  import { useFlattenedArrayOfServiceTypesWithTeams } from './hooks/use_flattened_array_of_service_types_with_teams';
8
8
  import { SectionTypes } from './types';
9
9
  import { HeaderRow } from './components/header_row';
10
10
  import { tokens } from '../../vendor/tapestry/tokens';
11
11
  import { CheckboxRow } from './components/checkbox_row';
12
- import { useHeaderHeight } from '@react-navigation/elements';
13
- import { FilterRecipientsProvider } from './context/conversation_filter_recipients_context';
14
- import { HeaderRightWithContext, FilterHeaderTitle } from './components/navigation_header';
15
12
  import { useServiceTypesWithTeams } from './hooks/use_service_types_with_teams';
13
+ import { StackActions, useNavigation } from '@react-navigation/native';
14
+ import FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet';
16
15
  const SERVICE_TYPE_LABELLED_BY_PREFIX = 'header-';
17
- export const ConversationFilterReceipientsScreenOptions = {
18
- presentation: Platform.select({ android: 'modal', ios: 'formSheet' }),
16
+ export const ConversationFilterReceipientsScreenOptions = getFormSheetScreenOptions({
19
17
  sheetAllowedDetents: Platform.select({
20
18
  android: [0.75, 0.94],
21
19
  default: [0.75, 1],
22
20
  }),
23
- sheetGrabberVisible: true,
24
- headerBackVisible: false,
25
- headerRight: HeaderRightWithContext,
26
- headerTitle: FilterHeaderTitle,
27
- headerTitleAlign: 'left',
28
- sheetCornerRadius: 16,
29
- };
30
- export const ConversationFilterRecipientsScreen = ({}) => {
21
+ headerTitle: 'Teams I lead',
22
+ });
23
+ export const ConversationFilterRecipientsScreen = ({ route, }) => {
31
24
  const styles = useStyles();
25
+ const navigation = useNavigation();
32
26
  const { serviceTypes } = useServiceTypesWithTeams();
33
27
  const data = useFlattenedArrayOfServiceTypesWithTeams({
34
28
  data: serviceTypes,
35
29
  firstRowStyle: styles.firstRow,
36
30
  lastRowStyle: styles.lastRow,
37
31
  });
38
- return (<FilterRecipientsProvider>
39
- <View style={styles.listWrapper}>
40
- <FlashList data={data} ListHeaderComponent={<Heading variant="h3" style={styles.listHeader}>
41
- Service Types
42
- </Heading>} estimatedItemSize={50} contentContainerStyle={styles.listContentContainer} keyExtractor={item => `${item.type === SectionTypes.header ? item.data.serviceTypeId : item.data.teamId}`} renderItem={({ item }) => {
32
+ const { params } = route;
33
+ const noTeamsSelected = params.team_ids?.length === 0 || !params.team_ids;
34
+ const applyButtonAccessibilityHint = noTeamsSelected
35
+ ? 'Select at least one team to navigate to the final step in creating your conversation.'
36
+ : 'Saves selected teams and navigates to the final step to create your conversation.';
37
+ const setTeamFilters = useCallback(({ team_ids }) => {
38
+ navigation.setParams({
39
+ team_ids,
40
+ });
41
+ }, [navigation]);
42
+ const resetTeamFilters = useCallback(() => {
43
+ navigation.goBack();
44
+ }, [navigation]);
45
+ const applyTeamFilters = useCallback(() => {
46
+ navigation.dispatch(StackActions.popTo('ConversationNew', params));
47
+ }, [navigation, params]);
48
+ return (<FormSheet.Root>
49
+ <FormSheet.Header title="Teams I lead" secondaryButton={<TextButton onPress={resetTeamFilters} accessibilityHint="Cancels any selected teams and closes this modal.">
50
+ Cancel
51
+ </TextButton>} primaryButton={<Button title="Apply" accessibilityHint={applyButtonAccessibilityHint} onPress={applyTeamFilters} disabled={noTeamsSelected}/>}/>
52
+ <FlatList data={data} ListHeaderComponent={<Heading variant="h3" style={styles.listHeader}>
53
+ Service Types
54
+ </Heading>} contentContainerStyle={styles.listContentContainer} keyExtractor={item => `${item.type === SectionTypes.header ? item.data.serviceTypeId : item.data.teamId}`} renderItem={({ item }) => {
43
55
  switch (item.type) {
44
56
  case SectionTypes.header:
45
- return (<HeaderRow data={item.data} style={item.sectionStyle} nativeID={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`}/>);
57
+ return (<HeaderRow data={item.data} style={item.sectionStyle} nativeID={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`} setTeamFilters={setTeamFilters}/>);
46
58
  case SectionTypes.team:
47
- return (<CheckboxRow data={item.data} style={item.sectionStyle} accessibilityLabelledBy={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`}/>);
59
+ return (<CheckboxRow data={item.data} style={item.sectionStyle} accessibilityLabelledBy={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`} setTeamFilters={setTeamFilters}/>);
48
60
  default:
49
61
  return null;
50
62
  }
51
63
  }}/>
52
- </View>
53
- </FilterRecipientsProvider>);
64
+ </FormSheet.Root>);
54
65
  };
55
66
  const useStyles = () => {
56
67
  const { colors } = useTheme();
57
- const { top, bottom } = useSafeAreaInsets();
58
- const { height } = useWindowDimensions();
59
- const headerHeight = useHeaderHeight();
60
- const containerHeight = Platform.select({
61
- android: height,
62
- ios: height - top - headerHeight,
63
- });
68
+ const { bottom } = useSafeAreaInsets();
64
69
  return StyleSheet.create({
65
- listWrapper: {
66
- flex: 1,
67
- height: containerHeight,
68
- backgroundColor: colors.surfaceColor080,
69
- },
70
70
  listContentContainer: {
71
+ backgroundColor: colors.surfaceColor080,
71
72
  padding: 16,
72
- paddingBottom: bottom,
73
+ paddingBottom: bottom + Platform.select({ android: 24, default: 16 }),
73
74
  },
74
75
  listHeader: {
75
76
  paddingBottom: 16,
@@ -1 +1 @@
1
- {"version":3,"file":"conversation_filter_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,wCAAwC,EAAE,MAAM,yDAAyD,CAAA;AAClH,OAAO,EAA2C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AA;gBACH;oBACE,OAAO,IAAI,CAAA;YACf,CAAC;QACH,CAAC,CAAC,EAEN;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,wBAAwB,CAAC,CAC5B,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC7B,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAC3C,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,WAAW,EAAE;YACX,IAAI,EAAE,CAAC;YACP,MAAM,EAAE,eAAe;YACvB,eAAe,EAAE,MAAM,CAAC,eAAe;SACxC;QACD,oBAAoB,EAAE;YACpB,OAAO,EAAE,EAAE;YACX,aAAa,EAAE,MAAM;SACtB;QACD,UAAU,EAAE;YACV,aAAa,EAAE,EAAE;SAClB;QACD,QAAQ,EAAE;YACR,oBAAoB,EAAE,MAAM,CAAC,cAAc;YAC3C,kBAAkB,EAAE,MAAM,CAAC,cAAc;SAC1C;QACD,OAAO,EAAE;YACP,uBAAuB,EAAE,MAAM,CAAC,cAAc;YAC9C,qBAAqB,EAAE,MAAM,CAAC,cAAc;YAC5C,YAAY,EAAE,EAAE;SACjB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { NativeStackNavigationOptions } from '@react-navigation/native-stack'\nimport React from 'react'\nimport { Platform, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { FlashList } from '@shopify/flash-list'\nimport { Heading } from '../../components'\nimport { useTheme } from '../../hooks'\nimport { useFlattenedArrayOfServiceTypesWithTeams } from './hooks/use_flattened_array_of_service_types_with_teams'\nimport { ConversationFilterRecipientsScreenProps, SectionTypes } from './types'\nimport { HeaderRow } from './components/header_row'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { CheckboxRow } from './components/checkbox_row'\nimport { useHeaderHeight } from '@react-navigation/elements'\nimport { FilterRecipientsProvider } from './context/conversation_filter_recipients_context'\nimport { HeaderRightWithContext, FilterHeaderTitle } from './components/navigation_header'\nimport { useServiceTypesWithTeams } from './hooks/use_service_types_with_teams'\n\nconst SERVICE_TYPE_LABELLED_BY_PREFIX = 'header-'\n\nexport const ConversationFilterReceipientsScreenOptions: NativeStackNavigationOptions = {\n presentation: Platform.select({ android: 'modal', ios: 'formSheet' }),\n sheetAllowedDetents: Platform.select({\n android: [0.75, 0.94],\n default: [0.75, 1],\n }),\n sheetGrabberVisible: true,\n headerBackVisible: false,\n headerRight: HeaderRightWithContext,\n headerTitle: FilterHeaderTitle,\n headerTitleAlign: 'left',\n sheetCornerRadius: 16,\n}\n\nexport const ConversationFilterRecipientsScreen = ({}: ConversationFilterRecipientsScreenProps) => {\n const styles = useStyles()\n\n const { serviceTypes } = useServiceTypesWithTeams()\n const data = useFlattenedArrayOfServiceTypesWithTeams({\n data: serviceTypes,\n firstRowStyle: styles.firstRow,\n lastRowStyle: styles.lastRow,\n })\n\n return (\n <FilterRecipientsProvider>\n <View style={styles.listWrapper}>\n <FlashList\n data={data}\n ListHeaderComponent={\n <Heading variant=\"h3\" style={styles.listHeader}>\n Service Types\n </Heading>\n }\n estimatedItemSize={50}\n contentContainerStyle={styles.listContentContainer}\n keyExtractor={item =>\n `${item.type === SectionTypes.header ? item.data.serviceTypeId : item.data.teamId}`\n }\n renderItem={({ item }) => {\n switch (item.type) {\n case SectionTypes.header:\n return (\n <HeaderRow\n data={item.data}\n style={item.sectionStyle}\n nativeID={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`}\n />\n )\n case SectionTypes.team:\n return (\n <CheckboxRow\n data={item.data}\n style={item.sectionStyle}\n accessibilityLabelledBy={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`}\n />\n )\n default:\n return null\n }\n }}\n />\n </View>\n </FilterRecipientsProvider>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const { top, bottom } = 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 listWrapper: {\n flex: 1,\n height: containerHeight,\n backgroundColor: colors.surfaceColor080,\n },\n listContentContainer: {\n padding: 16,\n paddingBottom: bottom,\n },\n listHeader: {\n paddingBottom: 16,\n },\n firstRow: {\n borderTopStartRadius: tokens.borderRadiusLg,\n borderTopEndRadius: tokens.borderRadiusLg,\n },\n lastRow: {\n borderBottomStartRadius: tokens.borderRadiusLg,\n borderBottomEndRadius: tokens.borderRadiusLg,\n marginBottom: 16,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"conversation_filter_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,wCAAwC,EAAE,MAAM,yDAAyD,CAAA;AAClH,OAAO,EAA2C,YAA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BAAoB,EAAE;YACpB,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,OAAO,EAAE,EAAE;YACX,aAAa,EAAE,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;SACtE;QACD,UAAU,EAAE;YACV,aAAa,EAAE,EAAE;SAClB;QACD,QAAQ,EAAE;YACR,oBAAoB,EAAE,MAAM,CAAC,cAAc;YAC3C,kBAAkB,EAAE,MAAM,CAAC,cAAc;SAC1C;QACD,OAAO,EAAE;YACP,uBAAuB,EAAE,MAAM,CAAC,cAAc;YAC9C,qBAAqB,EAAE,MAAM,CAAC,cAAc;YAC5C,YAAY,EAAE,EAAE;SACjB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { NativeStackNavigationProp } from '@react-navigation/native-stack'\nimport React, { useCallback } from 'react'\nimport { Platform, StyleSheet } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { FlatList } from 'react-native-gesture-handler'\nimport { Button, Heading, TextButton } from '../../components'\nimport { useTheme } from '../../hooks'\nimport { useFlattenedArrayOfServiceTypesWithTeams } from './hooks/use_flattened_array_of_service_types_with_teams'\nimport { ConversationFilterRecipientsScreenProps, SectionTypes } from './types'\nimport { HeaderRow } from './components/header_row'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { CheckboxRow } from './components/checkbox_row'\nimport { useServiceTypesWithTeams } from './hooks/use_service_types_with_teams'\nimport { StackActions, useNavigation } from '@react-navigation/native'\nimport FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet'\n\nconst SERVICE_TYPE_LABELLED_BY_PREFIX = 'header-'\n\nexport const ConversationFilterReceipientsScreenOptions = getFormSheetScreenOptions({\n sheetAllowedDetents: Platform.select({\n android: [0.75, 0.94],\n default: [0.75, 1],\n }),\n headerTitle: 'Teams I lead',\n})\n\nexport const ConversationFilterRecipientsScreen = ({\n route,\n}: ConversationFilterRecipientsScreenProps) => {\n const styles = useStyles()\n const navigation =\n useNavigation<NativeStackNavigationProp<ConversationFilterRecipientsScreenProps>>()\n\n const { serviceTypes } = useServiceTypesWithTeams()\n const data = useFlattenedArrayOfServiceTypesWithTeams({\n data: serviceTypes,\n firstRowStyle: styles.firstRow,\n lastRowStyle: styles.lastRow,\n })\n\n const { params } = route\n const noTeamsSelected = params.team_ids?.length === 0 || !params.team_ids\n const applyButtonAccessibilityHint = noTeamsSelected\n ? 'Select at least one team to navigate to the final step in creating your conversation.'\n : 'Saves selected teams and navigates to the final step to create your conversation.'\n\n const setTeamFilters = useCallback(\n ({ team_ids }: { team_ids: number[] }) => {\n navigation.setParams({\n team_ids,\n })\n },\n [navigation]\n )\n\n const resetTeamFilters = useCallback(() => {\n navigation.goBack()\n }, [navigation])\n\n const applyTeamFilters = useCallback(() => {\n navigation.dispatch(StackActions.popTo('ConversationNew', params))\n }, [navigation, params])\n\n return (\n <FormSheet.Root>\n <FormSheet.Header\n title=\"Teams I lead\"\n secondaryButton={\n <TextButton\n onPress={resetTeamFilters}\n accessibilityHint=\"Cancels any selected teams and closes this modal.\"\n >\n Cancel\n </TextButton>\n }\n primaryButton={\n <Button\n title=\"Apply\"\n accessibilityHint={applyButtonAccessibilityHint}\n onPress={applyTeamFilters}\n disabled={noTeamsSelected}\n />\n }\n />\n <FlatList\n data={data}\n ListHeaderComponent={\n <Heading variant=\"h3\" style={styles.listHeader}>\n Service Types\n </Heading>\n }\n contentContainerStyle={styles.listContentContainer}\n keyExtractor={item =>\n `${item.type === SectionTypes.header ? item.data.serviceTypeId : item.data.teamId}`\n }\n renderItem={({ item }) => {\n switch (item.type) {\n case SectionTypes.header:\n return (\n <HeaderRow\n data={item.data}\n style={item.sectionStyle}\n nativeID={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`}\n setTeamFilters={setTeamFilters}\n />\n )\n case SectionTypes.team:\n return (\n <CheckboxRow\n data={item.data}\n style={item.sectionStyle}\n accessibilityLabelledBy={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`}\n setTeamFilters={setTeamFilters}\n />\n )\n default:\n return null\n }\n }}\n />\n </FormSheet.Root>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n listContentContainer: {\n backgroundColor: colors.surfaceColor080,\n padding: 16,\n paddingBottom: bottom + Platform.select({ android: 24, default: 16 }),\n },\n listHeader: {\n paddingBottom: 16,\n },\n firstRow: {\n borderTopStartRadius: tokens.borderRadiusLg,\n borderTopEndRadius: tokens.borderRadiusLg,\n },\n lastRow: {\n borderBottomStartRadius: tokens.borderRadiusLg,\n borderBottomEndRadius: tokens.borderRadiusLg,\n marginBottom: 16,\n },\n })\n}\n"]}
@@ -34,5 +34,8 @@ export type ConversationFilterRecipientsParams = {
34
34
  team_ids?: number[];
35
35
  };
36
36
  export type ConversationFilterRecipientsScreenProps = StaticScreenProps<ConversationFilterRecipientsParams>;
37
+ export type SetTeamFilters = ({ team_ids }: {
38
+ team_ids: number[];
39
+ }) => void;
37
40
  export {};
38
41
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAE5D,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE;QACL,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;KACb,EAAE,CAAA;CACJ;AAED,oBAAY,YAAY;IACtB,MAAM,IAAA;IACN,IAAI,IAAA;CACL;AAED,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,qBAAqB,EAAE,MAAM,EAAE,CAAA;CAChC;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,MAAM,eAAe,GAAG,KAAK,CACjC,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC,IAAI,CAAC,CACzF,CAAA;AAED,UAAU,QAAQ,CAAC,CAAC,EAAE,KAAK,SAAS,YAAY;IAC9C,IAAI,EAAE,KAAK,CAAA;IACX,IAAI,EAAE,CAAC,CAAA;IACP,YAAY,CAAC,EAAE,SAAS,CAAA;CACzB;AAED,MAAM,MAAM,kCAAkC,GAAG;IAC/C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,uCAAuC,GACjD,iBAAiB,CAAC,kCAAkC,CAAC,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAE5D,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE;QACL,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;KACb,EAAE,CAAA;CACJ;AAED,oBAAY,YAAY;IACtB,MAAM,IAAA;IACN,IAAI,IAAA;CACL;AAED,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,qBAAqB,EAAE,MAAM,EAAE,CAAA;CAChC;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,MAAM,eAAe,GAAG,KAAK,CACjC,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC,IAAI,CAAC,CACzF,CAAA;AAED,UAAU,QAAQ,CAAC,CAAC,EAAE,KAAK,SAAS,YAAY;IAC9C,IAAI,EAAE,KAAK,CAAA;IACX,IAAI,EAAE,CAAC,CAAA;IACP,YAAY,CAAC,EAAE,SAAS,CAAA;CACzB;AAED,MAAM,MAAM,kCAAkC,GAAG;IAC/C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,uCAAuC,GACjD,iBAAiB,CAAC,kCAAkC,CAAC,CAAA;AAEvD,MAAM,MAAM,cAAc,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,KAAK,IAAI,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/types.tsx"],"names":[],"mappings":"AAaA,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,mDAAM,CAAA;IACN,+CAAI,CAAA;AACN,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB","sourcesContent":["import { type ViewStyle } from 'react-native'\nimport { AppName } from '../../types/resources/app_name'\nimport { StaticScreenProps } from '@react-navigation/native'\n\nexport interface ServiceTypeWithTeams {\n id: number\n name: string\n teams: {\n id: number\n name: string\n }[]\n}\n\nexport enum SectionTypes {\n header,\n team,\n}\n\nexport interface ServiceTypeProps {\n serviceTypeName: string\n serviceTypeId: number\n teamIdsForServiceType: number[]\n}\n\nexport interface TeamProps {\n teamName: string\n teamId: number\n serviceTypeId: number\n}\n\nexport type SectionListData = Array<\n DataItem<ServiceTypeProps, SectionTypes.header> | DataItem<TeamProps, SectionTypes.team>\n>\n\ninterface DataItem<T, TName extends SectionTypes> {\n type: TName\n data: T\n sectionStyle?: ViewStyle\n}\n\nexport type ConversationFilterRecipientsParams = {\n source_app_name?: AppName\n team_ids?: number[]\n}\n\nexport type ConversationFilterRecipientsScreenProps =\n StaticScreenProps<ConversationFilterRecipientsParams>\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/types.tsx"],"names":[],"mappings":"AAaA,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,mDAAM,CAAA;IACN,+CAAI,CAAA;AACN,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB","sourcesContent":["import { type ViewStyle } from 'react-native'\nimport { AppName } from '../../types/resources/app_name'\nimport { StaticScreenProps } from '@react-navigation/native'\n\nexport interface ServiceTypeWithTeams {\n id: number\n name: string\n teams: {\n id: number\n name: string\n }[]\n}\n\nexport enum SectionTypes {\n header,\n team,\n}\n\nexport interface ServiceTypeProps {\n serviceTypeName: string\n serviceTypeId: number\n teamIdsForServiceType: number[]\n}\n\nexport interface TeamProps {\n teamName: string\n teamId: number\n serviceTypeId: number\n}\n\nexport type SectionListData = Array<\n DataItem<ServiceTypeProps, SectionTypes.header> | DataItem<TeamProps, SectionTypes.team>\n>\n\ninterface DataItem<T, TName extends SectionTypes> {\n type: TName\n data: T\n sectionStyle?: ViewStyle\n}\n\nexport type ConversationFilterRecipientsParams = {\n source_app_name?: AppName\n team_ids?: number[]\n}\n\nexport type ConversationFilterRecipientsScreenProps =\n StaticScreenProps<ConversationFilterRecipientsParams>\n\nexport type SetTeamFilters = ({ team_ids }: { team_ids: number[] }) => void\n"]}
@@ -5,7 +5,7 @@ import React, { useCallback } from 'react';
5
5
  import { Alert, Platform, StyleSheet, View } from 'react-native';
6
6
  import { Text } from '../components';
7
7
  import { REACTION_EMOJIS, useReactionStyles } from '../components/conversation/message_reaction';
8
- import { useCreateAndroidRippleColor, useTheme } from '../hooks';
8
+ import { useCreateAndroidRippleColor, useFontScale, useTheme } from '../hooks';
9
9
  import { useApiClient } from '../hooks/use_api_client';
10
10
  import { useConversationMessages } from '../hooks/use_conversation_messages';
11
11
  import { useMessageReactionToggle } from '../hooks/use_message_reaction_toggle';
@@ -114,8 +114,9 @@ const Reaction = ({ reaction, onPress, }) => {
114
114
  };
115
115
  const useStyles = () => {
116
116
  const { colors } = useTheme();
117
+ const fontScale = useFontScale({ maxFontSizeMultiplier: 1.3 });
117
118
  const btnBorderWidth = 1;
118
- const baseSize = 44;
119
+ const baseSize = 44 * fontScale;
119
120
  const reactionBtnSize = Platform.select({
120
121
  ios: baseSize,
121
122
  android: baseSize + btnBorderWidth * 2,
@@ -1 +1 @@
1
- {"version":3,"file":"message_actions_screen.js","sourceRoot":"","sources":["../../src/screens/message_actions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAA;AA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,CAAC;SACd;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport { useMutation } from '@tanstack/react-query'\nimport React, { useCallback } from 'react'\nimport { Alert, Platform, StyleSheet, View } from 'react-native'\nimport { Text } from '../components'\nimport { REACTION_EMOJIS, useReactionStyles } from '../components/conversation/message_reaction'\nimport { useCreateAndroidRippleColor, useTheme } from '../hooks'\nimport { useApiClient } from '../hooks/use_api_client'\nimport { useConversationMessages } from '../hooks/use_conversation_messages'\nimport { useMessageReactionToggle } from '../hooks/use_message_reaction_toggle'\nimport { ReactionCountResource } from '../types/resources/reaction'\nimport { Clipboard } from '../utils/native_adapters'\nimport { isNil, omitBy } from 'lodash'\nimport FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'\n\nexport const MessageActionsScreenOptions = getFormSheetScreenOptions({\n sheetAllowedDetents: [0.5],\n headerTitle: 'Message actions',\n})\n\nexport type MessageActionsScreenProps = StaticScreenProps<{\n message_id: string\n conversation_id: number\n canDeleteNonAuthoredMessages?: boolean\n}>\n\nexport function MessageActionsScreen({ route }: MessageActionsScreenProps) {\n const navigation = useNavigation()\n const { conversation_id, message_id, canDeleteNonAuthoredMessages } = route.params\n\n const apiClient = useApiClient()\n const styles = useStyles()\n\n const { messages, refetch } = useConversationMessages(\n { conversation_id },\n { refetchOnMount: false }\n )\n const message = messages.find(m => m.id === message_id)\n\n if (!message) fail('Message not found')\n\n const myReactions = message?.reactionCounts\n .filter(reaction => reaction.mine)\n .map(reaction => reaction.value)\n\n const availableReactions = Object.entries(REACTION_EMOJIS).map(([value, emoji]) => {\n return {\n value: value as ReactionCountResource['value'],\n emoji,\n mine: myReactions?.includes(value as ReactionCountResource['value']),\n }\n })\n\n const attachmentForCopy = (): string => {\n const giphyTitleLink = message?.attachments.find(\n attachment => attachment.type === 'giphy'\n )?.titleLink\n\n if (giphyTitleLink) return giphyTitleLink\n return ''\n }\n\n const handleCopyPress = () => {\n Clipboard.setStringAsync(message?.text || attachmentForCopy() || '')\n navigation.goBack()\n }\n\n const { handleReactionToggle, isPending } = useMessageReactionToggle({\n conversation_id,\n message,\n onSuccess: () => navigation.goBack(),\n })\n\n const deleteMessage = useCallback(() => {\n const url = `/me/conversations/${conversation_id}/messages/${message_id}/`\n\n return apiClient.chat.delete({ url })\n }, [apiClient, conversation_id, message_id])\n\n const { mutate: handleDeleteMessage } = useMutation({\n mutationFn: deleteMessage,\n onSuccess: () => {\n refetch()\n navigation.goBack()\n },\n onError: () => {\n Alert.alert('Oops', 'We were unable to delete this message. Please try again.')\n },\n })\n\n const handleDeleteConfirm = useCallback(() => {\n Alert.alert('Delete message', 'Are you sure you want to permanently delete this message?', [\n { text: 'Cancel', style: 'cancel' },\n { text: 'Delete', style: 'destructive', onPress: () => handleDeleteMessage() },\n ])\n }, [handleDeleteMessage])\n\n const handleEditPress = useCallback(() => {\n const state = navigation.getState?.()\n const targetRoute = state?.routes?.find(r => r.name === 'Conversation')\n const params = omitBy(\n {\n ...(targetRoute?.params || {}),\n conversation_id,\n editing_message_id: message_id,\n },\n isNil\n )\n navigation.dispatch(StackActions.popTo('Conversation', params))\n }, [navigation, conversation_id, message_id])\n\n const handleViewReadReceiptsPress = useCallback(() => {\n const params = omitBy(\n {\n conversation_id,\n message_id,\n },\n isNil\n )\n navigation.dispatch(StackActions.popTo('MessageReadReceipts', params))\n }, [navigation, conversation_id, message_id])\n\n return (\n <FormSheet.Root>\n <View style={styles.reactionList}>\n {availableReactions.map((reaction, index) => (\n <Reaction\n key={index}\n reaction={reaction}\n onPress={() =>\n handleReactionToggle({\n value: reaction.value,\n mine: reaction.mine,\n })\n }\n />\n ))}\n </View>\n <View style={styles.actions}>\n <FormSheet.Action\n onPress={handleCopyPress}\n title=\"Copy text\"\n iconName=\"services.fileCopy\"\n accessibilityHint=\"Copies text and links to clipboard\"\n />\n {message?.mine && (\n <FormSheet.Action\n onPress={() => handleEditPress()}\n title=\"Edit message\"\n iconName=\"accounts.editor\"\n accessibilityHint=\"Opens existing text in the message form input.\"\n />\n )}\n {message?.mine && (\n <FormSheet.Action\n onPress={() => handleViewReadReceiptsPress()}\n title=\"View read receipts\"\n iconName=\"general.checkPerson\"\n accessibilityHint=\"Opens a modal with a list of people who read your message.\"\n />\n )}\n {(message?.mine || canDeleteNonAuthoredMessages) && (\n <FormSheet.Action\n onPress={() => handleDeleteConfirm()}\n title=\"Delete message\"\n iconName=\"publishing.trash\"\n appearance=\"danger\"\n disabled={isPending}\n accessibilityHint=\"Opens a confirmation alert to delete this message permanently.\"\n />\n )}\n </View>\n </FormSheet.Root>\n )\n}\n\nconst Reaction = ({\n reaction,\n onPress,\n}: {\n reaction: { value: ReactionCountResource['value']; emoji: string; mine: boolean | undefined }\n onPress: () => void\n}) => {\n const styles = useStyles()\n const reactionStyles = useReactionStyles({ mine: reaction.mine ? 1 : 0 })\n\n const { colors } = useTheme()\n const baseRippleColor = reaction.mine ? colors.interaction : colors.fillColorNeutral060\n const androidRippleColor = useCreateAndroidRippleColor({ color: baseRippleColor })\n\n return (\n <PlatformPressable\n key={reaction.value}\n style={[reactionStyles.reaction, styles.reaction]}\n android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }}\n onPress={onPress}\n >\n <Text style={styles.reactionEmoji}>{REACTION_EMOJIS[reaction.value]}</Text>\n </PlatformPressable>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n const btnBorderWidth = 1\n const baseSize = 44\n const reactionBtnSize = Platform.select({\n ios: baseSize,\n android: baseSize + btnBorderWidth * 2,\n })\n\n return StyleSheet.create({\n reactionList: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n gap: 16,\n paddingTop: 8,\n paddingBottom: 16,\n borderBottomColor: colors.borderColorDefaultBase,\n borderBottomWidth: 1,\n },\n reaction: {\n height: reactionBtnSize,\n width: reactionBtnSize,\n borderWidth: btnBorderWidth,\n borderRadius: 32,\n justifyContent: 'center',\n overflow: 'hidden',\n },\n reactionEmoji: {\n fontSize: 24,\n },\n actions: {\n paddingTop: 4,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"message_actions_screen.js","sourceRoot":"","sources":["../../src/screens/message_actions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAA;AAChG,OAAO,EAAE,2BAA2B,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAA;AAE/E,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,SAAS,EAAE,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAA;AAEzF,MAAM,CAAC,MAAM,2BAA2B,GAAG,yBAAyB,CAAC;IACnE,mBAAmB,EAAE,CAAC,GAAG,CAAC;IAC1B,WAAW,EAAE,iBAAiB;CAC/B,CAAC,CAAA;AAQF,MAAM,UAAU,oBAAoB,CAAC,EAAE,KAAK,EAA6B;IACvE,MAAM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G,CAAC,CAAA;IACxB,MAAM,QAAQ,GAAG,EAAE,GAAG,SAAS,CAAA;IAC/B,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC;QACtC,GAAG,EAAE,QAAQ;QACb,OAAO,EAAE,QAAQ,GAAG,cAAc,GAAG,CAAC;KACvC,CAAC,CAAA;IAEF,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,YAAY,EAAE;YACZ,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,EAAE;YACP,UAAU,EAAE,CAAC;YACb,aAAa,EAAE,EAAE;YACjB,iBAAiB,EAAE,MAAM,CAAC,sBAAsB;YAChD,iBAAiB,EAAE,CAAC;SACrB;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,eAAe;YACvB,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,cAAc;YAC3B,YAAY,EAAE,EAAE;YAChB,cAAc,EAAE,QAAQ;YACxB,QAAQ,EAAE,QAAQ;SACnB;QACD,aAAa,EAAE;YACb,QAAQ,EAAE,EAAE;SACb;QACD,OAAO,EAAE;YACP,UAAU,EAAE,CAAC;SACd;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport { useMutation } from '@tanstack/react-query'\nimport React, { useCallback } from 'react'\nimport { Alert, Platform, StyleSheet, View } from 'react-native'\nimport { Text } from '../components'\nimport { REACTION_EMOJIS, useReactionStyles } from '../components/conversation/message_reaction'\nimport { useCreateAndroidRippleColor, useFontScale, useTheme } from '../hooks'\nimport { useApiClient } from '../hooks/use_api_client'\nimport { useConversationMessages } from '../hooks/use_conversation_messages'\nimport { useMessageReactionToggle } from '../hooks/use_message_reaction_toggle'\nimport { ReactionCountResource } from '../types/resources/reaction'\nimport { Clipboard } from '../utils/native_adapters'\nimport { isNil, omitBy } from 'lodash'\nimport FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'\n\nexport const MessageActionsScreenOptions = getFormSheetScreenOptions({\n sheetAllowedDetents: [0.5],\n headerTitle: 'Message actions',\n})\n\nexport type MessageActionsScreenProps = StaticScreenProps<{\n message_id: string\n conversation_id: number\n canDeleteNonAuthoredMessages?: boolean\n}>\n\nexport function MessageActionsScreen({ route }: MessageActionsScreenProps) {\n const navigation = useNavigation()\n const { conversation_id, message_id, canDeleteNonAuthoredMessages } = route.params\n\n const apiClient = useApiClient()\n const styles = useStyles()\n\n const { messages, refetch } = useConversationMessages(\n { conversation_id },\n { refetchOnMount: false }\n )\n const message = messages.find(m => m.id === message_id)\n\n if (!message) fail('Message not found')\n\n const myReactions = message?.reactionCounts\n .filter(reaction => reaction.mine)\n .map(reaction => reaction.value)\n\n const availableReactions = Object.entries(REACTION_EMOJIS).map(([value, emoji]) => {\n return {\n value: value as ReactionCountResource['value'],\n emoji,\n mine: myReactions?.includes(value as ReactionCountResource['value']),\n }\n })\n\n const attachmentForCopy = (): string => {\n const giphyTitleLink = message?.attachments.find(\n attachment => attachment.type === 'giphy'\n )?.titleLink\n\n if (giphyTitleLink) return giphyTitleLink\n return ''\n }\n\n const handleCopyPress = () => {\n Clipboard.setStringAsync(message?.text || attachmentForCopy() || '')\n navigation.goBack()\n }\n\n const { handleReactionToggle, isPending } = useMessageReactionToggle({\n conversation_id,\n message,\n onSuccess: () => navigation.goBack(),\n })\n\n const deleteMessage = useCallback(() => {\n const url = `/me/conversations/${conversation_id}/messages/${message_id}/`\n\n return apiClient.chat.delete({ url })\n }, [apiClient, conversation_id, message_id])\n\n const { mutate: handleDeleteMessage } = useMutation({\n mutationFn: deleteMessage,\n onSuccess: () => {\n refetch()\n navigation.goBack()\n },\n onError: () => {\n Alert.alert('Oops', 'We were unable to delete this message. Please try again.')\n },\n })\n\n const handleDeleteConfirm = useCallback(() => {\n Alert.alert('Delete message', 'Are you sure you want to permanently delete this message?', [\n { text: 'Cancel', style: 'cancel' },\n { text: 'Delete', style: 'destructive', onPress: () => handleDeleteMessage() },\n ])\n }, [handleDeleteMessage])\n\n const handleEditPress = useCallback(() => {\n const state = navigation.getState?.()\n const targetRoute = state?.routes?.find(r => r.name === 'Conversation')\n const params = omitBy(\n {\n ...(targetRoute?.params || {}),\n conversation_id,\n editing_message_id: message_id,\n },\n isNil\n )\n navigation.dispatch(StackActions.popTo('Conversation', params))\n }, [navigation, conversation_id, message_id])\n\n const handleViewReadReceiptsPress = useCallback(() => {\n const params = omitBy(\n {\n conversation_id,\n message_id,\n },\n isNil\n )\n navigation.dispatch(StackActions.popTo('MessageReadReceipts', params))\n }, [navigation, conversation_id, message_id])\n\n return (\n <FormSheet.Root>\n <View style={styles.reactionList}>\n {availableReactions.map((reaction, index) => (\n <Reaction\n key={index}\n reaction={reaction}\n onPress={() =>\n handleReactionToggle({\n value: reaction.value,\n mine: reaction.mine,\n })\n }\n />\n ))}\n </View>\n <View style={styles.actions}>\n <FormSheet.Action\n onPress={handleCopyPress}\n title=\"Copy text\"\n iconName=\"services.fileCopy\"\n accessibilityHint=\"Copies text and links to clipboard\"\n />\n {message?.mine && (\n <FormSheet.Action\n onPress={() => handleEditPress()}\n title=\"Edit message\"\n iconName=\"accounts.editor\"\n accessibilityHint=\"Opens existing text in the message form input.\"\n />\n )}\n {message?.mine && (\n <FormSheet.Action\n onPress={() => handleViewReadReceiptsPress()}\n title=\"View read receipts\"\n iconName=\"general.checkPerson\"\n accessibilityHint=\"Opens a modal with a list of people who read your message.\"\n />\n )}\n {(message?.mine || canDeleteNonAuthoredMessages) && (\n <FormSheet.Action\n onPress={() => handleDeleteConfirm()}\n title=\"Delete message\"\n iconName=\"publishing.trash\"\n appearance=\"danger\"\n disabled={isPending}\n accessibilityHint=\"Opens a confirmation alert to delete this message permanently.\"\n />\n )}\n </View>\n </FormSheet.Root>\n )\n}\n\nconst Reaction = ({\n reaction,\n onPress,\n}: {\n reaction: { value: ReactionCountResource['value']; emoji: string; mine: boolean | undefined }\n onPress: () => void\n}) => {\n const styles = useStyles()\n const reactionStyles = useReactionStyles({ mine: reaction.mine ? 1 : 0 })\n\n const { colors } = useTheme()\n const baseRippleColor = reaction.mine ? colors.interaction : colors.fillColorNeutral060\n const androidRippleColor = useCreateAndroidRippleColor({ color: baseRippleColor })\n\n return (\n <PlatformPressable\n key={reaction.value}\n style={[reactionStyles.reaction, styles.reaction]}\n android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }}\n onPress={onPress}\n >\n <Text style={styles.reactionEmoji}>{REACTION_EMOJIS[reaction.value]}</Text>\n </PlatformPressable>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier: 1.3 })\n\n const btnBorderWidth = 1\n const baseSize = 44 * fontScale\n const reactionBtnSize = Platform.select({\n ios: baseSize,\n android: baseSize + btnBorderWidth * 2,\n })\n\n return StyleSheet.create({\n reactionList: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n gap: 16,\n paddingTop: 8,\n paddingBottom: 16,\n borderBottomColor: colors.borderColorDefaultBase,\n borderBottomWidth: 1,\n },\n reaction: {\n height: reactionBtnSize,\n width: reactionBtnSize,\n borderWidth: btnBorderWidth,\n borderRadius: 32,\n justifyContent: 'center',\n overflow: 'hidden',\n },\n reactionEmoji: {\n fontSize: 24,\n },\n actions: {\n paddingTop: 4,\n },\n })\n}\n"]}
@@ -1,7 +1,6 @@
1
1
  import { StaticScreenProps } from '@react-navigation/native';
2
- import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
3
2
  import React from 'react';
4
- export declare const ReactionsScreenOptions: NativeStackNavigationOptions;
3
+ export declare const ReactionsScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
5
4
  export type ReactionScreenProps = StaticScreenProps<{
6
5
  message_id: string;
7
6
  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;AAC5D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,eAAO,MAAM,sBAAsB,EAAE,4BAMpC,CAAA;AAED,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,qBA8D7D"}
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;AAC5D,OAAO,KAAe,MAAM,OAAO,CAAA;AAenC,eAAO,MAAM,sBAAsB,uEAMjC,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,qBA0D7D"}