@planningcenter/chat-react-native 3.24.0 → 3.24.1-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/assets/chatLogo.png +0 -0
- package/assets/churchCenter.png +0 -0
- package/assets/servicesApp.png +0 -0
- package/build/screens/preferred_app_selection_screen.d.ts.map +1 -1
- package/build/screens/preferred_app_selection_screen.js +3 -6
- package/build/screens/preferred_app_selection_screen.js.map +1 -1
- package/package.json +4 -3
- package/src/screens/preferred_app_selection_screen.tsx +3 -6
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferred_app_selection_screen.d.ts","sourceRoot":"","sources":["../../src/screens/preferred_app_selection_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAE5D,OAAO,KAAiC,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"preferred_app_selection_screen.d.ts","sourceRoot":"","sources":["../../src/screens/preferred_app_selection_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAE5D,OAAO,KAAiC,MAAM,OAAO,CAAA;AAIrD,OAAO,EAAE,YAAY,EAAgB,MAAM,sCAAsC,CAAA;AAIjF,MAAM,MAAM,gCAAgC,GAAG,iBAAiB,CAAC;IAC/D,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACnC,gBAAgB,CAAC,EAAE,YAAY,CAAA;CAChC,CAAC,CAAA;AAEF,wBAAgB,2BAA2B,CAAC,EAAE,KAAK,EAAE,EAAE,gCAAgC,qBAkDtF"}
|
|
@@ -2,9 +2,6 @@ import { PlatformPressable } from '@react-navigation/elements';
|
|
|
2
2
|
import { useMutation } from '@tanstack/react-query';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Image, StyleSheet, View } from 'react-native';
|
|
5
|
-
import churchCenterLogo from '../../assets/churchCenter.png';
|
|
6
|
-
import servicesLogo from '../../assets/servicesApp.png';
|
|
7
|
-
import chatLogo from '../../assets/chatLogo.png';
|
|
8
5
|
import { Heading, Icon, Text } from '../components';
|
|
9
6
|
import { useApiClient, useTheme } from '../hooks';
|
|
10
7
|
import { useChatTypes } from './preferred_app/hooks/use_chat_types';
|
|
@@ -60,11 +57,11 @@ const sortPreferredApp = (dir) => (a, b) => {
|
|
|
60
57
|
const getAppImage = (option) => {
|
|
61
58
|
switch (option) {
|
|
62
59
|
case 'Church Center':
|
|
63
|
-
return
|
|
60
|
+
return require('../../assets/churchCenter.png');
|
|
64
61
|
case 'Services':
|
|
65
|
-
return
|
|
62
|
+
return require('../../assets/servicesApp.png');
|
|
66
63
|
case 'Chat':
|
|
67
|
-
return chatLogo;
|
|
64
|
+
return require('../../assets/chatLogo.png');
|
|
68
65
|
default:
|
|
69
66
|
return undefined;
|
|
70
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferred_app_selection_screen.js","sourceRoot":"","sources":["../../src/screens/preferred_app_selection_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAiC,MAAM,OAAO,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAA;AACtE,OAAO,
|
|
1
|
+
{"version":3,"file":"preferred_app_selection_screen.js","sourceRoot":"","sources":["../../src/screens/preferred_app_selection_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAiC,MAAM,OAAO,CAAA;AACrD,OAA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EAAE;YACnB,YAAY,EAAE,EAAE;SACjB;QACD,QAAQ,EAAE;YACR,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,EAAE;YACP,UAAU,EAAE,CAAC;SACd;QACD,YAAY,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,iBAAiB;YACrC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC1B;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StaticScreenProps } from '@react-navigation/native'\nimport { useMutation } from '@tanstack/react-query'\nimport React, { type PropsWithChildren } from 'react'\nimport { Image, StyleSheet, View, type ViewStyle } from 'react-native'\nimport { Heading, Icon, Text } from '../components'\nimport { useApiClient, useTheme } from '../hooks'\nimport { PreferredApp, useChatTypes } from './preferred_app/hooks/use_chat_types'\nimport { useAppName } from '../hooks/use_app_name'\nimport { throwResponseError } from '../utils/response_error'\n\nexport type PreferredAppSelectionScreenProps = StaticScreenProps<{\n chatTypeId: number | string\n conversationType?: 'group' | 'team'\n currentSelection?: PreferredApp\n}>\n\nexport function PreferredAppSelectionScreen({ route }: PreferredAppSelectionScreenProps) {\n const { chatTypeId } = route.params\n const { data: chatTypes, refetch: refetchChatTypes } = useChatTypes()\n const appName = useAppName()\n\n const apiClient = useApiClient()\n\n const { mutate: updateChatType } = useMutation({\n throwOnError: true,\n onSuccess: () => refetchChatTypes(),\n mutationFn: (app: PreferredApp) => {\n return apiClient.chat\n .post({\n url: `/me/chat_types/${chatTypeId}/set_preferred_app`,\n data: { data: { type: 'ChatType', attributes: { app } } },\n })\n .catch(throwResponseError)\n },\n })\n const chatType = chatTypes.find(t => t.id === chatTypeId)\n const { preferredAppOptions } = chatType || {}\n\n const handleSelection = (app: PreferredApp) => {\n updateChatType(app)\n }\n\n const sectionTitle = `${chatType?.title} Conversations`\n\n return (\n <View style={styles.container}>\n <View style={styles.section}>\n <Heading variant=\"h3\" style={styles.sectionHeading}>\n {sectionTitle}\n </Heading>\n {preferredAppOptions?.sort(sortPreferredApp('asc')).map((option, key) => (\n <PressableRow\n key={`${key}-${option}`}\n isActive={chatType?.preferredApp === option}\n onPress={() => handleSelection(option)}\n >\n <Image source={getAppImage(option)} style={styles.logo} />\n <Text>\n {option}\n {appName.includes(option.replace(/\\s/, '').toLowerCase()) ? ' ( current )' : ''}\n </Text>\n </PressableRow>\n ))}\n </View>\n </View>\n )\n}\n\nconst sortPreferredApp = (dir?: 'asc' | 'desc') => (a: PreferredApp, b: PreferredApp) => {\n if (a === 'None') return 1\n if (a > b) return dir === 'asc' ? 1 : -1\n if (b > a) return dir === 'asc' ? -1 : 1\n\n return 0\n}\n\nconst getAppImage = (option: PreferredApp) => {\n switch (option) {\n case 'Church Center':\n return require('../../assets/churchCenter.png')\n case 'Services':\n return require('../../assets/servicesApp.png')\n case 'Chat':\n return require('../../assets/chatLogo.png')\n default:\n return undefined\n }\n}\n\nconst PressableRow = ({\n children,\n isActive,\n onPress,\n style,\n}: PropsWithChildren<{ isActive: boolean; onPress: () => void; style?: ViewStyle }>) => {\n const styles = useRowStyles({ isActive })\n return (\n <PlatformPressable\n style={styles.pressable}\n onPress={onPress}\n accessibilityRole=\"radio\"\n accessibilityState={{ selected: isActive }}\n >\n <View style={styles.row}>\n <View style={[styles.rowInner, style]}>{children}</View>\n <Icon\n name=\"general.check\"\n style={styles.rowIconRight}\n accessibilityElementsHidden\n maxFontSizeMultiplier={2.5}\n />\n </View>\n </PlatformPressable>\n )\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n section: {\n paddingTop: 16,\n },\n sectionHeading: {\n paddingHorizontal: 16,\n paddingBottom: 4,\n },\n logo: {\n width: 32,\n height: 32,\n borderRadius: 8,\n },\n})\n\nconst useRowStyles = ({ isActive = false }: { isActive?: boolean } = {}) => {\n const theme = useTheme()\n\n return StyleSheet.create({\n pressable: {\n paddingLeft: 16,\n backgroundColor: theme.colors.surfaceColor100,\n },\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 12,\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.borderColorDefaultBase,\n paddingVertical: 12,\n paddingRight: 16,\n },\n rowInner: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n flexShrink: 1,\n },\n rowIconRight: {\n fontSize: 16,\n color: theme.colors.statusSuccessIcon,\n opacity: isActive ? 1 : 0,\n },\n })\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/chat-react-native",
|
|
3
|
-
"version": "3.24.0",
|
|
3
|
+
"version": "3.24.1-rc.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"build",
|
|
9
|
-
"src"
|
|
9
|
+
"src",
|
|
10
|
+
"assets"
|
|
10
11
|
],
|
|
11
12
|
"sideEffects": false,
|
|
12
13
|
"scripts": {
|
|
@@ -58,5 +59,5 @@
|
|
|
58
59
|
"react-native-url-polyfill": "^2.0.0",
|
|
59
60
|
"typescript": "<5.6.0"
|
|
60
61
|
},
|
|
61
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "beb84de7b8a12103cb6634fa27f0c7a036f2a67e"
|
|
62
63
|
}
|
|
@@ -3,9 +3,6 @@ import { StaticScreenProps } from '@react-navigation/native'
|
|
|
3
3
|
import { useMutation } from '@tanstack/react-query'
|
|
4
4
|
import React, { type PropsWithChildren } from 'react'
|
|
5
5
|
import { Image, StyleSheet, View, type ViewStyle } from 'react-native'
|
|
6
|
-
import churchCenterLogo from '../../assets/churchCenter.png'
|
|
7
|
-
import servicesLogo from '../../assets/servicesApp.png'
|
|
8
|
-
import chatLogo from '../../assets/chatLogo.png'
|
|
9
6
|
import { Heading, Icon, Text } from '../components'
|
|
10
7
|
import { useApiClient, useTheme } from '../hooks'
|
|
11
8
|
import { PreferredApp, useChatTypes } from './preferred_app/hooks/use_chat_types'
|
|
@@ -81,11 +78,11 @@ const sortPreferredApp = (dir?: 'asc' | 'desc') => (a: PreferredApp, b: Preferre
|
|
|
81
78
|
const getAppImage = (option: PreferredApp) => {
|
|
82
79
|
switch (option) {
|
|
83
80
|
case 'Church Center':
|
|
84
|
-
return
|
|
81
|
+
return require('../../assets/churchCenter.png')
|
|
85
82
|
case 'Services':
|
|
86
|
-
return
|
|
83
|
+
return require('../../assets/servicesApp.png')
|
|
87
84
|
case 'Chat':
|
|
88
|
-
return chatLogo
|
|
85
|
+
return require('../../assets/chatLogo.png')
|
|
89
86
|
default:
|
|
90
87
|
return undefined
|
|
91
88
|
}
|