@planningcenter/chat-react-native 3.9.2 → 3.9.3-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"action_toggle_button.d.ts","sourceRoot":"","sources":["../../../src/components/conversations/action_toggle_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7E,OAAO,EAAQ,UAAU,EAAiB,MAAM,YAAY,CAAA;AAI5D,UAAU,uBAAwB,SAAQ,cAAc;IACtD,eAAe,EAAE,MAAM,CAAA;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE;QACb,IAAI,EAAE;YAAE,QAAQ,EAAE,UAAU,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAA;QAC7C,KAAK,EAAE;YAAE,QAAQ,EAAE,UAAU,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAA;KAC/C,CAAA;IACD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,eAAe,EACf,OAAO,EACP,aAAa,EACb,QAAgB,EAChB,OAAO,EACP,OAAe,EACf,GAAG,KAAK,EACT,EAAE,uBAAuB,qBA8BzB"}
1
+ {"version":3,"file":"action_toggle_button.d.ts","sourceRoot":"","sources":["../../../src/components/conversations/action_toggle_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7E,OAAO,EAAQ,UAAU,EAAiB,MAAM,YAAY,CAAA;AAK5D,UAAU,uBAAwB,SAAQ,cAAc;IACtD,eAAe,EAAE,MAAM,CAAA;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE;QACb,IAAI,EAAE;YAAE,QAAQ,EAAE,UAAU,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAA;QAC7C,KAAK,EAAE;YAAE,QAAQ,EAAE,UAAU,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAA;KAC/C,CAAA;IACD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,eAAe,EACf,OAAO,EACP,aAAa,EACb,QAAgB,EAChB,OAAO,EACP,OAAe,EACf,GAAG,KAAK,EACT,EAAE,uBAAuB,qBA8BzB"}
@@ -4,6 +4,7 @@ import { Pressable } from 'react-native-gesture-handler';
4
4
  import { Icon, Spinner, Text } from '../display';
5
5
  import { useCreateAndroidRippleColor, useTheme } from '../../hooks';
6
6
  import { platformFontWeightMedium, platformPressedOpacityStyle } from '../../utils/styles';
7
+ import { tokens } from '../../vendor/tapestry/tokens';
7
8
  export function ActionToggleButton({ backgroundColor, onPress, toggleContent, disabled = false, toggled, loading = false, ...props }) {
8
9
  const styles = useStyles({ backgroundColor, disabled });
9
10
  const androidRippleColor = useCreateAndroidRippleColor({
@@ -21,7 +22,7 @@ export function ActionToggleButton({ backgroundColor, onPress, toggleContent, di
21
22
  }
22
23
  const useStyles = ({ backgroundColor, disabled }) => {
23
24
  const { colors } = useTheme();
24
- const fillColor = disabled ? colors.textColorDefaultDisabled : colors.fillColorNeutral100Inverted;
25
+ const fillColor = disabled ? colors.textColorDefaultDisabled : tokens.colorNeutral100White;
25
26
  const buttonBackgroundColor = disabled
26
27
  ? colors.fillColorButtonNeutralSolidDisabled
27
28
  : backgroundColor;
@@ -1 +1 @@
1
- {"version":3,"file":"action_toggle_button.js","sourceRoot":"","sources":["../../../src/components/conversations/action_toggle_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,SAAS,EAAuB,MAAM,8B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CAAC,CAAC,CAAC,CACF,EACE;UAAA,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EACnD;UAAA,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAC1C;YAAA,CAAC,KAAK,CACR;UAAA,EAAE,IAAI,CACR;QAAA,GAAG,CACJ,CACH;IAAA,EAAE,SAAS,CAAC,CACb,CAAA;AACH,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,EAAE,eAAe,EAAE,QAAQ,EAAoC,EAAE,EAAE;IACpF,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC7B,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,MAAM,CAAC,2BAA2B,CAAA;IACjG,MAAM,qBAAqB,GAAG,QAAQ;QACpC,CAAC,CAAC,MAAM,CAAC,mCAAmC;QAC5C,CAAC,CAAC,eAAe,CAAA;IAEnB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,MAAM,EAAE;YACN,IAAI,EAAE,CAAC;YACP,aAAa,EAAE,QAAQ;YACvB,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,QAAQ;YACxB,GAAG,EAAE,CAAC;YACN,MAAM,EAAE,MAAM;YACd,eAAe,EAAE,qBAAqB;SACvC;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,SAAS;YAChB,SAAS,EAAE,CAAC;SACb;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,SAAS;YAChB,UAAU,EAAE,wBAAwB;SACrC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { StyleSheet } from 'react-native'\nimport { Pressable, type PressableProps } from 'react-native-gesture-handler'\nimport { Icon, IconString, Spinner, Text } from '../display'\nimport { useCreateAndroidRippleColor, useTheme } from '../../hooks'\nimport { platformFontWeightMedium, platformPressedOpacityStyle } from '../../utils/styles'\n\ninterface ActionToggleButtonProps extends PressableProps {\n backgroundColor: string\n toggled: boolean\n toggleContent: {\n true: { iconName: IconString; label: string }\n false: { iconName: IconString; label: string }\n }\n loading?: boolean\n}\n\nexport function ActionToggleButton({\n backgroundColor,\n onPress,\n toggleContent,\n disabled = false,\n toggled,\n loading = false,\n ...props\n}: ActionToggleButtonProps) {\n const styles = useStyles({ backgroundColor, disabled })\n const androidRippleColor = useCreateAndroidRippleColor({\n color: backgroundColor,\n })\n\n const { iconName, label } = toggleContent[toggled ? 'true' : 'false']\n\n return (\n <Pressable\n onPress={onPress}\n style={({ pressed }) => [styles.button, pressed && platformPressedOpacityStyle]}\n android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }}\n disabled={disabled || loading}\n accessibilityRole=\"togglebutton\"\n accessibilityState={{ checked: toggled }}\n {...props}\n >\n {loading ? (\n <Spinner size={20} />\n ) : (\n <>\n <Icon name={iconName} style={styles.icon} size={20} />\n <Text variant=\"footnote\" style={styles.text}>\n {label}\n </Text>\n </>\n )}\n </Pressable>\n )\n}\n\nconst useStyles = ({ backgroundColor, disabled }: Partial<ActionToggleButtonProps>) => {\n const { colors } = useTheme()\n const fillColor = disabled ? colors.textColorDefaultDisabled : colors.fillColorNeutral100Inverted\n const buttonBackgroundColor = disabled\n ? colors.fillColorButtonNeutralSolidDisabled\n : backgroundColor\n\n return StyleSheet.create({\n button: {\n flex: 1,\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 4,\n height: '100%',\n backgroundColor: buttonBackgroundColor,\n },\n icon: {\n color: fillColor,\n marginTop: 4,\n },\n text: {\n color: fillColor,\n fontWeight: platformFontWeightMedium,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"action_toggle_button.js","sourceRoot":"","sources":["../../../src/components/conversations/action_toggle_button.tsx"],"names":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AAE;YACJ,KAAK,EAAE,SAAS;YAChB,UAAU,EAAE,wBAAwB;SACrC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { StyleSheet } from 'react-native'\nimport { Pressable, type PressableProps } from 'react-native-gesture-handler'\nimport { Icon, IconString, Spinner, Text } from '../display'\nimport { useCreateAndroidRippleColor, useTheme } from '../../hooks'\nimport { platformFontWeightMedium, platformPressedOpacityStyle } from '../../utils/styles'\nimport { tokens } from '../../vendor/tapestry/tokens'\n\ninterface ActionToggleButtonProps extends PressableProps {\n backgroundColor: string\n toggled: boolean\n toggleContent: {\n true: { iconName: IconString; label: string }\n false: { iconName: IconString; label: string }\n }\n loading?: boolean\n}\n\nexport function ActionToggleButton({\n backgroundColor,\n onPress,\n toggleContent,\n disabled = false,\n toggled,\n loading = false,\n ...props\n}: ActionToggleButtonProps) {\n const styles = useStyles({ backgroundColor, disabled })\n const androidRippleColor = useCreateAndroidRippleColor({\n color: backgroundColor,\n })\n\n const { iconName, label } = toggleContent[toggled ? 'true' : 'false']\n\n return (\n <Pressable\n onPress={onPress}\n style={({ pressed }) => [styles.button, pressed && platformPressedOpacityStyle]}\n android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }}\n disabled={disabled || loading}\n accessibilityRole=\"togglebutton\"\n accessibilityState={{ checked: toggled }}\n {...props}\n >\n {loading ? (\n <Spinner size={20} />\n ) : (\n <>\n <Icon name={iconName} style={styles.icon} size={20} />\n <Text variant=\"footnote\" style={styles.text}>\n {label}\n </Text>\n </>\n )}\n </Pressable>\n )\n}\n\nconst useStyles = ({ backgroundColor, disabled }: Partial<ActionToggleButtonProps>) => {\n const { colors } = useTheme()\n const fillColor = disabled ? colors.textColorDefaultDisabled : tokens.colorNeutral100White\n const buttonBackgroundColor = disabled\n ? colors.fillColorButtonNeutralSolidDisabled\n : backgroundColor\n\n return StyleSheet.create({\n button: {\n flex: 1,\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 4,\n height: '100%',\n backgroundColor: buttonBackgroundColor,\n },\n icon: {\n color: fillColor,\n marginTop: 4,\n },\n text: {\n color: fillColor,\n fontWeight: platformFontWeightMedium,\n },\n })\n}\n"]}
@@ -1,3 +1,5 @@
1
1
  import React from 'react';
2
- export declare const ChatGroupBadge: () => React.JSX.Element | null;
2
+ export declare const ChatGroupBadge: ({ rowPaddingHorizontal }: {
3
+ rowPaddingHorizontal: number;
4
+ }) => React.JSX.Element | null;
3
5
  //# sourceMappingURL=chat_group_badge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat_group_badge.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversations/components/chat_group_badge.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAO1C,eAAO,MAAM,cAAc,gCA8B1B,CAAA"}
1
+ {"version":3,"file":"chat_group_badge.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversations/components/chat_group_badge.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAO1C,eAAO,MAAM,cAAc,6BAA8B;IAAE,oBAAoB,EAAE,MAAM,CAAA;CAAE,6BA8BxF,CAAA"}
@@ -3,8 +3,8 @@ import React, { useCallback } from 'react';
3
3
  import { StyleSheet, View } from 'react-native';
4
4
  import { Badge } from '../../../components';
5
5
  import { useApiGet } from '../../../hooks/use_api';
6
- export const ChatGroupBadge = () => {
7
- const styles = useStyles();
6
+ export const ChatGroupBadge = ({ rowPaddingHorizontal }) => {
7
+ const styles = useStyles({ rowPaddingHorizontal });
8
8
  const navigation = useNavigation();
9
9
  const route = useRoute();
10
10
  const { chat_group_graph_id } = route.params || {};
@@ -30,10 +30,11 @@ export const ChatGroupBadge = () => {
30
30
  <Badge iconNameRight="general.x" label={group?.name || ''} onPress={handleBadgePress}/>
31
31
  </View>);
32
32
  };
33
- const useStyles = () => {
33
+ const useStyles = ({ rowPaddingHorizontal }) => {
34
34
  return StyleSheet.create({
35
35
  row: {
36
36
  flexDirection: 'row',
37
+ paddingHorizontal: rowPaddingHorizontal,
37
38
  },
38
39
  });
39
40
  };
@@ -1 +1 @@
1
- {"version":3,"file":"chat_group_badge.js","sourceRoot":"","sources":["../../../../src/screens/conversations/components/chat_group_badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAIlD,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,KAAK,GAAG,QAAQ,EAA+C,CAAA;IACrE,MAAM,EAAE,mBAAmB,EAAE,GAAG,KAAK,CAAC,MAAM,IAAI,EAAE,CAAA;IAClD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,SAAS,CAAgB;QAC/C,GAAG,EAAE,cAAc,mBAAmB,EAAE;QACxC,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,KAAK,EAAE,EAAE;aACV;SACF;QACD,OAAO,EAAE,CAAC,CAAC,mBAAmB;QAC9B,GAAG,EAAE,MAAM;KACZ,CAAC,CAAA;IAEF,MAAM,gBAAgB,GAAG,WAAW,CAAC,GAAG,EAAE;QACxC,UAAU,CAAC,SAAS,CAAC;YACnB,mBAAmB,EAAE,SAAS;YAC9B,qBAAqB,EAAE,SAAS;SACjC,CAAC,CAAA;IACJ,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAA;IAEhB,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IAEvB,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CACtB;MAAA,CAAC,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC,EACvF;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,GAAG,EAAE;YACH,aAAa,EAAE,KAAK;SACrB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { RouteProp, useNavigation, useRoute } from '@react-navigation/native'\nimport React, { useCallback } from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Badge } from '../../../components'\nimport { useApiGet } from '../../../hooks/use_api'\nimport { GroupResource } from '../../../types/resources/group_resource'\nimport { ConversationScreenProps } from '../conversations_screen'\n\nexport const ChatGroupBadge = () => {\n const styles = useStyles()\n const navigation = useNavigation()\n const route = useRoute<RouteProp<ConversationScreenProps['route']>>()\n const { chat_group_graph_id } = route.params || {}\n const { data: group } = useApiGet<GroupResource>({\n url: `/me/groups/${chat_group_graph_id}`,\n data: {\n fields: {\n Group: [],\n },\n },\n enabled: !!chat_group_graph_id,\n app: 'chat',\n })\n\n const handleBadgePress = useCallback(() => {\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: undefined,\n })\n }, [navigation])\n\n if (!group) return null\n\n return (\n <View style={styles.row}>\n <Badge iconNameRight=\"general.x\" label={group?.name || ''} onPress={handleBadgePress} />\n </View>\n )\n}\n\nconst useStyles = () => {\n return StyleSheet.create({\n row: {\n flexDirection: 'row',\n },\n })\n}\n"]}
1
+ {"version":3,"file":"chat_group_badge.js","sourceRoot":"","sources":["../../../../src/screens/conversations/components/chat_group_badge.tsx"],"names":[],"mappings":"AAAA,OAA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C,CAAC,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC,EACvF;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,CAAC,EAAE,oBAAoB,EAAoC,EAAE,EAAE;IAC/E,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,GAAG,EAAE;YACH,aAAa,EAAE,KAAK;YACpB,iBAAiB,EAAE,oBAAoB;SACxC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { RouteProp, useNavigation, useRoute } from '@react-navigation/native'\nimport React, { useCallback } from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Badge } from '../../../components'\nimport { useApiGet } from '../../../hooks/use_api'\nimport { GroupResource } from '../../../types/resources/group_resource'\nimport { ConversationScreenProps } from '../conversations_screen'\n\nexport const ChatGroupBadge = ({ rowPaddingHorizontal }: { rowPaddingHorizontal: number }) => {\n const styles = useStyles({ rowPaddingHorizontal })\n const navigation = useNavigation()\n const route = useRoute<RouteProp<ConversationScreenProps['route']>>()\n const { chat_group_graph_id } = route.params || {}\n const { data: group } = useApiGet<GroupResource>({\n url: `/me/groups/${chat_group_graph_id}`,\n data: {\n fields: {\n Group: [],\n },\n },\n enabled: !!chat_group_graph_id,\n app: 'chat',\n })\n\n const handleBadgePress = useCallback(() => {\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: undefined,\n })\n }, [navigation])\n\n if (!group) return null\n\n return (\n <View style={styles.row}>\n <Badge iconNameRight=\"general.x\" label={group?.name || ''} onPress={handleBadgePress} />\n </View>\n )\n}\n\nconst useStyles = ({ rowPaddingHorizontal }: { rowPaddingHorizontal: number }) => {\n return StyleSheet.create({\n row: {\n flexDirection: 'row',\n paddingHorizontal: rowPaddingHorizontal,\n },\n })\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"list_header_component.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversations/components/list_header_component.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAA;AAgBnD,eAAO,MAAM,mBAAmB,yBAgH/B,CAAA"}
1
+ {"version":3,"file":"list_header_component.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversations/components/list_header_component.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAA;AAkBnD,eAAO,MAAM,mBAAmB,yBA8G/B,CAAA"}
@@ -6,6 +6,7 @@ import { useCurrentPerson, useCurrentPersonCache, useTheme } from '../../../hook
6
6
  import { useMarkAllRead } from '../../../hooks/use_conversations_actions';
7
7
  import { useCanDisplayGroups } from '../../../hooks/use_groups';
8
8
  import { ChatGroupBadge } from './chat_group_badge';
9
+ const ROW_PADDING_HORIZONTAL = 16;
9
10
  var FilterTypes;
10
11
  (function (FilterTypes) {
11
12
  FilterTypes["All"] = "All";
@@ -78,9 +79,7 @@ export const ListHeaderComponent = () => {
78
79
  group_source_app_name,
79
80
  })} active={active === FilterTypes.More} iconNameRight="general.threeReducingHorizontalBars" accessibilityLabel={showAppFilters ? 'View all filters' : 'View more filters'}/>
80
81
  </ScrollView>
81
- <View style={styles.chatGroupBadgeRow}>
82
- <ChatGroupBadge />
83
- </View>
82
+ <ChatGroupBadge rowPaddingHorizontal={ROW_PADDING_HORIZONTAL}/>
84
83
  </View>);
85
84
  };
86
85
  const useStyles = () => {
@@ -96,16 +95,13 @@ const useStyles = () => {
96
95
  flexDirection: 'row',
97
96
  justifyContent: 'space-between',
98
97
  paddingTop: 8,
99
- paddingHorizontal: 16,
98
+ paddingHorizontal: ROW_PADDING_HORIZONTAL,
100
99
  },
101
100
  filterRow: {
102
101
  flexDirection: 'row',
103
102
  justifyContent: 'flex-start',
104
103
  gap: 8,
105
- paddingHorizontal: 16,
106
- },
107
- chatGroupBadgeRow: {
108
- paddingHorizontal: 16,
104
+ paddingHorizontal: ROW_PADDING_HORIZONTAL,
109
105
  },
110
106
  });
111
107
  };
@@ -1 +1 @@
1
- {"version":3,"file":"list_header_component.js","sourceRoot":"","sources":["../../../../src/screens/conversations/components/list_header_component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAA;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD,IAAK,WAKJ;AALD,WAAK,WAAW;IACd,0BAAW,CAAA;IACX,gCAAiB,CAAA;IACjB,8BAAe,CAAA;IACf,4BAAa,CAAA;AACf,CAAC,EALI,WAAW,KAAX,WAAW,QAKf;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAA;IAClG,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,EAAE,eAAe,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAA;IAClG,MAAM,KAAK,GAAG,QAAQ,EAA+C,CAAA;IACrE,MAAM,EAAE,mBAAmB,EAAE,qBAAqB,GAAG,EAAE,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AAM,CAAC,uBAAuB;YACvD,aAAa,EAAE,EAAE;YACjB,GAAG,EAAE,EAAE;SACR;QACD,QAAQ,EAAE;YACR,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;YAC/B,UAAU,EAAE,CAAC;YACb,iBAAiB,EAAE,EAAE;SACtB;QACD,SAAS,EAAE;YACT,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,YAAY;YAC5B,GAAG,EAAE,CAAC;YACN,iBAAiB,EAAE,EAAE;SACtB;QACD,iBAAiB,EAAE;YACjB,iBAAiB,EAAE,EAAE;SACtB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { RouteProp, useNavigation, useRoute } from '@react-navigation/native'\nimport React, { useCallback, useMemo } from 'react'\nimport { Alert, ScrollView, StyleSheet, View } from 'react-native'\nimport { Heading, TextButton, ToggleButton } from '../../../components'\nimport { useCurrentPerson, useCurrentPersonCache, useTheme } from '../../../hooks'\nimport { useMarkAllRead } from '../../../hooks/use_conversations_actions'\nimport { useCanDisplayGroups } from '../../../hooks/use_groups'\nimport { ConversationScreenProps } from '../conversations_screen'\nimport { ChatGroupBadge } from './chat_group_badge'\n\nenum FilterTypes {\n All = 'All',\n Groups = 'Groups',\n Teams = 'Teams',\n More = 'More',\n}\n\nexport const ListHeaderComponent = () => {\n const styles = useStyles()\n const navigation = useNavigation()\n const canFilterByTeams = useCanDisplayGroups({ source_app_name: 'Services', source_type: 'Team' })\n const canFilterByGroups = useCanDisplayGroups({ source_app_name: 'Groups', source_type: 'Group' })\n const route = useRoute<RouteProp<ConversationScreenProps['route']>>()\n const { chat_group_graph_id, group_source_app_name = '' } = route.params || {}\n\n const { unreadCount } = useCurrentPerson()\n const currentPersonCache = useCurrentPersonCache()\n const { markAllRead, isPending } = useMarkAllRead()\n\n const active: FilterTypes = useMemo(() => {\n if (chat_group_graph_id) {\n return FilterTypes.More\n } else if (/groups/i.test(group_source_app_name)) {\n return FilterTypes.Groups\n } else if (/services/i.test(group_source_app_name)) {\n return FilterTypes.Teams\n }\n\n return FilterTypes.All\n }, [chat_group_graph_id, group_source_app_name])\n\n const handleMarkAllRead = useCallback(() => {\n currentPersonCache.update({ unreadCount: 0 })\n markAllRead()\n }, [currentPersonCache, markAllRead])\n\n const alertMarkAllRead = useCallback(() => {\n if (active === FilterTypes.All) return handleMarkAllRead()\n\n Alert.alert('Mark all read', 'This includes conversations not shown by the current filter.', [\n { text: 'Cancel' },\n { text: 'OK', onPress: () => handleMarkAllRead() },\n ])\n }, [active, handleMarkAllRead])\n\n const showAppFilters = canFilterByGroups && canFilterByTeams\n\n return (\n <View style={styles.listHeader}>\n <View style={styles.titleRow}>\n <Heading numberOfLines={1} variant=\"h2\">\n Conversations\n </Heading>\n <TextButton onPress={alertMarkAllRead} disabled={isPending || !unreadCount}>\n Mark all read\n </TextButton>\n </View>\n <ScrollView\n horizontal\n showsHorizontalScrollIndicator={false}\n contentContainerStyle={styles.filterRow}\n accessibilityRole=\"toolbar\"\n >\n {showAppFilters && (\n <>\n <ToggleButton\n title={FilterTypes.All}\n active={active === FilterTypes.All}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: undefined,\n })\n }\n accessibilityLabel=\"Show all conversations\"\n />\n <ToggleButton\n title={FilterTypes.Groups}\n active={active === FilterTypes.Groups}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: 'Groups',\n })\n }\n accessibilityLabel=\"Filter to group conversations\"\n />\n\n <ToggleButton\n title={FilterTypes.Teams}\n active={active === FilterTypes.Teams}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: 'Services',\n })\n }\n accessibilityLabel=\"Filter to team conversations\"\n />\n </>\n )}\n <ToggleButton\n title={showAppFilters ? FilterTypes.More : 'Filter'}\n onPress={() =>\n navigation.navigate('ConversationFilters', {\n chat_group_graph_id,\n group_source_app_name,\n })\n }\n active={active === FilterTypes.More}\n iconNameRight=\"general.threeReducingHorizontalBars\"\n accessibilityLabel={showAppFilters ? 'View all filters' : 'View more filters'}\n />\n </ScrollView>\n <View style={styles.chatGroupBadgeRow}>\n <ChatGroupBadge />\n </View>\n </View>\n )\n}\n\nconst useStyles = () => {\n const theme = useTheme()\n return StyleSheet.create({\n listHeader: {\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.fillColorNeutral050Base,\n paddingBottom: 16,\n gap: 12,\n },\n titleRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingTop: 8,\n paddingHorizontal: 16,\n },\n filterRow: {\n flexDirection: 'row',\n justifyContent: 'flex-start',\n gap: 8,\n paddingHorizontal: 16,\n },\n chatGroupBadgeRow: {\n paddingHorizontal: 16,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"list_header_component.js","sourceRoot":"","sources":["../../../../src/screens/conversations/components/list_header_component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAA;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD,MAAM,sBAAsB,GAAG,EAAE,CAAA;AAEjC,IAAK,WAKJ;AALD,WAAK,WAAW;IACd,0BAAW,CAAA;IACX,gCAAiB,CAAA;IACjB,8BAAe,CAAA;IACf,4BAAa,CAAA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AkB,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,mBAAmB,CAAC,EAElF;MAAA,EAAE,UAAU,CACZ;MAAA,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,sBAAsB,CAAC,EAC/D;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,UAAU,EAAE;YACV,iBAAiB,EAAE,CAAC;YACpB,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,uBAAuB;YACvD,aAAa,EAAE,EAAE;YACjB,GAAG,EAAE,EAAE;SACR;QACD,QAAQ,EAAE;YACR,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;YAC/B,UAAU,EAAE,CAAC;YACb,iBAAiB,EAAE,sBAAsB;SAC1C;QACD,SAAS,EAAE;YACT,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,YAAY;YAC5B,GAAG,EAAE,CAAC;YACN,iBAAiB,EAAE,sBAAsB;SAC1C;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { RouteProp, useNavigation, useRoute } from '@react-navigation/native'\nimport React, { useCallback, useMemo } from 'react'\nimport { Alert, ScrollView, StyleSheet, View } from 'react-native'\nimport { Heading, TextButton, ToggleButton } from '../../../components'\nimport { useCurrentPerson, useCurrentPersonCache, useTheme } from '../../../hooks'\nimport { useMarkAllRead } from '../../../hooks/use_conversations_actions'\nimport { useCanDisplayGroups } from '../../../hooks/use_groups'\nimport { ConversationScreenProps } from '../conversations_screen'\nimport { ChatGroupBadge } from './chat_group_badge'\n\nconst ROW_PADDING_HORIZONTAL = 16\n\nenum FilterTypes {\n All = 'All',\n Groups = 'Groups',\n Teams = 'Teams',\n More = 'More',\n}\n\nexport const ListHeaderComponent = () => {\n const styles = useStyles()\n const navigation = useNavigation()\n const canFilterByTeams = useCanDisplayGroups({ source_app_name: 'Services', source_type: 'Team' })\n const canFilterByGroups = useCanDisplayGroups({ source_app_name: 'Groups', source_type: 'Group' })\n const route = useRoute<RouteProp<ConversationScreenProps['route']>>()\n const { chat_group_graph_id, group_source_app_name = '' } = route.params || {}\n\n const { unreadCount } = useCurrentPerson()\n const currentPersonCache = useCurrentPersonCache()\n const { markAllRead, isPending } = useMarkAllRead()\n\n const active: FilterTypes = useMemo(() => {\n if (chat_group_graph_id) {\n return FilterTypes.More\n } else if (/groups/i.test(group_source_app_name)) {\n return FilterTypes.Groups\n } else if (/services/i.test(group_source_app_name)) {\n return FilterTypes.Teams\n }\n\n return FilterTypes.All\n }, [chat_group_graph_id, group_source_app_name])\n\n const handleMarkAllRead = useCallback(() => {\n currentPersonCache.update({ unreadCount: 0 })\n markAllRead()\n }, [currentPersonCache, markAllRead])\n\n const alertMarkAllRead = useCallback(() => {\n if (active === FilterTypes.All) return handleMarkAllRead()\n\n Alert.alert('Mark all read', 'This includes conversations not shown by the current filter.', [\n { text: 'Cancel' },\n { text: 'OK', onPress: () => handleMarkAllRead() },\n ])\n }, [active, handleMarkAllRead])\n\n const showAppFilters = canFilterByGroups && canFilterByTeams\n\n return (\n <View style={styles.listHeader}>\n <View style={styles.titleRow}>\n <Heading numberOfLines={1} variant=\"h2\">\n Conversations\n </Heading>\n <TextButton onPress={alertMarkAllRead} disabled={isPending || !unreadCount}>\n Mark all read\n </TextButton>\n </View>\n <ScrollView\n horizontal\n showsHorizontalScrollIndicator={false}\n contentContainerStyle={styles.filterRow}\n accessibilityRole=\"toolbar\"\n >\n {showAppFilters && (\n <>\n <ToggleButton\n title={FilterTypes.All}\n active={active === FilterTypes.All}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: undefined,\n })\n }\n accessibilityLabel=\"Show all conversations\"\n />\n <ToggleButton\n title={FilterTypes.Groups}\n active={active === FilterTypes.Groups}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: 'Groups',\n })\n }\n accessibilityLabel=\"Filter to group conversations\"\n />\n\n <ToggleButton\n title={FilterTypes.Teams}\n active={active === FilterTypes.Teams}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: 'Services',\n })\n }\n accessibilityLabel=\"Filter to team conversations\"\n />\n </>\n )}\n <ToggleButton\n title={showAppFilters ? FilterTypes.More : 'Filter'}\n onPress={() =>\n navigation.navigate('ConversationFilters', {\n chat_group_graph_id,\n group_source_app_name,\n })\n }\n active={active === FilterTypes.More}\n iconNameRight=\"general.threeReducingHorizontalBars\"\n accessibilityLabel={showAppFilters ? 'View all filters' : 'View more filters'}\n />\n </ScrollView>\n <ChatGroupBadge rowPaddingHorizontal={ROW_PADDING_HORIZONTAL} />\n </View>\n )\n}\n\nconst useStyles = () => {\n const theme = useTheme()\n return StyleSheet.create({\n listHeader: {\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.fillColorNeutral050Base,\n paddingBottom: 16,\n gap: 12,\n },\n titleRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingTop: 8,\n paddingHorizontal: ROW_PADDING_HORIZONTAL,\n },\n filterRow: {\n flexDirection: 'row',\n justifyContent: 'flex-start',\n gap: 8,\n paddingHorizontal: ROW_PADDING_HORIZONTAL,\n },\n })\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/chat-react-native",
3
- "version": "3.9.2",
3
+ "version": "3.9.3-rc.1",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -55,5 +55,5 @@
55
55
  "prettier": "^3.4.2",
56
56
  "typescript": "<5.6.0"
57
57
  },
58
- "gitHead": "59f62fcacbb700006f61427d9b9eeb4236c665e9"
58
+ "gitHead": "aff7643e53532b079aaeaa86c6b186c970d62d60"
59
59
  }
@@ -4,6 +4,7 @@ import { Pressable, type PressableProps } from 'react-native-gesture-handler'
4
4
  import { Icon, IconString, Spinner, Text } from '../display'
5
5
  import { useCreateAndroidRippleColor, useTheme } from '../../hooks'
6
6
  import { platformFontWeightMedium, platformPressedOpacityStyle } from '../../utils/styles'
7
+ import { tokens } from '../../vendor/tapestry/tokens'
7
8
 
8
9
  interface ActionToggleButtonProps extends PressableProps {
9
10
  backgroundColor: string
@@ -57,7 +58,7 @@ export function ActionToggleButton({
57
58
 
58
59
  const useStyles = ({ backgroundColor, disabled }: Partial<ActionToggleButtonProps>) => {
59
60
  const { colors } = useTheme()
60
- const fillColor = disabled ? colors.textColorDefaultDisabled : colors.fillColorNeutral100Inverted
61
+ const fillColor = disabled ? colors.textColorDefaultDisabled : tokens.colorNeutral100White
61
62
  const buttonBackgroundColor = disabled
62
63
  ? colors.fillColorButtonNeutralSolidDisabled
63
64
  : backgroundColor
@@ -6,8 +6,8 @@ import { useApiGet } from '../../../hooks/use_api'
6
6
  import { GroupResource } from '../../../types/resources/group_resource'
7
7
  import { ConversationScreenProps } from '../conversations_screen'
8
8
 
9
- export const ChatGroupBadge = () => {
10
- const styles = useStyles()
9
+ export const ChatGroupBadge = ({ rowPaddingHorizontal }: { rowPaddingHorizontal: number }) => {
10
+ const styles = useStyles({ rowPaddingHorizontal })
11
11
  const navigation = useNavigation()
12
12
  const route = useRoute<RouteProp<ConversationScreenProps['route']>>()
13
13
  const { chat_group_graph_id } = route.params || {}
@@ -38,10 +38,11 @@ export const ChatGroupBadge = () => {
38
38
  )
39
39
  }
40
40
 
41
- const useStyles = () => {
41
+ const useStyles = ({ rowPaddingHorizontal }: { rowPaddingHorizontal: number }) => {
42
42
  return StyleSheet.create({
43
43
  row: {
44
44
  flexDirection: 'row',
45
+ paddingHorizontal: rowPaddingHorizontal,
45
46
  },
46
47
  })
47
48
  }
@@ -8,6 +8,8 @@ import { useCanDisplayGroups } from '../../../hooks/use_groups'
8
8
  import { ConversationScreenProps } from '../conversations_screen'
9
9
  import { ChatGroupBadge } from './chat_group_badge'
10
10
 
11
+ const ROW_PADDING_HORIZONTAL = 16
12
+
11
13
  enum FilterTypes {
12
14
  All = 'All',
13
15
  Groups = 'Groups',
@@ -122,9 +124,7 @@ export const ListHeaderComponent = () => {
122
124
  accessibilityLabel={showAppFilters ? 'View all filters' : 'View more filters'}
123
125
  />
124
126
  </ScrollView>
125
- <View style={styles.chatGroupBadgeRow}>
126
- <ChatGroupBadge />
127
- </View>
127
+ <ChatGroupBadge rowPaddingHorizontal={ROW_PADDING_HORIZONTAL} />
128
128
  </View>
129
129
  )
130
130
  }
@@ -142,16 +142,13 @@ const useStyles = () => {
142
142
  flexDirection: 'row',
143
143
  justifyContent: 'space-between',
144
144
  paddingTop: 8,
145
- paddingHorizontal: 16,
145
+ paddingHorizontal: ROW_PADDING_HORIZONTAL,
146
146
  },
147
147
  filterRow: {
148
148
  flexDirection: 'row',
149
149
  justifyContent: 'flex-start',
150
150
  gap: 8,
151
- paddingHorizontal: 16,
152
- },
153
- chatGroupBadgeRow: {
154
- paddingHorizontal: 16,
151
+ paddingHorizontal: ROW_PADDING_HORIZONTAL,
155
152
  },
156
153
  })
157
154
  }