@planningcenter/chat-react-native 3.14.0-rc.5 → 3.15.0-rc.0
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 +18 -12
- package/build/components/conversations/conversation_preview.js.map +1 -1
- package/build/components/display/action_button.d.ts.map +1 -1
- package/build/components/display/action_button.js +3 -2
- package/build/components/display/action_button.js.map +1 -1
- package/build/components/display/badge.js +5 -5
- package/build/components/display/badge.js.map +1 -1
- package/build/components/display/platform_modal_header_buttons.d.ts +4 -4
- package/build/components/display/platform_modal_header_buttons.d.ts.map +1 -1
- package/build/components/display/platform_modal_header_buttons.js +2 -2
- package/build/components/display/platform_modal_header_buttons.js.map +1 -1
- package/build/components/display/text.d.ts +10 -2
- package/build/components/display/text.d.ts.map +1 -1
- package/build/components/display/text.js +0 -3
- package/build/components/display/text.js.map +1 -1
- package/build/components/display/toggle_button.d.ts.map +1 -1
- package/build/components/display/toggle_button.js +2 -2
- package/build/components/display/toggle_button.js.map +1 -1
- package/build/components/page/error_boundary.d.ts.map +1 -1
- package/build/components/page/error_boundary.js +11 -46
- package/build/components/page/error_boundary.js.map +1 -1
- package/build/components/primitive/avatar_primitive.d.ts.map +1 -1
- package/build/components/primitive/avatar_primitive.js +14 -6
- package/build/components/primitive/avatar_primitive.js.map +1 -1
- package/build/components/primitive/blank_state_primitive.d.ts +5 -2
- package/build/components/primitive/blank_state_primitive.d.ts.map +1 -1
- package/build/components/primitive/blank_state_primitive.js +6 -1
- package/build/components/primitive/blank_state_primitive.js.map +1 -1
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.d.ts.map +1 -1
- package/build/hooks/index.js +1 -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/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +6 -6
- package/build/navigation/index.js.map +1 -1
- package/build/screens/bug_report_screen.js +4 -4
- package/build/screens/bug_report_screen.js.map +1 -1
- package/build/screens/conversation_details_screen.d.ts.map +1 -1
- package/build/screens/conversation_details_screen.js +3 -3
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_new/components/filter_by_plan.js +2 -2
- package/build/screens/conversation_new/components/filter_by_plan.js.map +1 -1
- package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_component.js +10 -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 +2 -2
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/utils/styles.d.ts +1 -0
- package/build/utils/styles.d.ts.map +1 -1
- package/build/utils/styles.js +1 -0
- package/build/utils/styles.js.map +1 -1
- package/package.json +2 -2
- package/src/components/conversations/conversation_preview.tsx +19 -11
- package/src/components/display/action_button.tsx +3 -1
- package/src/components/display/badge.tsx +5 -5
- package/src/components/display/platform_modal_header_buttons.tsx +6 -6
- package/src/components/display/text.tsx +30 -2
- package/src/components/display/toggle_button.tsx +6 -2
- package/src/components/page/error_boundary.tsx +16 -47
- package/src/components/primitive/avatar_primitive.tsx +14 -6
- package/src/components/primitive/blank_state_primitive.tsx +17 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use_at_font_scale_breakpoint.ts +11 -0
- package/src/navigation/index.tsx +6 -6
- package/src/screens/bug_report_screen.tsx +5 -5
- package/src/screens/conversation_details_screen.tsx +13 -4
- package/src/screens/conversation_new/components/filter_by_plan.tsx +2 -2
- package/src/screens/conversations/components/list_header_component.tsx +15 -3
- package/src/screens/conversations/conversations_screen.tsx +6 -2
- package/src/utils/styles.ts +1 -0
- package/build/navigation/header.d.ts +0 -10
- package/build/navigation/header.d.ts.map +0 -1
- package/build/navigation/header.js +0 -16
- package/build/navigation/header.js.map +0 -1
- package/src/navigation/header.tsx +0 -24
|
@@ -20,8 +20,8 @@ import { useUploadClient } from '../hooks/use_upload_client'
|
|
|
20
20
|
import { ImagePicker, ImagePickerResult, platformFontWeightBold } from '../utils'
|
|
21
21
|
import { useReportBugAction } from '../hooks/use_report_bug_action'
|
|
22
22
|
import {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
HeaderDismissButton,
|
|
24
|
+
HeaderTextButton,
|
|
25
25
|
} from '../components/display/platform_modal_header_buttons'
|
|
26
26
|
import { DefaultLoading } from '../components/page/loading'
|
|
27
27
|
import { startsWith } from 'lodash'
|
|
@@ -46,7 +46,7 @@ export const BugReportScreenOptions = ({
|
|
|
46
46
|
}: NativeStackScreenProps<any>): NativeStackNavigationOptions => ({
|
|
47
47
|
presentation: 'modal',
|
|
48
48
|
title: 'Report a bug',
|
|
49
|
-
headerLeft: () => <
|
|
49
|
+
headerLeft: () => <HeaderDismissButton title="Cancel" onPress={() => navigation.goBack()} />,
|
|
50
50
|
})
|
|
51
51
|
|
|
52
52
|
interface Attachment {
|
|
@@ -150,7 +150,7 @@ ${stepsToResolve}`
|
|
|
150
150
|
navigation.setOptions({
|
|
151
151
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
152
152
|
headerRight: () => (
|
|
153
|
-
<
|
|
153
|
+
<HeaderTextButton title="Submit" onPress={handleSubmit} disabled={!formValid} />
|
|
154
154
|
),
|
|
155
155
|
})
|
|
156
156
|
}, [formValid, handleSubmit, navigation])
|
|
@@ -237,7 +237,7 @@ ${stepsToResolve}`
|
|
|
237
237
|
>
|
|
238
238
|
<View style={styles.modalContainer}>
|
|
239
239
|
<View style={styles.modalHeader}>
|
|
240
|
-
<
|
|
240
|
+
<HeaderDismissButton title="Cancel" onPress={() => setShowBugTypePicker(false)} />
|
|
241
241
|
<Text style={styles.modalTitle}>Select Bug Type</Text>
|
|
242
242
|
<View style={styles.modalHeaderSpacer} />
|
|
243
243
|
</View>
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
StyleSheet,
|
|
13
13
|
TextInput,
|
|
14
14
|
View,
|
|
15
|
-
type TextStyle,
|
|
16
15
|
type ViewStyle,
|
|
17
16
|
type ViewProps,
|
|
18
17
|
Pressable,
|
|
@@ -20,7 +19,17 @@ import {
|
|
|
20
19
|
Platform,
|
|
21
20
|
} from 'react-native'
|
|
22
21
|
import { HeaderTitle as ElementsHeaderTitle, HeaderTitleProps } from '@react-navigation/elements'
|
|
23
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
Badge,
|
|
24
|
+
ChildNotice,
|
|
25
|
+
Heading,
|
|
26
|
+
Icon,
|
|
27
|
+
Person,
|
|
28
|
+
Switch,
|
|
29
|
+
Text,
|
|
30
|
+
TextButton,
|
|
31
|
+
type TextStyle,
|
|
32
|
+
} from '../components'
|
|
24
33
|
import { useSuspensePaginator, useTheme } from '../hooks'
|
|
25
34
|
import {
|
|
26
35
|
useConversation,
|
|
@@ -30,7 +39,7 @@ import {
|
|
|
30
39
|
useConversationUpdate,
|
|
31
40
|
} from '../hooks/use_conversation'
|
|
32
41
|
import { MemberResource, isDefined } from '../types'
|
|
33
|
-
import {
|
|
42
|
+
import { HeaderTextButton } from '../components/display/platform_modal_header_buttons'
|
|
34
43
|
import { FlashList } from '@shopify/flash-list'
|
|
35
44
|
import { tokens } from '../vendor/tapestry/tokens'
|
|
36
45
|
import { ButtonAppearanceUnion } from '../components/display/utils/button_colors'
|
|
@@ -192,7 +201,7 @@ export function ConversationDetailsScreen({ route }: ConversationDetailsScreenPr
|
|
|
192
201
|
|
|
193
202
|
const HeaderRight = useCallback(() => {
|
|
194
203
|
return (
|
|
195
|
-
<
|
|
204
|
+
<HeaderTextButton
|
|
196
205
|
onPress={() => {
|
|
197
206
|
saveTitle({ title: trimmedTitle || conversation.title })
|
|
198
207
|
navigation.goBack()
|
|
@@ -2,7 +2,7 @@ import React, { useState } from 'react'
|
|
|
2
2
|
import { StyleSheet, View, FlatList, Platform } from 'react-native'
|
|
3
3
|
import { Header, PlatformPressable } from '@react-navigation/elements'
|
|
4
4
|
import { Banner, Icon, Spinner, Text, Heading } from '../../../components'
|
|
5
|
-
import {
|
|
5
|
+
import { HeaderDismissButton } from '../../../components/display/platform_modal_header_buttons'
|
|
6
6
|
import { useTeamPlans } from '../../../hooks/services/use_team_plans'
|
|
7
7
|
import { useTheme } from '../../../hooks'
|
|
8
8
|
import { tokens } from '../../../vendor/tapestry/tokens'
|
|
@@ -192,7 +192,7 @@ export function FilterByPlanModal({
|
|
|
192
192
|
// ==========================================
|
|
193
193
|
|
|
194
194
|
const createStableHeaderRight = (onClose: () => void) => () => (
|
|
195
|
-
<
|
|
195
|
+
<HeaderDismissButton onPress={onClose} title="Cancel" />
|
|
196
196
|
)
|
|
197
197
|
|
|
198
198
|
function OptionItem({ plan, isSelected, onPress }: OptionItemProps) {
|
|
@@ -2,12 +2,13 @@ import { RouteProp, 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 { ConversationsScreenProps } from '../conversations_screen'
|
|
9
9
|
import { ChatGroupBadge } from './chat_group_badge'
|
|
10
10
|
import { Haptic } from '../../../utils/native_adapters'
|
|
11
|
+
import { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../../utils'
|
|
11
12
|
|
|
12
13
|
const ROW_PADDING_HORIZONTAL = 16
|
|
13
14
|
|
|
@@ -63,7 +64,11 @@ export const ListHeaderComponent = () => {
|
|
|
63
64
|
<Heading numberOfLines={1} variant="h2">
|
|
64
65
|
Conversations
|
|
65
66
|
</Heading>
|
|
66
|
-
<TextButton
|
|
67
|
+
<TextButton
|
|
68
|
+
onPress={alertMarkAllRead}
|
|
69
|
+
disabled={isPending}
|
|
70
|
+
maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}
|
|
71
|
+
>
|
|
67
72
|
Mark all read
|
|
68
73
|
</TextButton>
|
|
69
74
|
</View>
|
|
@@ -131,6 +136,8 @@ export const ListHeaderComponent = () => {
|
|
|
131
136
|
|
|
132
137
|
const useStyles = () => {
|
|
133
138
|
const theme = useTheme()
|
|
139
|
+
const atFontScaleBreakpoint = useAtFontScaleBreakpoint()
|
|
140
|
+
|
|
134
141
|
return StyleSheet.create({
|
|
135
142
|
listHeader: {
|
|
136
143
|
borderBottomWidth: 1,
|
|
@@ -139,9 +146,14 @@ const useStyles = () => {
|
|
|
139
146
|
gap: 12,
|
|
140
147
|
},
|
|
141
148
|
titleRow: {
|
|
142
|
-
flexDirection: 'row',
|
|
149
|
+
flexDirection: atFontScaleBreakpoint ? 'column' : 'row',
|
|
143
150
|
justifyContent: 'space-between',
|
|
151
|
+
alignItems: atFontScaleBreakpoint ? 'flex-start' : 'center',
|
|
152
|
+
flexWrap: 'wrap',
|
|
153
|
+
rowGap: 8,
|
|
154
|
+
columnGap: 16,
|
|
144
155
|
paddingTop: 8,
|
|
156
|
+
paddingBottom: atFontScaleBreakpoint ? 8 : 0,
|
|
145
157
|
paddingHorizontal: ROW_PADDING_HORIZONTAL,
|
|
146
158
|
},
|
|
147
159
|
filterRow: {
|
|
@@ -6,7 +6,7 @@ import { ActionButton } from '../../components/display/action_button'
|
|
|
6
6
|
import { ConversationsContextProvider } from '../../contexts/conversations_context'
|
|
7
7
|
import { useCanCreateConversations } from '../../hooks'
|
|
8
8
|
import { GraphId } from '../../types/resources/group_resource'
|
|
9
|
-
import { destructureChatGroupGraphId } from '../../utils'
|
|
9
|
+
import { destructureChatGroupGraphId, MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils'
|
|
10
10
|
import { ListHeaderComponent } from './components/list_header_component'
|
|
11
11
|
import { AppName } from '../../types/resources/app_name'
|
|
12
12
|
|
|
@@ -69,7 +69,11 @@ export function ConversationsScreen({ route }: ConversationsScreenProps) {
|
|
|
69
69
|
onPress={handleNewConversationNavigation}
|
|
70
70
|
buttonIconNameLeft="churchCenter.signups"
|
|
71
71
|
secondaryButton={
|
|
72
|
-
<TextButton
|
|
72
|
+
<TextButton
|
|
73
|
+
variant="tertiary"
|
|
74
|
+
onPress={reportABug}
|
|
75
|
+
maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}
|
|
76
|
+
>
|
|
73
77
|
Report a bug
|
|
74
78
|
</TextButton>
|
|
75
79
|
}
|
package/src/utils/styles.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Platform } from 'react-native'
|
|
|
2
2
|
import { tokens } from '../vendor/tapestry/tokens'
|
|
3
3
|
|
|
4
4
|
export const MAX_FONT_SIZE_MULTIPLIER = 1.5
|
|
5
|
+
export const MAX_FONT_SIZE_MULTIPLIER_LANDMARK = 1.3 // Use in headers, footers, toolbars, etc.
|
|
5
6
|
|
|
6
7
|
export const CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL = 16 // TODO: move to `screens/conversation/utils/styles` when `/screens/conversation` is created
|
|
7
8
|
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { HeaderButtonProps } from '@react-navigation/elements';
|
|
3
|
-
import { TextProps, TextStyle } from 'react-native';
|
|
4
|
-
type HeaderRightButtonProps = HeaderButtonProps & {
|
|
5
|
-
children: TextProps['children'];
|
|
6
|
-
textStyle?: TextStyle;
|
|
7
|
-
};
|
|
8
|
-
export declare const HeaderRightButton: (props: HeaderRightButtonProps) => React.JSX.Element;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=header.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/navigation/header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAgB,iBAAiB,EAAQ,MAAM,4BAA4B,CAAA;AAClF,OAAO,EAAc,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE/D,KAAK,sBAAsB,GAAG,iBAAiB,GAAG;IAChD,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,CAAA;IAC/B,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,iBAAiB,UAAW,sBAAsB,sBAc9D,CAAA"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { HeaderButton, Text } from '@react-navigation/elements';
|
|
3
|
-
import { StyleSheet } from 'react-native';
|
|
4
|
-
export const HeaderRightButton = (props) => {
|
|
5
|
-
const styles = StyleSheet.create({
|
|
6
|
-
text: {
|
|
7
|
-
fontSize: 16,
|
|
8
|
-
},
|
|
9
|
-
});
|
|
10
|
-
return (<HeaderButton {...props} style={props.style}>
|
|
11
|
-
<Text style={[styles.text, props.textStyle]} numberOfLines={1}>
|
|
12
|
-
{props.children}
|
|
13
|
-
</Text>
|
|
14
|
-
</HeaderButton>);
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=header.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"header.js","sourceRoot":"","sources":["../../src/navigation/header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,YAAY,EAAqB,IAAI,EAAE,MAAM,4BAA4B,CAAA;AAClF,OAAO,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAA;AAO/D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAA6B,EAAE,EAAE;IACjE,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAC/B,IAAI,EAAE;YACJ,QAAQ,EAAE,EAAE;SACb;KACF,CAAC,CAAA;IAEF,OAAO,CACL,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAC1C;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAC5D;QAAA,CAAC,KAAK,CAAC,QAAQ,CACjB;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,YAAY,CAAC,CAChB,CAAA;AACH,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { HeaderButton, HeaderButtonProps, Text } from '@react-navigation/elements'\nimport { StyleSheet, TextProps, TextStyle } from 'react-native'\n\ntype HeaderRightButtonProps = HeaderButtonProps & {\n children: TextProps['children']\n textStyle?: TextStyle\n}\n\nexport const HeaderRightButton = (props: HeaderRightButtonProps) => {\n const styles = StyleSheet.create({\n text: {\n fontSize: 16,\n },\n })\n\n return (\n <HeaderButton {...props} style={props.style}>\n <Text style={[styles.text, props.textStyle]} numberOfLines={1}>\n {props.children}\n </Text>\n </HeaderButton>\n )\n}\n"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { HeaderButton, HeaderButtonProps, Text } from '@react-navigation/elements'
|
|
3
|
-
import { StyleSheet, TextProps, TextStyle } from 'react-native'
|
|
4
|
-
|
|
5
|
-
type HeaderRightButtonProps = HeaderButtonProps & {
|
|
6
|
-
children: TextProps['children']
|
|
7
|
-
textStyle?: TextStyle
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const HeaderRightButton = (props: HeaderRightButtonProps) => {
|
|
11
|
-
const styles = StyleSheet.create({
|
|
12
|
-
text: {
|
|
13
|
-
fontSize: 16,
|
|
14
|
-
},
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<HeaderButton {...props} style={props.style}>
|
|
19
|
-
<Text style={[styles.text, props.textStyle]} numberOfLines={1}>
|
|
20
|
-
{props.children}
|
|
21
|
-
</Text>
|
|
22
|
-
</HeaderButton>
|
|
23
|
-
)
|
|
24
|
-
}
|