@planningcenter/chat-react-native 3.42.3-qa-staging.4 → 3.42.3-qa-staging.6
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 +1 -1
- package/build/components/display/action_button.d.ts.map +1 -1
- package/build/components/display/action_button.js +3 -13
- package/build/components/display/action_button.js.map +1 -1
- package/build/screens/conversation_filters/components/rows.js +1 -1
- package/build/screens/conversation_filters/components/rows.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.js +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/restricted_group_row.js +1 -1
- package/build/screens/conversation_select_recipients/components/restricted_group_row.js.map +1 -1
- package/package.json +3 -3
- package/src/components/display/action_button.tsx +48 -45
- package/src/screens/conversation_filters/components/rows.tsx +2 -2
- package/src/screens/conversation_select_recipients/components/groups_recipient_row.tsx +1 -1
- package/src/screens/conversation_select_recipients/components/restricted_group_row.tsx +2 -2
|
@@ -11,5 +11,5 @@ export declare const ActionButton: ({ visible, disabled, onPress, title, infoTex
|
|
|
11
11
|
secondaryButton?: React.ReactNode;
|
|
12
12
|
loading?: boolean;
|
|
13
13
|
warnings?: ConversationWarning[];
|
|
14
|
-
}) => import("react/jsx-runtime").JSX.Element
|
|
14
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
//# sourceMappingURL=action_button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action_button.d.ts","sourceRoot":"","sources":["../../../src/components/display/action_button.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"action_button.d.ts","sourceRoot":"","sources":["../../../src/components/display/action_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAIjD,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAGnC,eAAO,MAAM,YAAY,GAAI,0GAU1B;IACD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kBAAkB,CAAC,EAAE,UAAU,CAAA;IAC/B,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACjC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAA;CACjC,4CA+CA,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Animated, LayoutAnimation, StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
2
|
+
import { StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
3
|
+
import Animated, { FadeIn, FadeOut, LayoutAnimationConfig, ReduceMotion, } from 'react-native-reanimated';
|
|
5
4
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
5
|
import { useTheme } from '../../hooks';
|
|
7
6
|
import { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils';
|
|
@@ -10,16 +9,7 @@ import { Button } from './button';
|
|
|
10
9
|
import { Text } from './text';
|
|
11
10
|
export const ActionButton = ({ visible = true, disabled = false, onPress, title, infoText, buttonIconNameLeft, secondaryButton, loading = false, warnings = [], }) => {
|
|
12
11
|
const styles = useStyles();
|
|
13
|
-
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (show === visible)
|
|
16
|
-
return;
|
|
17
|
-
setShow(visible);
|
|
18
|
-
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
19
|
-
}, [show, visible]);
|
|
20
|
-
if (!visible)
|
|
21
|
-
return null;
|
|
22
|
-
return (_jsxs(Animated.View, { style: styles.container, children: [warnings.length > 0 && (_jsx(View, { style: styles.warnings, children: warnings.map((warning, index) => (_jsx(Banner, { appearance: "error", description: warning.fullMessage }, `${warning.attribute}-${index}`))) })), Boolean(infoText) && (_jsx(Text, { style: styles.infoText, variant: "footnote", children: infoText })), _jsxs(View, { style: styles.buttonRow, children: [secondaryButton, _jsx(Button, { variant: "fill", size: "lg", onPress: onPress, title: title, disabled: disabled, style: secondaryButton ? null : styles.fullWidthButton, iconNameLeft: buttonIconNameLeft, loading: loading, maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER_LANDMARK, accessibilityShowsLargeContentViewer: true, accessibilityLargeContentTitle: title })] })] }));
|
|
12
|
+
return (_jsx(LayoutAnimationConfig, { skipEntering: true, children: visible && (_jsxs(Animated.View, { entering: FadeIn.duration(300).reduceMotion(ReduceMotion.System), exiting: FadeOut.duration(300).reduceMotion(ReduceMotion.System), style: styles.container, children: [warnings.length > 0 && (_jsx(View, { style: styles.warnings, children: warnings.map((warning, index) => (_jsx(Banner, { appearance: "error", description: warning.fullMessage }, `${warning.attribute}-${index}`))) })), Boolean(infoText) && (_jsx(Text, { style: styles.infoText, variant: "footnote", children: infoText })), _jsxs(View, { style: styles.buttonRow, children: [secondaryButton, _jsx(Button, { variant: "fill", size: "lg", onPress: onPress, title: title, disabled: disabled, style: secondaryButton ? null : styles.fullWidthButton, iconNameLeft: buttonIconNameLeft, loading: loading, maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER_LANDMARK, accessibilityShowsLargeContentViewer: true, accessibilityLargeContentTitle: title })] })] })) }));
|
|
23
13
|
};
|
|
24
14
|
const useStyles = () => {
|
|
25
15
|
const { fontScale } = useWindowDimensions();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action_button.js","sourceRoot":"","sources":["../../../src/components/display/action_button.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"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GAAG,wBAAwB;YAChD,cAAc,EAAE,CAAC;YACjB,cAAc,EAAE,MAAM,CAAC,qBAAqB;YAC5C,GAAG,EAAE,EAAE;SACR;QACD,SAAS,EAAE;YACT,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe;YAC1D,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,EAAE;YACP,QAAQ,EAAE,cAAc;SACzB;QACD,eAAe,EAAE;YACf,QAAQ,EAAE,CAAC;SACZ;QACD,QAAQ,EAAE;YACR,SAAS,EAAE,QAAQ;SACpB;QACD,QAAQ,EAAE;YACR,GAAG,EAAE,CAAC;SACP;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { StyleSheet, useWindowDimensions, View } from 'react-native'\nimport Animated, {\n FadeIn,\n FadeOut,\n LayoutAnimationConfig,\n ReduceMotion,\n} from 'react-native-reanimated'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { useTheme } from '../../hooks'\nimport { ConversationWarning } from '../../types'\nimport { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils'\nimport { Banner } from './banner'\nimport { Button } from './button'\nimport { IconString } from './icon'\nimport { Text } from './text'\n\nexport const ActionButton = ({\n visible = true,\n disabled = false,\n onPress,\n title,\n infoText,\n buttonIconNameLeft,\n secondaryButton,\n loading = false,\n warnings = [],\n}: {\n visible?: boolean\n disabled?: boolean\n onPress: () => void\n title: string\n infoText?: string\n buttonIconNameLeft?: IconString\n secondaryButton?: React.ReactNode\n loading?: boolean\n warnings?: ConversationWarning[]\n}) => {\n const styles = useStyles()\n\n return (\n <LayoutAnimationConfig skipEntering>\n {visible && (\n <Animated.View\n entering={FadeIn.duration(300).reduceMotion(ReduceMotion.System)}\n exiting={FadeOut.duration(300).reduceMotion(ReduceMotion.System)}\n style={styles.container}\n >\n {warnings.length > 0 && (\n <View style={styles.warnings}>\n {warnings.map((warning, index) => (\n <Banner\n key={`${warning.attribute}-${index}`}\n appearance=\"error\"\n description={warning.fullMessage}\n />\n ))}\n </View>\n )}\n {Boolean(infoText) && (\n <Text style={styles.infoText} variant=\"footnote\">\n {infoText}\n </Text>\n )}\n <View style={styles.buttonRow}>\n {secondaryButton}\n <Button\n variant=\"fill\"\n size=\"lg\"\n onPress={onPress}\n title={title}\n disabled={disabled}\n style={secondaryButton ? null : styles.fullWidthButton}\n iconNameLeft={buttonIconNameLeft}\n loading={loading}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n accessibilityShowsLargeContentViewer\n accessibilityLargeContentTitle={title}\n />\n </View>\n </Animated.View>\n )}\n </LayoutAnimationConfig>\n )\n}\n\nconst useStyles = () => {\n const { fontScale } = useWindowDimensions()\n const { bottom } = useSafeAreaInsets()\n const { colors } = useTheme()\n const containerVerticalPadding = 16\n\n return StyleSheet.create({\n container: {\n backgroundColor: colors.surfaceColor090,\n paddingHorizontal: 24,\n paddingTop: containerVerticalPadding,\n paddingBottom: bottom + containerVerticalPadding,\n borderTopWidth: 1,\n borderTopColor: colors.borderColorDefaultDim,\n gap: 16,\n },\n buttonRow: {\n flexDirection: 'row',\n justifyContent: fontScale > 1 ? 'center' : 'space-between',\n alignItems: 'center',\n gap: 16,\n flexWrap: 'wrap-reverse',\n },\n fullWidthButton: {\n flexGrow: 1,\n },\n infoText: {\n textAlign: 'center',\n },\n warnings: {\n gap: 8,\n },\n })\n}\n"]}
|
|
@@ -19,7 +19,7 @@ export const GroupRow = ({ group, isActive }) => {
|
|
|
19
19
|
setGroupFilter({ chat_group_graph_id: group.id });
|
|
20
20
|
};
|
|
21
21
|
const { headerImage, membershipsCount } = group;
|
|
22
|
-
return (_jsxs(PressableRow, { onPress: handleFilterByGroup, isActive: isActive, children: [headerImage?.
|
|
22
|
+
return (_jsxs(PressableRow, { onPress: handleFilterByGroup, isActive: isActive, children: [headerImage?.medium && (_jsx(Image, { source: { uri: headerImage?.medium }, resizeMode: "cover", style: styles.rowImage, alt: "" })), _jsxs(View, { style: styles.rowTextContainer, children: [_jsx(Heading, { variant: "h3", style: styles.rowTitle, children: group.name }), membershipsCount && (_jsxs(Text, { style: styles.rowSubtitle, children: [group.membershipsCount, " members"] }))] })] }));
|
|
23
23
|
};
|
|
24
24
|
export const TeamRow = ({ team }) => {
|
|
25
25
|
const { setGroupFilter } = useContext(FilterContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rows.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filters/components/rows.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAkB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAc,EAAqB,UAAU,EAAE,MAAM,OAAO,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAC5E,OAAO,EACL,wBAAwB,EACxB,YAAY,EACZ,wBAAwB,EACxB,QAAQ,GACT,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAA;AAE/E,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAYtE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,QAAQ,EACR,MAAM,GACM,EAAE,EAAE;IAChB,MAAM,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC,CAAA;IAElD,OAAO,CACL,KAAC,YAAY,IACX,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE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AC,iBAAiB;YACrC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC1B;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,CAAC;YACb,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,sBAAsB;SACjE;QACD,WAAW,EAAE;YACX,KAAK,EAAE,qBAAqB;gBAC1B,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,yBAAyB;gBACxC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,uBAAuB;SACzC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { NavigationProp, useNavigation } from '@react-navigation/native'\nimport React, { PropsWithChildren, useContext } from 'react'\nimport { StyleSheet, View, ViewStyle } from 'react-native'\nimport { Heading, Icon, Image, Text, TextButton } from '../../../components'\nimport {\n useAtFontScaleBreakpoint,\n useFontScale,\n useScalableNumberOfLines,\n useTheme,\n} from '../../../hooks'\nimport { useServicesTeamsMap } from '../../../hooks/services/use_services_team'\nimport { GroupResource } from '../../../types/resources/group_resource'\nimport { MAX_FONT_SIZE_MULTIPLIER, platformFontWeightBold } from '../../../utils/styles'\nimport { FilterContext } from '../context/conversation_filter_context'\nimport { FilterTypes } from '../filter_types'\nimport { FilteredGroup } from '../hooks/filters'\nimport { ConversationFilterStackParamList } from '../screen_props'\n\nexport type FilterProps = {\n group_source_app_name?: string\n show_direct_messages?: boolean\n isActive: boolean\n filter: FilterTypes\n}\n\nexport const FilterRow = ({\n group_source_app_name,\n show_direct_messages,\n isActive,\n filter,\n}: FilterProps) => {\n const { setAppFilter } = useContext(FilterContext)\n\n return (\n <PressableRow\n onPress={() => setAppFilter({ group_source_app_name, show_direct_messages })}\n isActive={isActive}\n >\n <Text>{filter}</Text>\n </PressableRow>\n )\n}\n\nexport type GroupRowProps = {\n group: FilteredGroup\n isActive: boolean\n}\n\nexport const GroupRow = ({ group, isActive }: GroupRowProps) => {\n const styles = useRowStyles()\n const { setGroupFilter } = useContext(FilterContext)\n\n const handleFilterByGroup = () => {\n setGroupFilter({ chat_group_graph_id: group.id })\n }\n\n const { headerImage, membershipsCount } = group\n\n return (\n <PressableRow onPress={handleFilterByGroup} isActive={isActive}>\n {headerImage?.thumbnail && (\n <Image\n source={{ uri: headerImage?.thumbnail }}\n resizeMode=\"cover\"\n style={styles.rowImage}\n alt=\"\"\n />\n )}\n <View style={styles.rowTextContainer}>\n <Heading variant=\"h3\" style={styles.rowTitle}>\n {group.name}\n </Heading>\n {membershipsCount && (\n <Text style={styles.rowSubtitle}>{group.membershipsCount} members</Text>\n )}\n </View>\n </PressableRow>\n )\n}\n\nexport type TeamRowProps = {\n team: GroupResource\n isActive: boolean\n}\n\nexport const TeamRow = ({ team }: TeamRowProps) => {\n const { setGroupFilter } = useContext(FilterContext)\n const servicesTeams = useServicesTeamsMap()\n const { params } = useContext(FilterContext)\n const { chat_group_graph_id } = params\n const isActive = chat_group_graph_id === team.id.toString()\n const styles = useRowStyles()\n const scalableNumberOfLines = useScalableNumberOfLines()\n\n const handleFilterByGroup = () => {\n setGroupFilter({ chat_group_graph_id: team.id })\n }\n\n const servicesTeam = servicesTeams[team.id]\n const concatedServiceTypeNames = servicesTeam?.serviceTypeNames.join(', ')\n const serviceTypeName = concatedServiceTypeNames || servicesTeam?.group\n\n return (\n <PressableRow onPress={handleFilterByGroup} isActive={isActive}>\n <View style={styles.rowTextContainer}>\n <Heading variant=\"h3\" style={styles.rowTitle}>\n {team.name}\n </Heading>\n <Text numberOfLines={scalableNumberOfLines} style={styles.rowSubtitle}>\n {serviceTypeName}\n </Text>\n </View>\n </PressableRow>\n )\n}\n\nexport type ViewMoreRowProps = { routeName: keyof ConversationFilterStackParamList }\n\nexport const ViewMore = ({ routeName }: ViewMoreRowProps) => {\n const styles = useRowStyles()\n const navigation = useNavigation<NavigationProp<ConversationFilterStackParamList, 'Filters'>>()\n\n return (\n <View style={[styles.rowWithoutBorder]}>\n <TextButton onPress={() => navigation.navigate(routeName, {})} style={styles.viewMoreButton}>\n View more\n </TextButton>\n </View>\n )\n}\n\nexport const 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 ASPECT_RATIO = 16 / 9\nconst THUMBNAIL_WIDTH = 80\nconst THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO\n\nconst useRowStyles = ({ isActive = false }: { isActive?: boolean } = {}) => {\n const theme = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER })\n const atFontScaleBreakpoint = useAtFontScaleBreakpoint()\n\n return StyleSheet.create({\n pressable: {\n paddingLeft: 16,\n },\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 12,\n borderBottomWidth: 1,\n borderBottomColor: atFontScaleBreakpoint\n ? theme.colors.borderColorDefaultDark\n : theme.colors.borderColorDefaultBase,\n paddingVertical: 12,\n paddingRight: 16,\n },\n rowInner: {\n flexDirection: atFontScaleBreakpoint ? 'column' : 'row',\n alignItems: atFontScaleBreakpoint ? 'flex-start' : 'center',\n gap: 12,\n flexShrink: 1,\n },\n rowTextContainer: {\n flexShrink: 1,\n },\n rowWithoutBorder: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n paddingVertical: 12,\n paddingRight: 16,\n paddingLeft: 16,\n },\n viewMoreButton: {\n flex: 1,\n },\n rowImage: {\n width: THUMBNAIL_WIDTH * fontScale,\n height: THUMBNAIL_HEIGHT * fontScale,\n borderRadius: 4 * fontScale,\n },\n rowIconRight: {\n fontSize: 16,\n color: theme.colors.statusSuccessIcon,\n opacity: isActive ? 1 : 0,\n },\n rowTitle: {\n fontSize: 16,\n flexShrink: 1,\n fontWeight: atFontScaleBreakpoint ? 400 : platformFontWeightBold,\n },\n rowSubtitle: {\n color: atFontScaleBreakpoint\n ? theme.colors.textColorDefaultSecondary\n : theme.colors.textColorDefaultPrimary,\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"rows.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filters/components/rows.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAkB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAc,EAAqB,UAAU,EAAE,MAAM,OAAO,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAC5E,OAAO,EACL,wBAAwB,EACxB,YAAY,EACZ,wBAAwB,EACxB,QAAQ,GACT,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAA;AAE/E,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAYtE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,QAAQ,EACR,MAAM,GACM,EAAE,EAAE;IAChB,MAAM,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC,CAAA;IAElD,OAAO,CACL,KAAC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,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,iBAAiB;YACrC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC1B;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,CAAC;YACb,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,sBAAsB;SACjE;QACD,WAAW,EAAE;YACX,KAAK,EAAE,qBAAqB;gBAC1B,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,yBAAyB;gBACxC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,uBAAuB;SACzC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { NavigationProp, useNavigation } from '@react-navigation/native'\nimport React, { PropsWithChildren, useContext } from 'react'\nimport { StyleSheet, View, ViewStyle } from 'react-native'\nimport { Heading, Icon, Image, Text, TextButton } from '../../../components'\nimport {\n useAtFontScaleBreakpoint,\n useFontScale,\n useScalableNumberOfLines,\n useTheme,\n} from '../../../hooks'\nimport { useServicesTeamsMap } from '../../../hooks/services/use_services_team'\nimport { GroupResource } from '../../../types/resources/group_resource'\nimport { MAX_FONT_SIZE_MULTIPLIER, platformFontWeightBold } from '../../../utils/styles'\nimport { FilterContext } from '../context/conversation_filter_context'\nimport { FilterTypes } from '../filter_types'\nimport { FilteredGroup } from '../hooks/filters'\nimport { ConversationFilterStackParamList } from '../screen_props'\n\nexport type FilterProps = {\n group_source_app_name?: string\n show_direct_messages?: boolean\n isActive: boolean\n filter: FilterTypes\n}\n\nexport const FilterRow = ({\n group_source_app_name,\n show_direct_messages,\n isActive,\n filter,\n}: FilterProps) => {\n const { setAppFilter } = useContext(FilterContext)\n\n return (\n <PressableRow\n onPress={() => setAppFilter({ group_source_app_name, show_direct_messages })}\n isActive={isActive}\n >\n <Text>{filter}</Text>\n </PressableRow>\n )\n}\n\nexport type GroupRowProps = {\n group: FilteredGroup\n isActive: boolean\n}\n\nexport const GroupRow = ({ group, isActive }: GroupRowProps) => {\n const styles = useRowStyles()\n const { setGroupFilter } = useContext(FilterContext)\n\n const handleFilterByGroup = () => {\n setGroupFilter({ chat_group_graph_id: group.id })\n }\n\n const { headerImage, membershipsCount } = group\n\n return (\n <PressableRow onPress={handleFilterByGroup} isActive={isActive}>\n {headerImage?.medium && (\n <Image\n source={{ uri: headerImage?.medium }}\n resizeMode=\"cover\"\n style={styles.rowImage}\n alt=\"\"\n />\n )}\n <View style={styles.rowTextContainer}>\n <Heading variant=\"h3\" style={styles.rowTitle}>\n {group.name}\n </Heading>\n {membershipsCount && (\n <Text style={styles.rowSubtitle}>{group.membershipsCount} members</Text>\n )}\n </View>\n </PressableRow>\n )\n}\n\nexport type TeamRowProps = {\n team: GroupResource\n isActive: boolean\n}\n\nexport const TeamRow = ({ team }: TeamRowProps) => {\n const { setGroupFilter } = useContext(FilterContext)\n const servicesTeams = useServicesTeamsMap()\n const { params } = useContext(FilterContext)\n const { chat_group_graph_id } = params\n const isActive = chat_group_graph_id === team.id.toString()\n const styles = useRowStyles()\n const scalableNumberOfLines = useScalableNumberOfLines()\n\n const handleFilterByGroup = () => {\n setGroupFilter({ chat_group_graph_id: team.id })\n }\n\n const servicesTeam = servicesTeams[team.id]\n const concatedServiceTypeNames = servicesTeam?.serviceTypeNames.join(', ')\n const serviceTypeName = concatedServiceTypeNames || servicesTeam?.group\n\n return (\n <PressableRow onPress={handleFilterByGroup} isActive={isActive}>\n <View style={styles.rowTextContainer}>\n <Heading variant=\"h3\" style={styles.rowTitle}>\n {team.name}\n </Heading>\n <Text numberOfLines={scalableNumberOfLines} style={styles.rowSubtitle}>\n {serviceTypeName}\n </Text>\n </View>\n </PressableRow>\n )\n}\n\nexport type ViewMoreRowProps = { routeName: keyof ConversationFilterStackParamList }\n\nexport const ViewMore = ({ routeName }: ViewMoreRowProps) => {\n const styles = useRowStyles()\n const navigation = useNavigation<NavigationProp<ConversationFilterStackParamList, 'Filters'>>()\n\n return (\n <View style={[styles.rowWithoutBorder]}>\n <TextButton onPress={() => navigation.navigate(routeName, {})} style={styles.viewMoreButton}>\n View more\n </TextButton>\n </View>\n )\n}\n\nexport const 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 ASPECT_RATIO = 16 / 9\nconst THUMBNAIL_WIDTH = 80\nconst THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO\n\nconst useRowStyles = ({ isActive = false }: { isActive?: boolean } = {}) => {\n const theme = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER })\n const atFontScaleBreakpoint = useAtFontScaleBreakpoint()\n\n return StyleSheet.create({\n pressable: {\n paddingLeft: 16,\n },\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 12,\n borderBottomWidth: 1,\n borderBottomColor: atFontScaleBreakpoint\n ? theme.colors.borderColorDefaultDark\n : theme.colors.borderColorDefaultBase,\n paddingVertical: 12,\n paddingRight: 16,\n },\n rowInner: {\n flexDirection: atFontScaleBreakpoint ? 'column' : 'row',\n alignItems: atFontScaleBreakpoint ? 'flex-start' : 'center',\n gap: 12,\n flexShrink: 1,\n },\n rowTextContainer: {\n flexShrink: 1,\n },\n rowWithoutBorder: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n paddingVertical: 12,\n paddingRight: 16,\n paddingLeft: 16,\n },\n viewMoreButton: {\n flex: 1,\n },\n rowImage: {\n width: THUMBNAIL_WIDTH * fontScale,\n height: THUMBNAIL_HEIGHT * fontScale,\n borderRadius: 4 * fontScale,\n },\n rowIconRight: {\n fontSize: 16,\n color: theme.colors.statusSuccessIcon,\n opacity: isActive ? 1 : 0,\n },\n rowTitle: {\n fontSize: 16,\n flexShrink: 1,\n fontWeight: atFontScaleBreakpoint ? 400 : platformFontWeightBold,\n },\n rowSubtitle: {\n color: atFontScaleBreakpoint\n ? theme.colors.textColorDefaultSecondary\n : theme.colors.textColorDefaultPrimary,\n },\n })\n}\n"]}
|
|
@@ -3,6 +3,6 @@ import { pluralize } from '../../../utils';
|
|
|
3
3
|
import { RecipientLinkRow } from './recipient_link_row';
|
|
4
4
|
export const GroupsRecipientRow = ({ group, onPress }) => {
|
|
5
5
|
const groupAccessibilityLabel = `Select ${group.name} with ${pluralize(group.membershipsCount, 'member')}`;
|
|
6
|
-
return (_jsx(RecipientLinkRow, { imageUri: group.headerImage?.
|
|
6
|
+
return (_jsx(RecipientLinkRow, { imageUri: group.headerImage?.medium, title: group.name, subtitle: `${group.membershipsCount} members`, onPress: () => onPress(group), accessibilityLabel: groupAccessibilityLabel, accessibilityHint: `Selects group as recipient and navigates to the final screen to finish creating the conversation` }));
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=groups_recipient_row.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groups_recipient_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/components/groups_recipient_row.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAOvD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAA2B,EAAE,EAAE;IAChF,MAAM,uBAAuB,GAAG,UAAU,KAAK,CAAC,IAAI,SAAS,SAAS,CAAC,KAAK,CAAC,gBAAgB,EAAE,QAAQ,CAAC,EAAE,CAAA;IAE1G,OAAO,CACL,KAAC,gBAAgB,IACf,QAAQ,EAAE,KAAK,CAAC,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"groups_recipient_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/components/groups_recipient_row.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAOvD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAA2B,EAAE,EAAE;IAChF,MAAM,uBAAuB,GAAG,UAAU,KAAK,CAAC,IAAI,SAAS,SAAS,CAAC,KAAK,CAAC,gBAAgB,EAAE,QAAQ,CAAC,EAAE,CAAA;IAE1G,OAAO,CACL,KAAC,gBAAgB,IACf,QAAQ,EAAE,KAAK,CAAC,WAAW,EAAE,MAAM,EACnC,KAAK,EAAE,KAAK,CAAC,IAAI,EACjB,QAAQ,EAAE,GAAG,KAAK,CAAC,gBAAgB,UAAU,EAC7C,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAC7B,kBAAkB,EAAE,uBAAuB,EAC3C,iBAAiB,EAAE,kGAAkG,GACrH,CACH,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { GroupsGroupResource } from '../../../types'\nimport { pluralize } from '../../../utils'\nimport { RecipientLinkRow } from './recipient_link_row'\n\ninterface GroupsRecipientRowProps {\n group: GroupsGroupResource\n onPress: (group: GroupsGroupResource) => void\n}\n\nexport const GroupsRecipientRow = ({ group, onPress }: GroupsRecipientRowProps) => {\n const groupAccessibilityLabel = `Select ${group.name} with ${pluralize(group.membershipsCount, 'member')}`\n\n return (\n <RecipientLinkRow\n imageUri={group.headerImage?.medium}\n title={group.name}\n subtitle={`${group.membershipsCount} members`}\n onPress={() => onPress(group)}\n accessibilityLabel={groupAccessibilityLabel}\n accessibilityHint={`Selects group as recipient and navigates to the final screen to finish creating the conversation`}\n />\n )\n}\n"]}
|
|
@@ -15,7 +15,7 @@ function reasonText(reasonCode) {
|
|
|
15
15
|
}
|
|
16
16
|
export const RestrictedGroupRow = ({ group }) => {
|
|
17
17
|
const styles = useStyles();
|
|
18
|
-
return (_jsx(View, { style: styles.row, accessibilityLabel: `${group.name} — ${reasonText(group.canCreateConversationReasonCode)}`, children: _jsxs(View, { style: styles.innerContainer, children: [group.headerImage?.
|
|
18
|
+
return (_jsx(View, { style: styles.row, accessibilityLabel: `${group.name} — ${reasonText(group.canCreateConversationReasonCode)}`, children: _jsxs(View, { style: styles.innerContainer, children: [group.headerImage?.medium && (_jsx(Image, { source: { uri: group.headerImage.medium }, resizeMode: "cover", style: styles.image, alt: "" })), _jsxs(View, { style: styles.content, children: [_jsx(Text, { style: styles.title, numberOfLines: 2, children: group.name }), _jsx(Text, { variant: "tertiary", numberOfLines: 1, children: reasonText(group.canCreateConversationReasonCode) })] })] }) }));
|
|
19
19
|
};
|
|
20
20
|
const ASPECT_RATIO = 16 / 9;
|
|
21
21
|
const THUMBNAIL_WIDTH = 80;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restricted_group_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/components/restricted_group_row.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAMzD,MAAM,cAAc,GAAG,oCAAoC,CAAA;AAC3D,MAAM,mBAAmB,GAA2B;IAClD,YAAY,EAAE,sCAAsC;IACpD,aAAa,EAAE,cAAc;CAC9B,CAAA;AAED,SAAS,UAAU,CAAC,UAAyB;IAC3C,IAAI,CAAC,UAAU;QAAE,OAAO,cAAc,CAAA;IACtC,OAAO,mBAAmB,CAAC,UAAU,CAAC,IAAI,cAAc,CAAA;AAC1D,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAA2B,EAAE,EAAE;IACvE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,OAAO,CACL,KAAC,IAAI,IACH,KAAK,EAAE,MAAM,CAAC,GAAG,EACjB,kBAAkB,EAAE,GAAG,KAAK,CAAC,IAAI,MAAM,UAAU,CAAC,KAAK,CAAC,+BAA+B,CAAC,EAAE,YAE1F,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,cAAc,aAC/B,KAAK,CAAC,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"restricted_group_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/components/restricted_group_row.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAMzD,MAAM,cAAc,GAAG,oCAAoC,CAAA;AAC3D,MAAM,mBAAmB,GAA2B;IAClD,YAAY,EAAE,sCAAsC;IACpD,aAAa,EAAE,cAAc;CAC9B,CAAA;AAED,SAAS,UAAU,CAAC,UAAyB;IAC3C,IAAI,CAAC,UAAU;QAAE,OAAO,cAAc,CAAA;IACtC,OAAO,mBAAmB,CAAC,UAAU,CAAC,IAAI,cAAc,CAAA;AAC1D,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAA2B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,eAAe,EAAE,EAAE;YACnB,YAAY,EAAE,EAAE;YAChB,iBAAiB,EAAE,CAAC;YACpB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,uBAAuB;SAClD;QACD,KAAK,EAAE;YACL,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,gBAAgB;YACxB,YAAY,EAAE,CAAC;SAChB;QACD,KAAK,EAAE;YACL,UAAU,EAAE,wBAAwB;YACpC,UAAU,EAAE,CAAC;SACd;QACD,OAAO,EAAE;YACP,UAAU,EAAE,CAAC;YACb,GAAG,EAAE,CAAC;SACP;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Image, Text } from '../../../components'\nimport { useTheme } from '../../../hooks'\nimport { GroupsGroupResource } from '../../../types'\nimport { platformFontWeightMedium } from '../../../utils'\n\ninterface RestrictedGroupRowProps {\n group: GroupsGroupResource\n}\n\nconst DEFAULT_REASON = 'Chat is not enabled for this group'\nconst REASON_DISPLAY_TEXT: Record<string, string> = {\n leaders_only: 'Only leaders can start conversations',\n chat_disabled: DEFAULT_REASON,\n}\n\nfunction reasonText(reasonCode: string | null): string {\n if (!reasonCode) return DEFAULT_REASON\n return REASON_DISPLAY_TEXT[reasonCode] || DEFAULT_REASON\n}\n\nexport const RestrictedGroupRow = ({ group }: RestrictedGroupRowProps) => {\n const styles = useStyles()\n\n return (\n <View\n style={styles.row}\n accessibilityLabel={`${group.name} — ${reasonText(group.canCreateConversationReasonCode)}`}\n >\n <View style={styles.innerContainer}>\n {group.headerImage?.medium && (\n <Image\n source={{ uri: group.headerImage.medium }}\n resizeMode=\"cover\"\n style={styles.image}\n alt=\"\"\n />\n )}\n <View style={styles.content}>\n <Text style={styles.title} numberOfLines={2}>\n {group.name}\n </Text>\n <Text variant=\"tertiary\" numberOfLines={1}>\n {reasonText(group.canCreateConversationReasonCode)}\n </Text>\n </View>\n </View>\n </View>\n )\n}\n\nconst ASPECT_RATIO = 16 / 9\nconst THUMBNAIL_WIDTH = 80\nconst THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO\n\nconst useStyles = () => {\n const theme = useTheme()\n\n return StyleSheet.create({\n row: {\n paddingLeft: 16,\n opacity: 0.5,\n },\n innerContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n paddingVertical: 16,\n paddingRight: 16,\n borderBottomWidth: 1,\n borderColor: theme.colors.fillColorNeutral050Base,\n },\n image: {\n width: THUMBNAIL_WIDTH,\n height: THUMBNAIL_HEIGHT,\n borderRadius: 4,\n },\n title: {\n fontWeight: platformFontWeightMedium,\n flexShrink: 1,\n },\n content: {\n flexShrink: 1,\n gap: 2,\n },\n })\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/chat-react-native",
|
|
3
|
-
"version": "3.42.3-qa-staging.
|
|
3
|
+
"version": "3.42.3-qa-staging.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"react-native": "./src/index.tsx",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
|
28
28
|
"@fortawesome/react-native-fontawesome": "^0.3.2",
|
|
29
|
-
"@planningcenter/emoji-keyboard": "3.42.3-qa-staging.
|
|
29
|
+
"@planningcenter/emoji-keyboard": "3.42.3-qa-staging.6",
|
|
30
30
|
"lodash-inflection": "^1.5.0",
|
|
31
31
|
"react-compiler-runtime": "^1.0.0"
|
|
32
32
|
},
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"react-native-url-polyfill": "^2.0.0",
|
|
73
73
|
"typescript": "~6.0.3"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "e908e52ea701a8168941a5895c368ffb537340b6"
|
|
76
76
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { StyleSheet, useWindowDimensions, View } from 'react-native'
|
|
3
|
+
import Animated, {
|
|
4
|
+
FadeIn,
|
|
5
|
+
FadeOut,
|
|
6
|
+
LayoutAnimationConfig,
|
|
7
|
+
ReduceMotion,
|
|
8
|
+
} from 'react-native-reanimated'
|
|
4
9
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
5
10
|
import { useTheme } from '../../hooks'
|
|
6
11
|
import { ConversationWarning } from '../../types'
|
|
@@ -32,52 +37,50 @@ export const ActionButton = ({
|
|
|
32
37
|
warnings?: ConversationWarning[]
|
|
33
38
|
}) => {
|
|
34
39
|
const styles = useStyles()
|
|
35
|
-
const [show, setShow] = useState(visible)
|
|
36
|
-
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
if (show === visible) return
|
|
39
|
-
|
|
40
|
-
setShow(visible)
|
|
41
|
-
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
|
|
42
|
-
}, [show, visible])
|
|
43
|
-
|
|
44
|
-
if (!visible) return null
|
|
45
40
|
|
|
46
41
|
return (
|
|
47
|
-
<
|
|
48
|
-
{
|
|
49
|
-
<View
|
|
50
|
-
{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
<LayoutAnimationConfig skipEntering>
|
|
43
|
+
{visible && (
|
|
44
|
+
<Animated.View
|
|
45
|
+
entering={FadeIn.duration(300).reduceMotion(ReduceMotion.System)}
|
|
46
|
+
exiting={FadeOut.duration(300).reduceMotion(ReduceMotion.System)}
|
|
47
|
+
style={styles.container}
|
|
48
|
+
>
|
|
49
|
+
{warnings.length > 0 && (
|
|
50
|
+
<View style={styles.warnings}>
|
|
51
|
+
{warnings.map((warning, index) => (
|
|
52
|
+
<Banner
|
|
53
|
+
key={`${warning.attribute}-${index}`}
|
|
54
|
+
appearance="error"
|
|
55
|
+
description={warning.fullMessage}
|
|
56
|
+
/>
|
|
57
|
+
))}
|
|
58
|
+
</View>
|
|
59
|
+
)}
|
|
60
|
+
{Boolean(infoText) && (
|
|
61
|
+
<Text style={styles.infoText} variant="footnote">
|
|
62
|
+
{infoText}
|
|
63
|
+
</Text>
|
|
64
|
+
)}
|
|
65
|
+
<View style={styles.buttonRow}>
|
|
66
|
+
{secondaryButton}
|
|
67
|
+
<Button
|
|
68
|
+
variant="fill"
|
|
69
|
+
size="lg"
|
|
70
|
+
onPress={onPress}
|
|
71
|
+
title={title}
|
|
72
|
+
disabled={disabled}
|
|
73
|
+
style={secondaryButton ? null : styles.fullWidthButton}
|
|
74
|
+
iconNameLeft={buttonIconNameLeft}
|
|
75
|
+
loading={loading}
|
|
76
|
+
maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}
|
|
77
|
+
accessibilityShowsLargeContentViewer
|
|
78
|
+
accessibilityLargeContentTitle={title}
|
|
55
79
|
/>
|
|
56
|
-
|
|
57
|
-
</View>
|
|
58
|
-
)}
|
|
59
|
-
{Boolean(infoText) && (
|
|
60
|
-
<Text style={styles.infoText} variant="footnote">
|
|
61
|
-
{infoText}
|
|
62
|
-
</Text>
|
|
80
|
+
</View>
|
|
81
|
+
</Animated.View>
|
|
63
82
|
)}
|
|
64
|
-
|
|
65
|
-
{secondaryButton}
|
|
66
|
-
<Button
|
|
67
|
-
variant="fill"
|
|
68
|
-
size="lg"
|
|
69
|
-
onPress={onPress}
|
|
70
|
-
title={title}
|
|
71
|
-
disabled={disabled}
|
|
72
|
-
style={secondaryButton ? null : styles.fullWidthButton}
|
|
73
|
-
iconNameLeft={buttonIconNameLeft}
|
|
74
|
-
loading={loading}
|
|
75
|
-
maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}
|
|
76
|
-
accessibilityShowsLargeContentViewer
|
|
77
|
-
accessibilityLargeContentTitle={title}
|
|
78
|
-
/>
|
|
79
|
-
</View>
|
|
80
|
-
</Animated.View>
|
|
83
|
+
</LayoutAnimationConfig>
|
|
81
84
|
)
|
|
82
85
|
}
|
|
83
86
|
|
|
@@ -59,9 +59,9 @@ export const GroupRow = ({ group, isActive }: GroupRowProps) => {
|
|
|
59
59
|
|
|
60
60
|
return (
|
|
61
61
|
<PressableRow onPress={handleFilterByGroup} isActive={isActive}>
|
|
62
|
-
{headerImage?.
|
|
62
|
+
{headerImage?.medium && (
|
|
63
63
|
<Image
|
|
64
|
-
source={{ uri: headerImage?.
|
|
64
|
+
source={{ uri: headerImage?.medium }}
|
|
65
65
|
resizeMode="cover"
|
|
66
66
|
style={styles.rowImage}
|
|
67
67
|
alt=""
|
|
@@ -12,7 +12,7 @@ export const GroupsRecipientRow = ({ group, onPress }: GroupsRecipientRowProps)
|
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
14
|
<RecipientLinkRow
|
|
15
|
-
imageUri={group.headerImage?.
|
|
15
|
+
imageUri={group.headerImage?.medium}
|
|
16
16
|
title={group.name}
|
|
17
17
|
subtitle={`${group.membershipsCount} members`}
|
|
18
18
|
onPress={() => onPress(group)}
|
|
@@ -29,9 +29,9 @@ export const RestrictedGroupRow = ({ group }: RestrictedGroupRowProps) => {
|
|
|
29
29
|
accessibilityLabel={`${group.name} — ${reasonText(group.canCreateConversationReasonCode)}`}
|
|
30
30
|
>
|
|
31
31
|
<View style={styles.innerContainer}>
|
|
32
|
-
{group.headerImage?.
|
|
32
|
+
{group.headerImage?.medium && (
|
|
33
33
|
<Image
|
|
34
|
-
source={{ uri: group.headerImage.
|
|
34
|
+
source={{ uri: group.headerImage.medium }}
|
|
35
35
|
resizeMode="cover"
|
|
36
36
|
style={styles.image}
|
|
37
37
|
alt=""
|