@planningcenter/chat-react-native 3.14.0 → 3.15.0-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.
- package/build/components/conversations/conversation_preview.d.ts.map +1 -1
- package/build/components/conversations/conversation_preview.js +26 -16
- package/build/components/conversations/conversation_preview.js.map +1 -1
- package/build/components/conversations/mute_indicator.d.ts.map +1 -1
- package/build/components/conversations/mute_indicator.js +3 -1
- package/build/components/conversations/mute_indicator.js.map +1 -1
- package/build/components/conversations/swipeable_toggle_button.d.ts.map +1 -1
- package/build/components/conversations/swipeable_toggle_button.js +6 -3
- package/build/components/conversations/swipeable_toggle_button.js.map +1 -1
- package/build/components/conversations/unread_count_badge.js +9 -6
- package/build/components/conversations/unread_count_badge.js.map +1 -1
- package/build/components/display/action_button.d.ts.map +1 -1
- package/build/components/display/action_button.js +2 -2
- package/build/components/display/action_button.js.map +1 -1
- package/build/components/display/badge.d.ts +5 -1
- package/build/components/display/badge.d.ts.map +1 -1
- package/build/components/display/badge.js +2 -2
- package/build/components/display/badge.js.map +1 -1
- package/build/components/display/toggle_button.d.ts +3 -1
- package/build/components/display/toggle_button.d.ts.map +1 -1
- package/build/components/display/toggle_button.js +1 -1
- package/build/components/display/toggle_button.js.map +1 -1
- package/build/hooks/index.d.ts +2 -0
- package/build/hooks/index.d.ts.map +1 -1
- package/build/hooks/index.js +2 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use_at_font_scale_breakpoint.d.ts +2 -0
- package/build/hooks/use_at_font_scale_breakpoint.d.ts.map +1 -0
- package/build/hooks/use_at_font_scale_breakpoint.js +9 -0
- package/build/hooks/use_at_font_scale_breakpoint.js.map +1 -0
- package/build/hooks/use_scalable_number_of_lines.d.ts +2 -0
- package/build/hooks/use_scalable_number_of_lines.d.ts.map +1 -0
- package/build/hooks/use_scalable_number_of_lines.js +9 -0
- package/build/hooks/use_scalable_number_of_lines.js.map +1 -0
- package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_component.js +9 -3
- package/build/screens/conversations/components/list_header_component.js.map +1 -1
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +1 -1
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/utils/styles.d.ts +1 -1
- package/build/utils/styles.js +1 -1
- package/build/utils/styles.js.map +1 -1
- package/package.json +2 -2
- package/src/components/conversations/conversation_preview.tsx +33 -14
- package/src/components/conversations/mute_indicator.tsx +9 -1
- package/src/components/conversations/swipeable_toggle_button.tsx +18 -3
- package/src/components/conversations/unread_count_badge.tsx +9 -6
- package/src/components/display/action_button.tsx +3 -1
- package/src/components/display/badge.tsx +6 -1
- package/src/components/display/toggle_button.tsx +12 -1
- package/src/hooks/index.ts +2 -0
- package/src/hooks/use_at_font_scale_breakpoint.ts +11 -0
- package/src/hooks/use_scalable_number_of_lines.ts +10 -0
- package/src/screens/conversations/components/list_header_component.tsx +11 -2
- package/src/screens/conversations/conversations_screen.tsx +2 -0
- package/src/utils/styles.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle_button.js","sourceRoot":"","sources":["../../../src/components/display/toggle_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEpD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,2BAA2B,EAC3B,kCAAkC,GACnC,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,iCAAiC,EACjC,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,IAAI,EAAc,MAAM,QAAQ,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,M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AiB,EAAE,QAAQ;YAC3B,kBAAkB,EAAE,KAAK;YACzB,UAAU,EAAE,sBAAsB;YAClC,KAAK;SACN;QACD,IAAI,EAAE;YACJ,QAAQ,EAAE,MAAM,CAAC,UAAU,GAAG,SAAS;YACvC,KAAK;SACN;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Pressable, StyleSheet } from 'react-native'\nimport type { PressableProps, GestureResponderEvent } from 'react-native'\nimport { Text } from './text'\nimport {\n useTheme,\n useFontScale,\n useCreateAndroidRippleColor,\n useInteractionGhostBackgroundColor,\n} from '../../hooks'\nimport {\n MAX_FONT_SIZE_MULTIPLIER_LANDMARK,\n platformFontWeightBold,\n platformPressedOpacityStyle,\n} from '../../utils'\nimport { Icon, IconString } from './icon'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { Haptic } from '../../utils/native_adapters/configuration'\n\n// =================================\n// ====== Constants ================\n// =================================\n\n// We are omitting `onLongPress` because we are instead supporting `accessibilityShowsLargeContentViewer`.\n// This is triggered by an `onLongPress` event when an iOS device is in Apple's accessible font scale range.\n// Triggering this prop will display an almost full screen iOS a11y button.\ntype RestrictedPressableProps = Omit<PressableProps, 'onLongPress'>\n\n// =================================\n// ====== Component ================\n// =================================\n\nexport interface ToggleButtonProps extends RestrictedPressableProps {\n /**\n * Pressable container styles\n */\n active: boolean\n /**\n * Specifies whether fonts should be scaled down automatically to fit given style constraints.\n */\n adjustsFontSizeToFit?: boolean\n /**\n * Specifies whether fonts should scale to respect the device's text size accessibility settings. The default is true.\n */\n allowFontScaling?: boolean\n /**\n * Generates an icon to the left of the button text\n */\n iconNameLeft?: IconString\n /**\n * Generates an icon to the right of the button text\n */\n iconNameRight?: IconString\n /**\n * Specifies the maximum size a font can reach when allowFontScaling is enabled.\n */\n maxFontSizeMultiplier?: number\n /**\n * Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).\n */\n minimumFontScale?: number\n /**\n * Renders as text within the button\n */\n title: string\n /**\n * Pressable container styles\n */\n style?: PressableProps['style']\n /**\n * Specifies whether haptic feedback should be enabled.\n */\n hapticFeedback?: boolean\n}\n\nexport function ToggleButton({\n active,\n adjustsFontSizeToFit = false,\n allowFontScaling = true,\n iconNameLeft,\n iconNameRight,\n maxFontSizeMultiplier = MAX_FONT_SIZE_MULTIPLIER_LANDMARK,\n minimumFontScale,\n title,\n style,\n hapticFeedback = true,\n onPress,\n ...props\n}: ToggleButtonProps) {\n const styles = useStyles({ active, maxFontSizeMultiplier })\n const { colors } = useTheme()\n const overrideStyles = StyleSheet.flatten(style) // Ensures the pressed styles still get applied\n\n const baseRippleColor = active ? colors.interaction : colors.fillColorNeutral050Base\n const androidRippleColor = useCreateAndroidRippleColor({ color: baseRippleColor })\n\n const handlePress = (event: GestureResponderEvent) => {\n if (hapticFeedback) Haptic.impactLight()\n\n onPress?.(event)\n }\n\n return (\n <Pressable\n style={({ pressed }) => ({\n ...styles.pressable,\n ...(pressed ? platformPressedOpacityStyle : null),\n ...overrideStyles,\n })}\n accessibilityRole=\"togglebutton\"\n accessibilityState={{ checked: active }}\n android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }}\n onPress={handlePress}\n accessibilityShowsLargeContentViewer\n accessibilityLargeContentTitle={title}\n {...props}\n >\n {iconNameLeft && (\n <Icon\n name={iconNameLeft}\n style={styles.icon}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n />\n )}\n <Text\n allowFontScaling={allowFontScaling}\n minimumFontScale={minimumFontScale}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n adjustsFontSizeToFit={adjustsFontSizeToFit}\n numberOfLines={1}\n style={styles.text}\n variant=\"tertiary\"\n >\n {title}\n </Text>\n {iconNameRight && (\n <Icon\n name={iconNameRight}\n style={styles.icon}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n />\n )}\n </Pressable>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({ active, maxFontSizeMultiplier }: Partial<ToggleButtonProps>) => {\n const { colors, button } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier })\n\n const activeBackgroundColor = useInteractionGhostBackgroundColor()\n\n const color = active ? colors.interaction : colors.textColorDefaultSecondary\n\n return StyleSheet.create({\n pressable: {\n borderRadius: button.borderRadius * fontScale,\n borderWidth: 1,\n borderColor: active ? colors.interaction : colors.borderColorDefaultBase,\n backgroundColor: active ? activeBackgroundColor : 'transparent',\n paddingHorizontal: 16 * fontScale,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n height: 32 * fontScale,\n gap: 6 * fontScale,\n overflow: 'hidden',\n },\n text: {\n textAlign: 'center',\n textAlignVertical: 'center',\n includeFontPadding: false,\n fontWeight: platformFontWeightBold,\n color,\n },\n icon: {\n fontSize: tokens.fontSizeSm * fontScale,\n color,\n },\n })\n}\n"]}
|
package/build/hooks/index.d.ts
CHANGED
|
@@ -12,4 +12,6 @@ export * from './use_api';
|
|
|
12
12
|
export * from './use_api_client';
|
|
13
13
|
export * from './use_message_reaction_toggle';
|
|
14
14
|
export * from './use_interaction_ghost_color';
|
|
15
|
+
export * from './use_at_font_scale_breakpoint';
|
|
16
|
+
export * from './use_scalable_number_of_lines';
|
|
15
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,kBAAkB,CAAA;AAChC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,kBAAkB,CAAA;AAChC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,gCAAgC,CAAA"}
|
package/build/hooks/index.js
CHANGED
|
@@ -12,4 +12,6 @@ export * from './use_api';
|
|
|
12
12
|
export * from './use_api_client';
|
|
13
13
|
export * from './use_message_reaction_toggle';
|
|
14
14
|
export * from './use_interaction_ghost_color';
|
|
15
|
+
export * from './use_at_font_scale_breakpoint';
|
|
16
|
+
export * from './use_scalable_number_of_lines';
|
|
15
17
|
//# sourceMappingURL=index.js.map
|
package/build/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,kBAAkB,CAAA;AAChC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA","sourcesContent":["export * from './use_async_storage'\nexport * from './use_theme'\nexport * from './use_suspense_api'\nexport * from './use_current_person'\nexport * from './use_font_scale'\nexport * from './use_create_android_ripple_color'\nexport * from './use_chat_permissions'\nexport * from './use_api_client'\nexport * from './use_groups_groups'\nexport * from './use_groups'\nexport * from './use_api'\nexport * from './use_api_client'\nexport * from './use_message_reaction_toggle'\nexport * from './use_interaction_ghost_color'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,kBAAkB,CAAA;AAChC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,gCAAgC,CAAA","sourcesContent":["export * from './use_async_storage'\nexport * from './use_theme'\nexport * from './use_suspense_api'\nexport * from './use_current_person'\nexport * from './use_font_scale'\nexport * from './use_create_android_ripple_color'\nexport * from './use_chat_permissions'\nexport * from './use_api_client'\nexport * from './use_groups_groups'\nexport * from './use_groups'\nexport * from './use_api'\nexport * from './use_api_client'\nexport * from './use_message_reaction_toggle'\nexport * from './use_interaction_ghost_color'\nexport * from './use_at_font_scale_breakpoint'\nexport * from './use_scalable_number_of_lines'\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_at_font_scale_breakpoint.d.ts","sourceRoot":"","sources":["../../src/hooks/use_at_font_scale_breakpoint.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,wBAAwB,qBAAsB,MAAM,YAKhE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useFontScale } from './use_font_scale';
|
|
2
|
+
// Based on iOS's AX1 font scale https://developer.apple.com/design/human-interface-guidelines/typography#iOS-iPadOS-larger-accessibility-type-sizes
|
|
3
|
+
const FONT_SCALE_BREAKPOINT_FALLBACK = 1.78;
|
|
4
|
+
export const useAtFontScaleBreakpoint = (scaleBreakpoint) => {
|
|
5
|
+
const fontScale = useFontScale();
|
|
6
|
+
const breakpoint = scaleBreakpoint ?? FONT_SCALE_BREAKPOINT_FALLBACK;
|
|
7
|
+
return fontScale >= breakpoint;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=use_at_font_scale_breakpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_at_font_scale_breakpoint.js","sourceRoot":"","sources":["../../src/hooks/use_at_font_scale_breakpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,oJAAoJ;AACpJ,MAAM,8BAA8B,GAAG,IAAI,CAAA;AAE3C,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,eAAwB,EAAE,EAAE;IACnE,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAChC,MAAM,UAAU,GAAG,eAAe,IAAI,8BAA8B,CAAA;IAEpE,OAAO,SAAS,IAAI,UAAU,CAAA;AAChC,CAAC,CAAA","sourcesContent":["import { useFontScale } from './use_font_scale'\n\n// Based on iOS's AX1 font scale https://developer.apple.com/design/human-interface-guidelines/typography#iOS-iPadOS-larger-accessibility-type-sizes\nconst FONT_SCALE_BREAKPOINT_FALLBACK = 1.78\n\nexport const useAtFontScaleBreakpoint = (scaleBreakpoint?: number) => {\n const fontScale = useFontScale()\n const breakpoint = scaleBreakpoint ?? FONT_SCALE_BREAKPOINT_FALLBACK\n\n return fontScale >= breakpoint\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_scalable_number_of_lines.d.ts","sourceRoot":"","sources":["../../src/hooks/use_scalable_number_of_lines.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB,mBAAoB,MAAM,KAAG,MAAM,GAAG,SAO1E,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useAtFontScaleBreakpoint } from './use_at_font_scale_breakpoint';
|
|
2
|
+
export const useScalableNumberOfLines = (numberOfLines) => {
|
|
3
|
+
const atFontScaleBreakpoint = useAtFontScaleBreakpoint();
|
|
4
|
+
if (!numberOfLines)
|
|
5
|
+
return undefined;
|
|
6
|
+
const numberOfLinesDoubled = numberOfLines + 1;
|
|
7
|
+
return atFontScaleBreakpoint ? numberOfLinesDoubled : numberOfLines;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=use_scalable_number_of_lines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_scalable_number_of_lines.js","sourceRoot":"","sources":["../../src/hooks/use_scalable_number_of_lines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAA;AAEzE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,aAAsB,EAAsB,EAAE;IACrF,MAAM,qBAAqB,GAAG,wBAAwB,EAAE,CAAA;IAExD,IAAI,CAAC,aAAa;QAAE,OAAO,SAAS,CAAA;IAEpC,MAAM,oBAAoB,GAAG,aAAa,GAAG,CAAC,CAAA;IAC9C,OAAO,qBAAqB,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,aAAa,CAAA;AACrE,CAAC,CAAA","sourcesContent":["import { useAtFontScaleBreakpoint } from './use_at_font_scale_breakpoint'\n\nexport const useScalableNumberOfLines = (numberOfLines?: number): number | undefined => {\n const atFontScaleBreakpoint = useAtFontScaleBreakpoint()\n\n if (!numberOfLines) return undefined\n\n const numberOfLinesDoubled = numberOfLines + 1\n return atFontScaleBreakpoint ? numberOfLinesDoubled : numberOfLines\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;AAoBnD,eAAO,MAAM,mBAAmB,
|
|
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;AAoBnD,eAAO,MAAM,mBAAmB,yBAmH/B,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { useNavigation, useRoute } from '@react-navigation/native';
|
|
|
2
2
|
import React, { useCallback, useMemo } from 'react';
|
|
3
3
|
import { Alert, ScrollView, StyleSheet, View } from 'react-native';
|
|
4
4
|
import { Heading, TextButton, ToggleButton } from '../../../components';
|
|
5
|
-
import { useCurrentPersonCache, useTheme } from '../../../hooks';
|
|
5
|
+
import { useAtFontScaleBreakpoint, useCurrentPersonCache, useTheme } from '../../../hooks';
|
|
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';
|
|
@@ -56,7 +56,7 @@ export const ListHeaderComponent = () => {
|
|
|
56
56
|
<Heading numberOfLines={1} variant="h2">
|
|
57
57
|
Conversations
|
|
58
58
|
</Heading>
|
|
59
|
-
<TextButton onPress={alertMarkAllRead} disabled={isPending} maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}>
|
|
59
|
+
<TextButton onPress={alertMarkAllRead} disabled={isPending} maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK} accessibilityShowsLargeContentViewer accessibilityLargeContentTitle="Mark all read">
|
|
60
60
|
Mark all read
|
|
61
61
|
</TextButton>
|
|
62
62
|
</View>
|
|
@@ -86,6 +86,7 @@ export const ListHeaderComponent = () => {
|
|
|
86
86
|
};
|
|
87
87
|
const useStyles = () => {
|
|
88
88
|
const theme = useTheme();
|
|
89
|
+
const atFontScaleBreakpoint = useAtFontScaleBreakpoint();
|
|
89
90
|
return StyleSheet.create({
|
|
90
91
|
listHeader: {
|
|
91
92
|
borderBottomWidth: 1,
|
|
@@ -94,9 +95,14 @@ const useStyles = () => {
|
|
|
94
95
|
gap: 12,
|
|
95
96
|
},
|
|
96
97
|
titleRow: {
|
|
97
|
-
flexDirection: 'row',
|
|
98
|
+
flexDirection: atFontScaleBreakpoint ? 'column' : 'row',
|
|
98
99
|
justifyContent: 'space-between',
|
|
100
|
+
alignItems: atFontScaleBreakpoint ? 'flex-start' : 'center',
|
|
101
|
+
flexWrap: 'wrap',
|
|
102
|
+
rowGap: 8,
|
|
103
|
+
columnGap: 16,
|
|
99
104
|
paddingTop: 8,
|
|
105
|
+
paddingBottom: atFontScaleBreakpoint ? 4 : 0,
|
|
100
106
|
paddingHorizontal: ROW_PADDING_HORIZONTAL,
|
|
101
107
|
},
|
|
102
108
|
filterRow: {
|
|
@@ -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,qBAAqB,EAAE,QAAQ,EAAE,MAAM,gBA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ute } 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 { useCurrentPersonCache, useTheme } from '../../../hooks'\nimport { useMarkAllRead } from '../../../hooks/use_conversations_actions'\nimport { useCanDisplayGroups } from '../../../hooks/use_groups'\nimport { ConversationsScreenProps } from '../conversations_screen'\nimport { ChatGroupBadge } from './chat_group_badge'\nimport { Haptic } from '../../../utils/native_adapters'\nimport { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../../utils'\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<ConversationsScreenProps['route']>>()\n const { chat_group_graph_id, group_source_app_name = '' } = route.params || {}\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 Haptic.notificationSuccess()\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\n onPress={alertMarkAllRead}\n disabled={isPending}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n >\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"]}
|
|
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,wBAAwB,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAA;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAA;AACvD,OAAO,EAAE,iCAAiC,EAAE,MAAM,gBAAgB,CAAA;AAElE,MAAM,sBAAsB,GAAG,EAAE,CAAA;AAEjC,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,CAA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Ac,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,MAAM,qBAAqB,GAAG,wBAAwB,EAAE,CAAA;IAExD,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,qBAAqB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK;YACvD,cAAc,EAAE,eAAe;YAC/B,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ;YAC3D,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,CAAC;YACT,SAAS,EAAE,EAAE;YACb,UAAU,EAAE,CAAC;YACb,aAAa,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5C,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 { useAtFontScaleBreakpoint, useCurrentPersonCache, useTheme } from '../../../hooks'\nimport { useMarkAllRead } from '../../../hooks/use_conversations_actions'\nimport { useCanDisplayGroups } from '../../../hooks/use_groups'\nimport { ConversationsScreenProps } from '../conversations_screen'\nimport { ChatGroupBadge } from './chat_group_badge'\nimport { Haptic } from '../../../utils/native_adapters'\nimport { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../../utils'\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<ConversationsScreenProps['route']>>()\n const { chat_group_graph_id, group_source_app_name = '' } = route.params || {}\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 Haptic.notificationSuccess()\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\n onPress={alertMarkAllRead}\n disabled={isPending}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n accessibilityShowsLargeContentViewer\n accessibilityLargeContentTitle=\"Mark all read\"\n >\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 const atFontScaleBreakpoint = useAtFontScaleBreakpoint()\n\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: atFontScaleBreakpoint ? 'column' : 'row',\n justifyContent: 'space-between',\n alignItems: atFontScaleBreakpoint ? 'flex-start' : 'center',\n flexWrap: 'wrap',\n rowGap: 8,\n columnGap: 16,\n paddingTop: 8,\n paddingBottom: atFontScaleBreakpoint ? 4 : 0,\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversations/conversations_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAG9D,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAExD,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAC,CAAA;AAEF,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,EAAE,wBAAwB,
|
|
1
|
+
{"version":3,"file":"conversations_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversations/conversations_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAG9D,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAExD,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAC,CAAA;AAEF,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,EAAE,wBAAwB,qBAkEtE"}
|
|
@@ -48,7 +48,7 @@ export function ConversationsScreen({ route }) {
|
|
|
48
48
|
<ConversationsContextProvider args={route.params}>
|
|
49
49
|
<Conversations ListHeaderComponent={ListHeaderComponent}/>
|
|
50
50
|
</ConversationsContextProvider>
|
|
51
|
-
<ActionButton visible={canCreateConversations} title="New conversation" onPress={handleNewConversationNavigation} buttonIconNameLeft="churchCenter.signups" secondaryButton={<TextButton variant="tertiary" onPress={reportABug} maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}>
|
|
51
|
+
<ActionButton visible={canCreateConversations} title="New conversation" onPress={handleNewConversationNavigation} buttonIconNameLeft="churchCenter.signups" secondaryButton={<TextButton variant="tertiary" onPress={reportABug} maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK} accessibilityShowsLargeContentViewer accessibilityLargeContentTitle="Report a bug">
|
|
52
52
|
Report a bug
|
|
53
53
|
</TextButton>}/>
|
|
54
54
|
</View>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations_screen.js","sourceRoot":"","sources":["../../../src/screens/conversations/conversations_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAA;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,EAAE,2BAA2B,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAA;AAC5F,OAAO,EAA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CAAC,WAAW,CAAC,CAAA;IACzC,CAAC,CAAA;IAED,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAC/C;QAAA,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,mBAAmB,CAAC,EAC1D;MAAA,EAAE,4BAA4B,CAC9B;MAAA,CAAC,YAAY,CACX,OAAO,CAAC,CAAC,sBAAsB,CAAC,CAChC,KAAK,CAAC,kBAAkB,CACxB,OAAO,CAAC,CAAC,+BAA+B,CAAC,CACzC,kBAAkB,CAAC,sBAAsB,CACzC,eAAe,CAAC,CACd,CAAC,UAAU,CACT,OAAO,CAAC,UAAU,CAClB,OAAO,CAAC,CAAC,UAAU,CAAC,CACpB,qBAAqB,CAAC,CAAC,iCAAiC,CAAC,
|
|
1
|
+
{"version":3,"file":"conversations_screen.js","sourceRoot":"","sources":["../../../src/screens/conversations/conversations_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAA;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,EAAE,2BAA2B,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAA;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AASxE,MAAM,UAAU,mBAAmB,CAAC,EAAE,KAAK,EAA4B;IACrE,MAAM,UAAU,G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AS,CAAC,CAC5B;MAAA,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAC/C;QAAA,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,mBAAmB,CAAC,EAC1D;MAAA,EAAE,4BAA4B,CAC9B;MAAA,CAAC,YAAY,CACX,OAAO,CAAC,CAAC,sBAAsB,CAAC,CAChC,KAAK,CAAC,kBAAkB,CACxB,OAAO,CAAC,CAAC,+BAA+B,CAAC,CACzC,kBAAkB,CAAC,sBAAsB,CACzC,eAAe,CAAC,CACd,CAAC,UAAU,CACT,OAAO,CAAC,UAAU,CAClB,OAAO,CAAC,CAAC,UAAU,CAAC,CACpB,qBAAqB,CAAC,CAAC,iCAAiC,CAAC,CACzD,oCAAoC,CACpC,8BAA8B,CAAC,cAAc,CAE7C;;UACF,EAAE,UAAU,CACd,CAAC,EAEL;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,IAAI,EAAE,CAAC;YACP,cAAc,EAAE,QAAQ;SACzB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Conversations, TextButton } from '../../components'\nimport { ActionButton } from '../../components/display/action_button'\nimport { ConversationsContextProvider } from '../../contexts/conversations_context'\nimport { useCanCreateConversations } from '../../hooks'\nimport { GraphId } from '../../types/resources/group_resource'\nimport { destructureChatGroupGraphId, MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils'\nimport { ListHeaderComponent } from './components/list_header_component'\nimport { AppName } from '../../types/resources/app_name'\n\nexport type ConversationsScreenProps = StaticScreenProps<{\n title?: string\n chat_group_graph_id?: GraphId\n group_source_app_name?: AppName\n}>\n\nexport function ConversationsScreen({ route }: ConversationsScreenProps) {\n const navigation = useNavigation()\n const canCreateConversations = useCanCreateConversations()\n const styles = useStyles()\n\n const { chat_group_graph_id } = route.params || {}\n const { sourceAppName, sourceId } = destructureChatGroupGraphId(chat_group_graph_id)\n\n const handleNewConversationNavigation = () => {\n if (sourceAppName === 'Services') {\n return navigation.navigate('New', {\n screen: 'ConversationNew',\n params: {\n team_ids: sourceId ? [sourceId] : [],\n source_app_name: sourceAppName,\n ...route.params,\n },\n })\n }\n if (sourceAppName === 'Groups') {\n return navigation.navigate('New', {\n screen: 'ConversationNew',\n params: {\n group_id: sourceId,\n source_app_name: sourceAppName,\n ...route.params,\n },\n })\n }\n\n return navigation.navigate('New', {\n screen: 'ConversationSelectRecipients',\n params: {\n ...route.params,\n },\n })\n }\n\n const reportABug = () => {\n return navigation.navigate('BugReport')\n }\n\n return (\n <View style={styles.container}>\n <ConversationsContextProvider args={route.params}>\n <Conversations ListHeaderComponent={ListHeaderComponent} />\n </ConversationsContextProvider>\n <ActionButton\n visible={canCreateConversations}\n title=\"New conversation\"\n onPress={handleNewConversationNavigation}\n buttonIconNameLeft=\"churchCenter.signups\"\n secondaryButton={\n <TextButton\n variant=\"tertiary\"\n onPress={reportABug}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n accessibilityShowsLargeContentViewer\n accessibilityLargeContentTitle=\"Report a bug\"\n >\n Report a bug\n </TextButton>\n }\n />\n </View>\n )\n}\n\nconst useStyles = () => {\n return StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n },\n })\n}\n"]}
|
package/build/utils/styles.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const MAX_FONT_SIZE_MULTIPLIER = 1.5;
|
|
2
|
-
export declare const MAX_FONT_SIZE_MULTIPLIER_LANDMARK = 1.
|
|
2
|
+
export declare const MAX_FONT_SIZE_MULTIPLIER_LANDMARK = 1.2;
|
|
3
3
|
export declare const CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL = 16;
|
|
4
4
|
export declare const platformFontWeightMedium: "500" | "700" | undefined;
|
|
5
5
|
export declare const platformFontWeightBold: "600" | "700" | undefined;
|
package/build/utils/styles.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
2
|
import { tokens } from '../vendor/tapestry/tokens';
|
|
3
3
|
export const MAX_FONT_SIZE_MULTIPLIER = 1.5;
|
|
4
|
-
export const MAX_FONT_SIZE_MULTIPLIER_LANDMARK = 1.
|
|
4
|
+
export const MAX_FONT_SIZE_MULTIPLIER_LANDMARK = 1.2; // Use in headers, footers, toolbars, etc.
|
|
5
5
|
export const CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL = 16; // TODO: move to `screens/conversation/utils/styles` when `/screens/conversation` is created
|
|
6
6
|
export const platformFontWeightMedium = Platform.select({
|
|
7
7
|
ios: tokens.fontWeightMedium,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/utils/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAElD,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAA;AAC3C,MAAM,CAAC,MAAM,iCAAiC,GAAG,GAAG,CAAA,CAAC,0CAA0C;AAE/F,MAAM,CAAC,MAAM,4CAA4C,GAAG,EAAE,CAAA,CAAC,4FAA4F;AAE3J,MAAM,CAAC,MAAM,wBAAwB,GAAG,QAAQ,CAAC,MAAM,CAAC;IACtD,GAAG,EAAE,MAAM,CAAC,gBAAgB;IAC5B,OAAO,EAAE,MAAM,CAAC,cAAc;CAC/B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAAC,MAAM,CAAC;IACpD,GAAG,EAAE,MAAM,CAAC,kBAAkB;IAC9B,OAAO,EAAE,MAAM,CAAC,cAAc;CAC/B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,QAAQ,CAAC,MAAM,CAAC;IACzD,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;IACrB,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE;CACxB,CAAC,CAAA","sourcesContent":["import { Platform } from 'react-native'\nimport { tokens } from '../vendor/tapestry/tokens'\n\nexport const MAX_FONT_SIZE_MULTIPLIER = 1.5\nexport const MAX_FONT_SIZE_MULTIPLIER_LANDMARK = 1.
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/utils/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAElD,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAA;AAC3C,MAAM,CAAC,MAAM,iCAAiC,GAAG,GAAG,CAAA,CAAC,0CAA0C;AAE/F,MAAM,CAAC,MAAM,4CAA4C,GAAG,EAAE,CAAA,CAAC,4FAA4F;AAE3J,MAAM,CAAC,MAAM,wBAAwB,GAAG,QAAQ,CAAC,MAAM,CAAC;IACtD,GAAG,EAAE,MAAM,CAAC,gBAAgB;IAC5B,OAAO,EAAE,MAAM,CAAC,cAAc;CAC/B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAAC,MAAM,CAAC;IACpD,GAAG,EAAE,MAAM,CAAC,kBAAkB;IAC9B,OAAO,EAAE,MAAM,CAAC,cAAc;CAC/B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,QAAQ,CAAC,MAAM,CAAC;IACzD,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;IACrB,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE;CACxB,CAAC,CAAA","sourcesContent":["import { Platform } from 'react-native'\nimport { tokens } from '../vendor/tapestry/tokens'\n\nexport const MAX_FONT_SIZE_MULTIPLIER = 1.5\nexport const MAX_FONT_SIZE_MULTIPLIER_LANDMARK = 1.2 // Use in headers, footers, toolbars, etc.\n\nexport const CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL = 16 // TODO: move to `screens/conversation/utils/styles` when `/screens/conversation` is created\n\nexport const platformFontWeightMedium = Platform.select({\n ios: tokens.fontWeightMedium,\n android: tokens.fontWeightBold,\n})\n\nexport const platformFontWeightBold = Platform.select({\n ios: tokens.fontWeightSemiBold,\n android: tokens.fontWeightBold,\n})\n\nexport const platformPressedOpacityStyle = Platform.select({\n ios: { opacity: 0.5 },\n android: { opacity: 1 },\n})\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/chat-react-native",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.0-rc.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"react-native-url-polyfill": "^2.0.0",
|
|
56
56
|
"typescript": "<5.6.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "374e1b143d5267e4dfd7b35e50df600adda5f3c1"
|
|
59
59
|
}
|
|
@@ -3,7 +3,12 @@ import { StyleSheet, View, ViewStyle } from 'react-native'
|
|
|
3
3
|
import { ConversationResource } from '../../types'
|
|
4
4
|
import { AvatarGroup, Heading, Text, Badge, type BadgeProps } from '../display'
|
|
5
5
|
import { formatDatePreview } from '../../utils/date'
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
useTheme,
|
|
8
|
+
useAtFontScaleBreakpoint,
|
|
9
|
+
useFontScale,
|
|
10
|
+
useScalableNumberOfLines,
|
|
11
|
+
} from '../../hooks'
|
|
7
12
|
import { UnreadCountBadge } from './unread_count_badge'
|
|
8
13
|
import { ConversationActions } from './conversation_actions'
|
|
9
14
|
import { MuteIndicator } from './mute_indicator'
|
|
@@ -39,6 +44,10 @@ export const ConversationPreview = ({
|
|
|
39
44
|
const hasAvatarUrls = previewAvatarUrls && previewAvatarUrls.length > 0
|
|
40
45
|
const shouldShowFallback = emptyConversation || !hasAvatarUrls
|
|
41
46
|
const fallbackIconName = emptyConversation ? 'people.noTextMessage' : 'general.person'
|
|
47
|
+
const hasMetaContent = lastMessageCreatedAt || unreadCount > 0 || muted
|
|
48
|
+
|
|
49
|
+
const numberOfLinesScaledTitle = useScalableNumberOfLines(1)
|
|
50
|
+
const numberOfLinesScaledPreviewText = useScalableNumberOfLines(2)
|
|
42
51
|
|
|
43
52
|
const conversationPreviewText = lastMessageTextPreview
|
|
44
53
|
? `${lastMessageAuthorName}: ${lastMessageTextPreview}`
|
|
@@ -63,25 +72,27 @@ export const ConversationPreview = ({
|
|
|
63
72
|
fallbackIconName={fallbackIconName}
|
|
64
73
|
/>
|
|
65
74
|
<View style={styles.conversationBody}>
|
|
66
|
-
<Heading numberOfLines={
|
|
75
|
+
<Heading numberOfLines={numberOfLinesScaledTitle} variant="h3" style={styles.title}>
|
|
67
76
|
{title}
|
|
68
77
|
</Heading>
|
|
69
78
|
<Text
|
|
70
79
|
variant="tertiary"
|
|
71
|
-
numberOfLines={
|
|
80
|
+
numberOfLines={numberOfLinesScaledPreviewText}
|
|
72
81
|
style={emptyConversation && styles.emptyConversationPreviewText}
|
|
73
82
|
>
|
|
74
83
|
{conversationPreviewText}
|
|
75
84
|
</Text>
|
|
76
85
|
<ConversationBadges visible={showBadges} badges={badges} />
|
|
77
86
|
</View>
|
|
78
|
-
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
<
|
|
82
|
-
|
|
87
|
+
{hasMetaContent && (
|
|
88
|
+
<View style={styles.metaContainer}>
|
|
89
|
+
<Text variant="tertiary">{formatDatePreview(lastMessageCreatedAt)}</Text>
|
|
90
|
+
<View style={styles.statusContainer}>
|
|
91
|
+
<UnreadCountBadge count={unreadCount} showDot={muted} />
|
|
92
|
+
<MuteIndicator muted={muted} />
|
|
93
|
+
</View>
|
|
83
94
|
</View>
|
|
84
|
-
|
|
95
|
+
)}
|
|
85
96
|
</ConversationActions>
|
|
86
97
|
)
|
|
87
98
|
}
|
|
@@ -93,6 +104,7 @@ interface BadgeShape {
|
|
|
93
104
|
}
|
|
94
105
|
const ConversationBadges = ({ visible, badges }: { visible: boolean; badges?: BadgeShape[] }) => {
|
|
95
106
|
const styles = useStyles()
|
|
107
|
+
const numberOfLinesScaled = useScalableNumberOfLines(1)
|
|
96
108
|
|
|
97
109
|
if (!visible || !badges || badges.length === 0) {
|
|
98
110
|
return null
|
|
@@ -107,6 +119,7 @@ const ConversationBadges = ({ visible, badges }: { visible: boolean; badges?: Ba
|
|
|
107
119
|
productLogoName={badge.appName}
|
|
108
120
|
label={badge.pcoResourceType}
|
|
109
121
|
metaLabel={badge.text || ''}
|
|
122
|
+
numberOfLinesMetaLabel={numberOfLinesScaled}
|
|
110
123
|
/>
|
|
111
124
|
))}
|
|
112
125
|
</View>
|
|
@@ -179,13 +192,17 @@ const getConversationAccessibilityLabel = ({
|
|
|
179
192
|
|
|
180
193
|
const useStyles = () => {
|
|
181
194
|
const { colors } = useTheme()
|
|
195
|
+
const atFontScaleBreakpoint = useAtFontScaleBreakpoint()
|
|
196
|
+
const fontScale = useFontScale()
|
|
182
197
|
|
|
183
198
|
return StyleSheet.create({
|
|
184
199
|
previewRow: {
|
|
185
|
-
flexDirection: 'row',
|
|
200
|
+
flexDirection: atFontScaleBreakpoint ? 'column' : 'row',
|
|
186
201
|
gap: 8,
|
|
187
202
|
borderBottomWidth: 1,
|
|
188
|
-
borderBottomColor:
|
|
203
|
+
borderBottomColor: atFontScaleBreakpoint
|
|
204
|
+
? colors.borderColorDefaultDark
|
|
205
|
+
: colors.borderColorDefaultDim,
|
|
189
206
|
paddingTop: 12,
|
|
190
207
|
paddingBottom: 12,
|
|
191
208
|
paddingHorizontal: 16,
|
|
@@ -214,8 +231,10 @@ const useStyles = () => {
|
|
|
214
231
|
borderRadius: 4,
|
|
215
232
|
},
|
|
216
233
|
metaContainer: {
|
|
217
|
-
|
|
218
|
-
alignItems: 'flex-end',
|
|
234
|
+
gap: 4,
|
|
235
|
+
alignItems: atFontScaleBreakpoint ? 'center' : 'flex-end',
|
|
236
|
+
justifyContent: atFontScaleBreakpoint ? 'space-between' : 'flex-start',
|
|
237
|
+
flexDirection: atFontScaleBreakpoint ? 'row' : 'column',
|
|
219
238
|
},
|
|
220
239
|
dateLoading: {
|
|
221
240
|
width: 60,
|
|
@@ -230,7 +249,7 @@ const useStyles = () => {
|
|
|
230
249
|
statusContainer: {
|
|
231
250
|
flexDirection: 'row',
|
|
232
251
|
alignItems: 'center',
|
|
233
|
-
gap: 4,
|
|
252
|
+
gap: 4 * fontScale,
|
|
234
253
|
},
|
|
235
254
|
})
|
|
236
255
|
}
|
|
@@ -2,13 +2,20 @@ import React from 'react'
|
|
|
2
2
|
import { StyleSheet } from 'react-native'
|
|
3
3
|
import { Icon } from '../display'
|
|
4
4
|
import { useTheme } from '../../hooks'
|
|
5
|
+
import { MAX_FONT_SIZE_MULTIPLIER } from '../../utils'
|
|
5
6
|
|
|
6
7
|
export const MuteIndicator = ({ muted }: { muted: boolean }) => {
|
|
7
8
|
const styles = useStyles()
|
|
8
9
|
|
|
9
10
|
if (!muted) return null
|
|
10
11
|
|
|
11
|
-
return
|
|
12
|
+
return (
|
|
13
|
+
<Icon
|
|
14
|
+
name="general.bellMuted"
|
|
15
|
+
style={styles.mutedIcon}
|
|
16
|
+
maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}
|
|
17
|
+
/>
|
|
18
|
+
)
|
|
12
19
|
}
|
|
13
20
|
|
|
14
21
|
const useStyles = () => {
|
|
@@ -16,6 +23,7 @@ const useStyles = () => {
|
|
|
16
23
|
return StyleSheet.create({
|
|
17
24
|
mutedIcon: {
|
|
18
25
|
color: colors.iconColorDefaultDim,
|
|
26
|
+
fontSize: 16,
|
|
19
27
|
},
|
|
20
28
|
})
|
|
21
29
|
}
|
|
@@ -3,7 +3,11 @@ import { StyleSheet } from 'react-native'
|
|
|
3
3
|
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
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
MAX_FONT_SIZE_MULTIPLIER,
|
|
8
|
+
platformFontWeightMedium,
|
|
9
|
+
platformPressedOpacityStyle,
|
|
10
|
+
} from '../../utils/styles'
|
|
7
11
|
import { tokens } from '../../vendor/tapestry/tokens'
|
|
8
12
|
import { Haptic } from '../../utils/native_adapters/configuration'
|
|
9
13
|
|
|
@@ -50,8 +54,16 @@ export function SwipeableToggleButton({
|
|
|
50
54
|
<Spinner size={20} />
|
|
51
55
|
) : (
|
|
52
56
|
<>
|
|
53
|
-
<Icon
|
|
54
|
-
|
|
57
|
+
<Icon
|
|
58
|
+
name={iconName}
|
|
59
|
+
style={styles.icon}
|
|
60
|
+
maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}
|
|
61
|
+
/>
|
|
62
|
+
<Text
|
|
63
|
+
variant="footnote"
|
|
64
|
+
style={styles.text}
|
|
65
|
+
maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}
|
|
66
|
+
>
|
|
55
67
|
{label}
|
|
56
68
|
</Text>
|
|
57
69
|
</>
|
|
@@ -78,12 +90,15 @@ const useStyles = ({ backgroundColor, disabled }: Partial<SwipeableToggleButtonP
|
|
|
78
90
|
backgroundColor: buttonBackgroundColor,
|
|
79
91
|
},
|
|
80
92
|
icon: {
|
|
93
|
+
fontSize: 20,
|
|
81
94
|
color: fillColor,
|
|
82
95
|
marginTop: 4,
|
|
83
96
|
},
|
|
84
97
|
text: {
|
|
85
98
|
color: fillColor,
|
|
86
99
|
fontWeight: platformFontWeightMedium,
|
|
100
|
+
textAlign: 'center',
|
|
101
|
+
paddingHorizontal: 8,
|
|
87
102
|
},
|
|
88
103
|
})
|
|
89
104
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { StyleSheet, View } from 'react-native'
|
|
3
3
|
import { Text } from '../display'
|
|
4
|
-
import { useTheme } from '../../hooks'
|
|
5
|
-
import { platformFontWeightBold } from '../../utils'
|
|
4
|
+
import { useFontScale, useTheme } from '../../hooks'
|
|
5
|
+
import { MAX_FONT_SIZE_MULTIPLIER, platformFontWeightBold } from '../../utils'
|
|
6
6
|
|
|
7
7
|
export const UnreadCountBadge = ({ count, showDot }: { count: number; showDot: boolean }) => {
|
|
8
8
|
const styles = useStyles()
|
|
@@ -22,6 +22,9 @@ export const UnreadCountBadge = ({ count, showDot }: { count: number; showDot: b
|
|
|
22
22
|
|
|
23
23
|
const useStyles = () => {
|
|
24
24
|
const { colors } = useTheme()
|
|
25
|
+
const dotScaleLimit = MAX_FONT_SIZE_MULTIPLIER * 1.5
|
|
26
|
+
const fontScale = useFontScale({ maxFontSizeMultiplier: dotScaleLimit })
|
|
27
|
+
const size = 8 * fontScale
|
|
25
28
|
|
|
26
29
|
return StyleSheet.create({
|
|
27
30
|
badge: {
|
|
@@ -29,16 +32,16 @@ const useStyles = () => {
|
|
|
29
32
|
backgroundColor: colors.fillColorInteractionDefault,
|
|
30
33
|
paddingVertical: 2,
|
|
31
34
|
paddingHorizontal: 8,
|
|
32
|
-
borderRadius: 24,
|
|
35
|
+
borderRadius: 24 * fontScale,
|
|
33
36
|
},
|
|
34
37
|
count: {
|
|
35
38
|
fontWeight: platformFontWeightBold,
|
|
36
39
|
color: 'white',
|
|
37
40
|
},
|
|
38
41
|
dot: {
|
|
39
|
-
width:
|
|
40
|
-
height:
|
|
41
|
-
borderRadius:
|
|
42
|
+
width: size,
|
|
43
|
+
height: size,
|
|
44
|
+
borderRadius: size,
|
|
42
45
|
backgroundColor: colors.fillColorInteractionDefault,
|
|
43
46
|
},
|
|
44
47
|
})
|
|
@@ -58,13 +58,15 @@ export const ActionButton = ({
|
|
|
58
58
|
iconNameLeft={buttonIconNameLeft}
|
|
59
59
|
loading={loading}
|
|
60
60
|
maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}
|
|
61
|
+
accessibilityShowsLargeContentViewer
|
|
62
|
+
accessibilityLargeContentTitle={title}
|
|
61
63
|
/>
|
|
62
64
|
</View>
|
|
63
65
|
</Animated.View>
|
|
64
66
|
)
|
|
65
67
|
}
|
|
66
68
|
|
|
67
|
-
const SCALE_THAT_BUTTONS_WRAP = 1.
|
|
69
|
+
const SCALE_THAT_BUTTONS_WRAP = 1.15
|
|
68
70
|
|
|
69
71
|
const useStyles = () => {
|
|
70
72
|
const { fontScale } = useWindowDimensions()
|
|
@@ -91,6 +91,10 @@ export interface BadgeProps {
|
|
|
91
91
|
* Callback function when the badge is pressed.
|
|
92
92
|
*/
|
|
93
93
|
onPress?: () => void
|
|
94
|
+
/**
|
|
95
|
+
* Specifies the number of lines for the meta label before truncating.
|
|
96
|
+
*/
|
|
97
|
+
numberOfLinesMetaLabel?: number
|
|
94
98
|
}
|
|
95
99
|
|
|
96
100
|
export function Badge({
|
|
@@ -103,6 +107,7 @@ export function Badge({
|
|
|
103
107
|
productLogoName,
|
|
104
108
|
variant = 'default',
|
|
105
109
|
maxFontSizeMultiplier,
|
|
110
|
+
numberOfLinesMetaLabel = 1,
|
|
106
111
|
onPress,
|
|
107
112
|
}: BadgeProps) {
|
|
108
113
|
const styles = useStyles({ appearance, maxFontSizeMultiplier, variant })
|
|
@@ -134,7 +139,7 @@ export function Badge({
|
|
|
134
139
|
<Text
|
|
135
140
|
variant="footnote"
|
|
136
141
|
style={styles.metaLabel}
|
|
137
|
-
numberOfLines={
|
|
142
|
+
numberOfLines={numberOfLinesMetaLabel}
|
|
138
143
|
maxFontSizeMultiplier={maxFontSizeMultiplier}
|
|
139
144
|
>
|
|
140
145
|
{metaLabel}
|