@planningcenter/chat-react-native 3.14.0-rc.5 → 3.14.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/display/action_button.d.ts.map +1 -1
- package/build/components/display/action_button.js +2 -1
- 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/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 +2 -1
- 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/display/action_button.tsx +2 -0
- 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/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 +6 -1
- 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
|
@@ -8,7 +8,11 @@ import {
|
|
|
8
8
|
useCreateAndroidRippleColor,
|
|
9
9
|
useInteractionGhostBackgroundColor,
|
|
10
10
|
} from '../../hooks'
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
MAX_FONT_SIZE_MULTIPLIER_LANDMARK,
|
|
13
|
+
platformFontWeightBold,
|
|
14
|
+
platformPressedOpacityStyle,
|
|
15
|
+
} from '../../utils'
|
|
12
16
|
import { Icon, IconString } from './icon'
|
|
13
17
|
import { tokens } from '../../vendor/tapestry/tokens'
|
|
14
18
|
import { Haptic } from '../../utils/native_adapters/configuration'
|
|
@@ -66,7 +70,7 @@ export function ToggleButton({
|
|
|
66
70
|
allowFontScaling = true,
|
|
67
71
|
iconNameLeft,
|
|
68
72
|
iconNameRight,
|
|
69
|
-
maxFontSizeMultiplier,
|
|
73
|
+
maxFontSizeMultiplier = MAX_FONT_SIZE_MULTIPLIER_LANDMARK,
|
|
70
74
|
minimumFontScale,
|
|
71
75
|
title,
|
|
72
76
|
style,
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { useNavigation } from '@react-navigation/native'
|
|
2
2
|
import { useQueryErrorResetBoundary } from '@tanstack/react-query'
|
|
3
3
|
import React, { PropsWithChildren, useEffect, useMemo } from 'react'
|
|
4
|
-
import { StyleSheet, View } from 'react-native'
|
|
5
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
6
|
-
import { Button, Heading, Icon, Text, TextButton } from '../display'
|
|
7
|
-
import { useTheme } from '../../hooks'
|
|
8
4
|
import { ResponseError } from '../../utils/response_error'
|
|
5
|
+
import BlankState from '../primitive/blank_state_primitive'
|
|
9
6
|
|
|
10
7
|
type ErrorBoundaryState = {
|
|
11
8
|
error: ResponseError | Error | TypeError | null
|
|
@@ -108,54 +105,26 @@ function ResponseErrorView({ response }: { response: Response; onReset: () => vo
|
|
|
108
105
|
}
|
|
109
106
|
|
|
110
107
|
function ErrorContent({ heading, body }: { heading: string; body: string }) {
|
|
111
|
-
const styles = useStyles()
|
|
112
108
|
const navigation = useNavigation()
|
|
113
109
|
|
|
114
110
|
return (
|
|
115
|
-
<
|
|
116
|
-
<
|
|
117
|
-
<
|
|
118
|
-
<Heading
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
111
|
+
<BlankState.Root>
|
|
112
|
+
<BlankState.Imagery name="people.noTextMessage" />
|
|
113
|
+
<BlankState.Content>
|
|
114
|
+
<BlankState.Heading>{heading}</BlankState.Heading>
|
|
115
|
+
<BlankState.Text>{body}</BlankState.Text>
|
|
116
|
+
</BlankState.Content>
|
|
117
|
+
<BlankState.Button
|
|
118
|
+
title="Go back"
|
|
119
|
+
onPress={navigation.goBack}
|
|
120
|
+
size="md"
|
|
121
|
+
accessibilityRole="link"
|
|
122
|
+
/>
|
|
123
|
+
<BlankState.TextButton onPress={() => navigation.navigate('BugReport')}>
|
|
125
124
|
Report a bug
|
|
126
|
-
</TextButton>
|
|
127
|
-
</
|
|
125
|
+
</BlankState.TextButton>
|
|
126
|
+
</BlankState.Root>
|
|
128
127
|
)
|
|
129
128
|
}
|
|
130
129
|
|
|
131
|
-
const useStyles = () => {
|
|
132
|
-
const theme = useTheme()
|
|
133
|
-
const { bottom } = useSafeAreaInsets()
|
|
134
|
-
return StyleSheet.create({
|
|
135
|
-
container: {
|
|
136
|
-
flex: 1,
|
|
137
|
-
justifyContent: 'center',
|
|
138
|
-
alignItems: 'center',
|
|
139
|
-
gap: 24,
|
|
140
|
-
paddingHorizontal: 16,
|
|
141
|
-
paddingBottom: bottom,
|
|
142
|
-
},
|
|
143
|
-
information: {
|
|
144
|
-
alignItems: 'center',
|
|
145
|
-
gap: 8,
|
|
146
|
-
},
|
|
147
|
-
heading: {
|
|
148
|
-
textAlign: 'center',
|
|
149
|
-
lineHeight: 20,
|
|
150
|
-
},
|
|
151
|
-
body: {
|
|
152
|
-
textAlign: 'center',
|
|
153
|
-
lineHeight: 20,
|
|
154
|
-
},
|
|
155
|
-
icon: {
|
|
156
|
-
color: theme.colors.iconColorDefaultDisabled,
|
|
157
|
-
},
|
|
158
|
-
})
|
|
159
|
-
}
|
|
160
|
-
|
|
161
130
|
export default ErrorBoundary
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { createContext, useContext, useEffect, useState } from 'react'
|
|
2
2
|
import { StyleSheet, View, ViewProps } from 'react-native'
|
|
3
|
-
import { useTheme } from '../../hooks'
|
|
3
|
+
import { useFontScale, useTheme } from '../../hooks'
|
|
4
4
|
import { Icon, IconString } from '../display/icon'
|
|
5
5
|
import { Image, ImageProps } from '../display/image'
|
|
6
6
|
import { Spinner } from '../display/spinner'
|
|
7
|
+
import { MAX_FONT_SIZE_MULTIPLIER } from '../../utils'
|
|
7
8
|
|
|
8
9
|
// =================================
|
|
9
10
|
// ====== Exports ==================
|
|
@@ -146,8 +147,10 @@ interface AvatarImageProps extends Omit<ImageProps, 'source' | 'alt'> {
|
|
|
146
147
|
|
|
147
148
|
function AvatarImage({ sourceUri, ...props }: AvatarImageProps) {
|
|
148
149
|
const { size } = useAvatarContext()
|
|
150
|
+
const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER })
|
|
151
|
+
const scaledAvatarSize = AVATAR_PX[size] * fontScale
|
|
149
152
|
|
|
150
|
-
return <Image source={{ uri: sourceUri }} loaderSize={
|
|
153
|
+
return <Image source={{ uri: sourceUri }} loaderSize={scaledAvatarSize} {...props} alt="" />
|
|
151
154
|
}
|
|
152
155
|
|
|
153
156
|
AvatarImage.displayName = 'Avatar.Image'
|
|
@@ -171,12 +174,14 @@ interface AvatarImageFallbackProps {
|
|
|
171
174
|
function AvatarImageFallback({ name = 'general.person' }: AvatarImageFallbackProps) {
|
|
172
175
|
const { size } = useAvatarContext()
|
|
173
176
|
const styles = useStyles()
|
|
177
|
+
const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER })
|
|
178
|
+
const scaledIconSize = AVATAR_FALLBACK_ICON_PX[size] * fontScale
|
|
174
179
|
|
|
175
180
|
return (
|
|
176
181
|
<View style={styles.fallbackContainer}>
|
|
177
182
|
<Icon
|
|
178
183
|
name={name}
|
|
179
|
-
size={
|
|
184
|
+
size={scaledIconSize}
|
|
180
185
|
style={styles.fallbackIcon}
|
|
181
186
|
accessibilityElementsHidden={true}
|
|
182
187
|
/>
|
|
@@ -309,12 +314,14 @@ AvatarGroup.displayName = 'Avatar.Group'
|
|
|
309
314
|
function AvatarGroupLoader() {
|
|
310
315
|
const { size, allImagesLoaded } = useAvatarContext()
|
|
311
316
|
const styles = useStyles({ size })
|
|
317
|
+
const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER })
|
|
318
|
+
const scaledSpinnerSize = AVATAR_PX[size] * fontScale
|
|
312
319
|
|
|
313
320
|
if (allImagesLoaded) return null
|
|
314
321
|
|
|
315
322
|
return (
|
|
316
323
|
<View style={styles.groupLoader}>
|
|
317
|
-
<Spinner size={
|
|
324
|
+
<Spinner size={scaledSpinnerSize} />
|
|
318
325
|
</View>
|
|
319
326
|
)
|
|
320
327
|
}
|
|
@@ -349,12 +356,13 @@ interface Styles {
|
|
|
349
356
|
|
|
350
357
|
const useStyles = ({ size = 'md', presence = 'offline' }: Styles = {}) => {
|
|
351
358
|
const { colors } = useTheme()
|
|
359
|
+
const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER })
|
|
352
360
|
const PRESENCE_COLOR = {
|
|
353
361
|
online: colors.fillColorInteractionOnlineDefault,
|
|
354
362
|
offline: colors.iconColorDefaultDisabled,
|
|
355
363
|
}
|
|
356
|
-
const presenceDiameter = AVATAR_PRESENCE_PX[size]
|
|
357
|
-
const avatarDiameter = AVATAR_PX[size]
|
|
364
|
+
const presenceDiameter = AVATAR_PRESENCE_PX[size] * fontScale
|
|
365
|
+
const avatarDiameter = AVATAR_PX[size] * fontScale
|
|
358
366
|
const groupGap = 1
|
|
359
367
|
|
|
360
368
|
return StyleSheet.create({
|
|
@@ -5,11 +5,13 @@ import {
|
|
|
5
5
|
Button,
|
|
6
6
|
Heading,
|
|
7
7
|
Icon,
|
|
8
|
+
TextButton,
|
|
8
9
|
Text,
|
|
9
10
|
type ButtonProps,
|
|
10
11
|
type HeadingProps,
|
|
11
12
|
type IconString,
|
|
12
13
|
type IconStyle,
|
|
14
|
+
type TextButtonProps,
|
|
13
15
|
type TextProps,
|
|
14
16
|
} from '../display'
|
|
15
17
|
|
|
@@ -24,6 +26,7 @@ const BlankState = {
|
|
|
24
26
|
Heading: BlankStateHeading,
|
|
25
27
|
Text: BlankStateText,
|
|
26
28
|
Button: BlankStateButton,
|
|
29
|
+
TextButton: BlankStateTextButton,
|
|
27
30
|
} as const
|
|
28
31
|
|
|
29
32
|
type BlankStateComponents = {
|
|
@@ -33,6 +36,7 @@ type BlankStateComponents = {
|
|
|
33
36
|
Heading: FC<BlankStateHeadingProps>
|
|
34
37
|
Text: FC<BlankStateTextProps>
|
|
35
38
|
Button: FC<BlankStateButtonProps>
|
|
39
|
+
TextButton: FC<BlankStateTextButtonProps>
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
export default BlankState as BlankStateComponents
|
|
@@ -43,6 +47,7 @@ export type {
|
|
|
43
47
|
BlankStateHeadingProps,
|
|
44
48
|
BlankStateTextProps,
|
|
45
49
|
BlankStateButtonProps,
|
|
50
|
+
BlankStateTextButtonProps,
|
|
46
51
|
}
|
|
47
52
|
|
|
48
53
|
// ========================================
|
|
@@ -159,6 +164,18 @@ function BlankStateButton(props: BlankStateButtonProps) {
|
|
|
159
164
|
|
|
160
165
|
BlankStateButton.displayName = 'BlankState.Button'
|
|
161
166
|
|
|
167
|
+
// ========================================
|
|
168
|
+
// ====== BlankStateTextButton ================
|
|
169
|
+
// ========================================
|
|
170
|
+
|
|
171
|
+
interface BlankStateTextButtonProps extends TextButtonProps {}
|
|
172
|
+
|
|
173
|
+
function BlankStateTextButton(props: BlankStateTextButtonProps) {
|
|
174
|
+
return <TextButton variant="tertiary" {...props} />
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
BlankStateTextButton.displayName = 'BlankState.TextButton'
|
|
178
|
+
|
|
162
179
|
// ========================================
|
|
163
180
|
// ====== Styles ==========================
|
|
164
181
|
// ========================================
|
package/src/navigation/index.tsx
CHANGED
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
MessageReadReceiptsScreenOptions,
|
|
43
43
|
} from '../screens/conversation/message_read_receipts_screen'
|
|
44
44
|
import { Platform } from 'react-native'
|
|
45
|
-
import {
|
|
45
|
+
import { HeaderTextButton } from '../components/display/platform_modal_header_buttons'
|
|
46
46
|
import { TeamConversationScreen } from '../screens/team_conversation_screen'
|
|
47
47
|
import { CardStyleInterpolators } from '@react-navigation/stack'
|
|
48
48
|
|
|
@@ -63,7 +63,7 @@ export const NewConversationStack = createNativeStackNavigator({
|
|
|
63
63
|
options: ({ navigation }) => ({
|
|
64
64
|
title: 'New conversation',
|
|
65
65
|
headerRight: (props: NativeStackHeaderRightProps) => (
|
|
66
|
-
<
|
|
66
|
+
<HeaderTextButton {...props} onPress={navigation.goBack} title="Cancel" />
|
|
67
67
|
),
|
|
68
68
|
headerBackVisible: false,
|
|
69
69
|
}),
|
|
@@ -73,7 +73,7 @@ export const NewConversationStack = createNativeStackNavigator({
|
|
|
73
73
|
options: ({ navigation, route }) => ({
|
|
74
74
|
title: 'New conversation',
|
|
75
75
|
headerRight: (props: NativeStackHeaderRightProps) => (
|
|
76
|
-
<
|
|
76
|
+
<HeaderTextButton
|
|
77
77
|
{...props}
|
|
78
78
|
onPress={() => navigation.popTo('Conversations', route.params)}
|
|
79
79
|
title="Cancel"
|
|
@@ -86,7 +86,7 @@ export const NewConversationStack = createNativeStackNavigator({
|
|
|
86
86
|
options: ({ navigation, route }) => ({
|
|
87
87
|
title: 'New conversation',
|
|
88
88
|
headerRight: (props: NativeStackHeaderRightProps) => (
|
|
89
|
-
<
|
|
89
|
+
<HeaderTextButton
|
|
90
90
|
{...props}
|
|
91
91
|
onPress={() => navigation.popTo('Conversations', route.params)}
|
|
92
92
|
title="Cancel"
|
|
@@ -104,7 +104,7 @@ export const NewConversationStack = createNativeStackNavigator({
|
|
|
104
104
|
title: 'New conversation',
|
|
105
105
|
headerLeft: () => null,
|
|
106
106
|
headerRight: (props: NativeStackHeaderRightProps) => (
|
|
107
|
-
<
|
|
107
|
+
<HeaderTextButton
|
|
108
108
|
{...props}
|
|
109
109
|
onPress={() => navigation.getParent()?.goBack()}
|
|
110
110
|
title="Cancel"
|
|
@@ -195,7 +195,7 @@ export const ChatStack = createNativeStackNavigator({
|
|
|
195
195
|
presentation: 'modal',
|
|
196
196
|
title: 'Conversation details',
|
|
197
197
|
headerRight: (props: NativeStackHeaderRightProps) => (
|
|
198
|
-
<
|
|
198
|
+
<HeaderTextButton {...props} onPress={navigation.goBack} title="Done" />
|
|
199
199
|
),
|
|
200
200
|
}),
|
|
201
201
|
},
|
|
@@ -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) {
|
|
@@ -8,6 +8,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>
|
|
@@ -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
|
-
}
|