@planningcenter/chat-react-native 3.15.0-rc.4 → 3.15.0-rc.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/index.d.ts +1 -0
- package/build/components/display/index.d.ts.map +1 -1
- package/build/components/display/index.js +1 -0
- package/build/components/display/index.js.map +1 -1
- package/build/components/display/pressable_row.d.ts +14 -0
- package/build/components/display/pressable_row.d.ts.map +1 -0
- package/build/components/display/pressable_row.js +65 -0
- package/build/components/display/pressable_row.js.map +1 -0
- package/build/hooks/use_api.d.ts +1 -1
- package/build/hooks/use_api.d.ts.map +1 -1
- package/build/hooks/use_api.js.map +1 -1
- package/build/hooks/use_api_client.d.ts +1 -1
- package/build/hooks/use_api_client.d.ts.map +1 -1
- package/build/hooks/use_api_client.js +1 -1
- package/build/hooks/use_api_client.js.map +1 -1
- package/build/hooks/use_async_storage.d.ts +1 -1
- package/build/hooks/use_async_storage.d.ts.map +1 -1
- package/build/hooks/use_async_storage.js +6 -5
- package/build/hooks/use_async_storage.js.map +1 -1
- package/build/hooks/use_suspense_api.d.ts +1 -1
- package/build/hooks/use_suspense_api.d.ts.map +1 -1
- package/build/hooks/use_suspense_api.js.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.js +9 -7
- package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
- package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/rows.js +50 -31
- package/build/screens/conversation_filters/components/rows.js.map +1 -1
- package/build/utils/client/index.d.ts +1 -0
- package/build/utils/client/index.d.ts.map +1 -1
- package/build/utils/client/index.js +1 -0
- package/build/utils/client/index.js.map +1 -1
- package/build/utils/client/types.d.ts +61 -0
- package/build/utils/client/types.d.ts.map +1 -0
- package/build/utils/client/types.js +2 -0
- package/build/utils/client/types.js.map +1 -0
- package/package.json +2 -2
- package/src/components/display/index.ts +1 -0
- package/src/components/display/pressable_row.tsx +103 -0
- package/src/hooks/use_api.ts +1 -1
- package/src/hooks/use_api_client.ts +2 -2
- package/src/hooks/use_async_storage.ts +8 -5
- package/src/hooks/use_suspense_api.ts +1 -1
- package/src/screens/conversation_filters/components/conversation_filters.tsx +10 -7
- package/src/screens/conversation_filters/components/rows.tsx +63 -50
- package/src/utils/client/index.ts +1 -0
- /package/src/utils/client/{types.d.ts → types.ts} +0 -0
|
@@ -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,OAAO,KAAK,EAAE,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,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAA;AAE/E,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAOtE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,EAAe,EAAE,EAAE;IACpF,MAAM,MAAM,GAAG,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAA;IACzC,MAAM,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC,CAAA;IAElD,OAAO,CACL,CAAC,YAAY,CACX,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAClB,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,qBAAqB,EAAE,CAAC,CAAC,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GAAG,EAAE,EAAE;YACP,eAAe,EAAE,EAAE;YACnB,YAAY,EAAE,EAAE;YAChB,WAAW,EAAE,EAAE;SAChB;QACD,cAAc,EAAE;YACd,IAAI,EAAE,CAAC;SACR;QACD,GAAG,EAAE,EAAE;QACP,QAAQ,EAAE;YACR,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,gBAAgB;YACxB,YAAY,EAAE,CAAC;SAChB;QACD,UAAU,EAAE;YACV,UAAU,EAAE,CAAC;SACd;QACD,YAAY,EAAE;YACZ,UAAU,EAAE,MAAM;YAClB,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;SACd;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 { useTheme } from '../../../hooks'\nimport { useServicesTeamsMap } from '../../../hooks/services/use_services_team'\nimport { GroupResource } from '../../../types/resources/group_resource'\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 = { group_source_app_name?: string; isActive: boolean; filter: FilterTypes }\n\nexport const FilterRow = ({ group_source_app_name, isActive, filter }: FilterProps) => {\n const styles = useRowStyles({ isActive })\n const { setAppFilter } = useContext(FilterContext)\n\n return (\n <PressableRow\n style={styles.row}\n onPress={() => setAppFilter({ group_source_app_name })}\n isActive={isActive}\n >\n <Text>{filter}</Text>\n <Icon\n name=\"general.check\"\n size={16}\n style={styles.rowIconRight}\n accessibilityElementsHidden\n />\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({ isActive })\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 style={styles.row} onPress={handleFilterByGroup} isActive={isActive}>\n {headerImage?.thumbnail && (\n <Image\n source={{ uri: headerImage?.thumbnail }}\n resizeMode=\"cover\"\n style={styles.rowImage}\n alt={`Image for ${group.name}`}\n />\n )}\n <View style={styles.rowContent}>\n <Heading variant=\"h3\" style={styles.rowTitle}>\n {group.name}\n </Heading>\n {membershipsCount && <Text>{group.membershipsCount} members</Text>}\n </View>\n <Icon\n name=\"general.check\"\n size={16}\n style={styles.rowIconRight}\n accessibilityElementsHidden\n />\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({ isActive })\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 style={styles.row} onPress={handleFilterByGroup} isActive={isActive}>\n <View style={styles.rowContent}>\n <Heading variant=\"h3\" style={styles.rowTitle}>\n {team.name}\n </Heading>\n <Text numberOfLines={1}>{serviceTypeName}</Text>\n </View>\n <Icon\n name=\"general.check\"\n size={16}\n style={styles.rowIconRight}\n accessibilityElementsHidden\n />\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.borderLessRow]}>\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()\n return (\n <PlatformPressable\n style={styles.container}\n onPress={onPress}\n accessibilityRole=\"radio\"\n accessibilityState={{ selected: isActive }}\n >\n <View style={[styles.innerContainer, style]}>{children}</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 return StyleSheet.create({\n container: {\n paddingLeft: 16,\n },\n innerContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.fillColorNeutral050Base,\n paddingVertical: 12,\n paddingRight: 16,\n },\n borderLessRow: {\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 row: {},\n rowImage: {\n width: THUMBNAIL_WIDTH,\n height: THUMBNAIL_HEIGHT,\n borderRadius: 4,\n },\n rowContent: {\n flexShrink: 1,\n },\n rowIconRight: {\n marginLeft: 'auto',\n color: theme.colors.statusSuccessIcon,\n opacity: isActive ? 1 : 0,\n },\n rowTitle: {\n fontSize: 16,\n flexShrink: 1,\n },\n })\n}\n"]}
|
|
1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AChB,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,EAAE;YACP,eAAe,EAAE,EAAE;YACnB,YAAY,EAAE,EAAE;YAChB,WAAW,EAAE,EAAE;SAChB;QACD,cAAc,EAAE;YACd,IAAI,EAAE,CAAC;SACR;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,eAAe,GAAG,SAAS;YAClC,MAAM,EAAE,gBAAgB,GAAG,SAAS;YACpC,YAAY,EAAE,CAAC,GAAG,SAAS;SAC5B;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;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 { FilterContext } from '../context/conversation_filter_context'\nimport { FilterTypes } from '../filter_types'\nimport { FilteredGroup } from '../hooks/filters'\nimport { ConversationFilterStackParamList } from '../screen_props'\nimport { MAX_FONT_SIZE_MULTIPLIER, platformFontWeightBold } from '../../../utils/styles'\n\nexport type FilterProps = { group_source_app_name?: string; isActive: boolean; filter: FilterTypes }\n\nexport const FilterRow = ({ group_source_app_name, isActive, filter }: FilterProps) => {\n const { setAppFilter } = useContext(FilterContext)\n\n return (\n <PressableRow onPress={() => setAppFilter({ group_source_app_name })} isActive={isActive}>\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA","sourcesContent":["export * from './client'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA","sourcesContent":["export * from './client'\nexport * from './types'\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export interface Accumulator {
|
|
2
|
+
data: Record<string, unknown>[];
|
|
3
|
+
included: Record<string, unknown>[];
|
|
4
|
+
meta: Record<string, unknown>;
|
|
5
|
+
links: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export interface WalkRequest extends GetRequest {
|
|
8
|
+
acc?: Accumulator;
|
|
9
|
+
}
|
|
10
|
+
export interface GenericRequest {
|
|
11
|
+
headers?: Record<string, string>;
|
|
12
|
+
url: string;
|
|
13
|
+
}
|
|
14
|
+
export interface GetRequest extends GenericRequest {
|
|
15
|
+
data: {
|
|
16
|
+
filter?: string;
|
|
17
|
+
fields: Record<string, string[]>;
|
|
18
|
+
where?: Record<string, string | number | (string | number)[]>;
|
|
19
|
+
include?: string[];
|
|
20
|
+
order?: string;
|
|
21
|
+
perPage?: number;
|
|
22
|
+
offset?: number;
|
|
23
|
+
walk?: boolean;
|
|
24
|
+
} & Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
export interface Relationship {
|
|
27
|
+
data: {
|
|
28
|
+
type: string;
|
|
29
|
+
id: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export type Relationships = Record<string, Relationship | Relationship[]>;
|
|
33
|
+
export interface PostRequest extends GenericRequest {
|
|
34
|
+
data?: {
|
|
35
|
+
fields?: Record<string, string>;
|
|
36
|
+
include?: string[];
|
|
37
|
+
data?: {
|
|
38
|
+
type: string;
|
|
39
|
+
attributes: Record<string, unknown>;
|
|
40
|
+
relationships?: Relationships;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export type PatchRequest = PostRequest;
|
|
45
|
+
export interface DeleteRequest extends GenericRequest {
|
|
46
|
+
}
|
|
47
|
+
export interface ApiClient<T = unknown> {
|
|
48
|
+
get(_request: GetRequest): Promise<T>;
|
|
49
|
+
post(_request: PostRequest): Promise<T>;
|
|
50
|
+
patch(_request: PatchRequest): Promise<T>;
|
|
51
|
+
delete(_request: DeleteRequest): Promise<T>;
|
|
52
|
+
}
|
|
53
|
+
export type RequestData = {
|
|
54
|
+
fields: Record<string, string[] | string>;
|
|
55
|
+
where: Record<string, string | number | (string | number)[]>;
|
|
56
|
+
include: string[];
|
|
57
|
+
data: Record<string, unknown>;
|
|
58
|
+
perPage: number;
|
|
59
|
+
offset: number;
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/client/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IACnC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B;AAED,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,GAAG,CAAC,EAAE,WAAW,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD,IAAI,EAAE;QACJ,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;QAChC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;QAC7D,OAAO,CAAC,EAAE,MAAM,EAAE,C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AAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,CAAA;IACzC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;IAC5D,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACf,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/client/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface Accumulator {\n data: Record<string, unknown>[]\n included: Record<string, unknown>[]\n meta: Record<string, unknown>\n links: Record<string, unknown>\n}\n\nexport interface WalkRequest extends GetRequest {\n acc?: Accumulator\n}\n\nexport interface GenericRequest {\n headers?: Record<string, string>\n url: string\n}\n\nexport interface GetRequest extends GenericRequest {\n data: {\n filter?: string\n fields: Record<string, string[]>\n where?: Record<string, string | number | (string | number)[]>\n include?: string[]\n order?: string\n perPage?: number\n offset?: number\n walk?: boolean\n } & Record<string, unknown>\n}\n\nexport interface Relationship {\n data: {\n type: string\n id: string\n }\n}\n\nexport type Relationships = Record<string, Relationship | Relationship[]>\nexport interface PostRequest extends GenericRequest {\n data?: {\n fields?: Record<string, string> // value should be comma separated string\n include?: string[]\n data?: {\n type: string\n attributes: Record<string, unknown>\n relationships?: Relationships\n }\n }\n}\n\nexport type PatchRequest = PostRequest\n\nexport interface DeleteRequest extends GenericRequest {}\n\nexport interface ApiClient<T = unknown> {\n get(_request: GetRequest): Promise<T>\n post(_request: PostRequest): Promise<T>\n patch(_request: PatchRequest): Promise<T>\n delete(_request: DeleteRequest): Promise<T>\n}\n\nexport type RequestData = {\n fields: Record<string, string[] | string>\n where: Record<string, string | number | (string | number)[]>\n include: string[]\n data: Record<string, unknown>\n perPage: number\n offset: number\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/chat-react-native",
|
|
3
|
-
"version": "3.15.0-rc.
|
|
3
|
+
"version": "3.15.0-rc.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"react-native-url-polyfill": "^2.0.0",
|
|
56
56
|
"typescript": "<5.6.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "c9061788178feeb893f4e54b88f2b515658061d7"
|
|
59
59
|
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { PlatformPressable } from '@react-navigation/elements'
|
|
2
|
+
import { PropsWithChildren } from 'react'
|
|
3
|
+
import { StyleSheet, View, ViewStyle } from 'react-native'
|
|
4
|
+
import { useTheme } from '../../hooks'
|
|
5
|
+
import { Icon, IconProps } from './icon'
|
|
6
|
+
import { Text } from './text'
|
|
7
|
+
|
|
8
|
+
export interface PressableRowProps extends PropsWithChildren {
|
|
9
|
+
isActive?: boolean
|
|
10
|
+
onPress: () => void
|
|
11
|
+
style?: ViewStyle
|
|
12
|
+
textStyle?: any
|
|
13
|
+
text: string
|
|
14
|
+
iconPath?: IconProps['name']
|
|
15
|
+
iconColor?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const PressableRow = ({
|
|
19
|
+
children,
|
|
20
|
+
isActive,
|
|
21
|
+
onPress,
|
|
22
|
+
style,
|
|
23
|
+
text,
|
|
24
|
+
textStyle,
|
|
25
|
+
iconPath,
|
|
26
|
+
iconColor,
|
|
27
|
+
}: PressableRowProps) => {
|
|
28
|
+
const styles = useRowStyles({ isActive, iconColor })
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<PlatformPressable
|
|
32
|
+
style={styles.container}
|
|
33
|
+
onPress={onPress}
|
|
34
|
+
accessibilityRole="radio"
|
|
35
|
+
accessibilityState={{ selected: isActive }}
|
|
36
|
+
>
|
|
37
|
+
<View style={[styles.innerContainer, style]}>
|
|
38
|
+
{children}
|
|
39
|
+
<Text style={textStyle}>{text}</Text>
|
|
40
|
+
<Icon
|
|
41
|
+
name={iconPath || 'general.check'}
|
|
42
|
+
size={16}
|
|
43
|
+
style={styles.rowIconRight}
|
|
44
|
+
accessibilityElementsHidden
|
|
45
|
+
/>
|
|
46
|
+
</View>
|
|
47
|
+
</PlatformPressable>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const ASPECT_RATIO = 16 / 9
|
|
52
|
+
const THUMBNAIL_WIDTH = 80
|
|
53
|
+
const THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO
|
|
54
|
+
|
|
55
|
+
const useRowStyles = ({
|
|
56
|
+
isActive = false,
|
|
57
|
+
iconColor,
|
|
58
|
+
}: { isActive?: boolean; iconColor?: string } = {}) => {
|
|
59
|
+
const theme = useTheme()
|
|
60
|
+
return StyleSheet.create({
|
|
61
|
+
container: {
|
|
62
|
+
paddingLeft: 16,
|
|
63
|
+
},
|
|
64
|
+
innerContainer: {
|
|
65
|
+
flexDirection: 'row',
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
gap: 12,
|
|
68
|
+
borderBottomWidth: 1,
|
|
69
|
+
borderBottomColor: theme.colors.fillColorNeutral050Base,
|
|
70
|
+
paddingVertical: 12,
|
|
71
|
+
paddingRight: 16,
|
|
72
|
+
},
|
|
73
|
+
borderLessRow: {
|
|
74
|
+
flexDirection: 'row',
|
|
75
|
+
alignItems: 'center',
|
|
76
|
+
gap: 12,
|
|
77
|
+
paddingVertical: 12,
|
|
78
|
+
paddingRight: 16,
|
|
79
|
+
paddingLeft: 16,
|
|
80
|
+
},
|
|
81
|
+
viewMoreButton: {
|
|
82
|
+
flex: 1,
|
|
83
|
+
},
|
|
84
|
+
row: {},
|
|
85
|
+
rowImage: {
|
|
86
|
+
width: THUMBNAIL_WIDTH,
|
|
87
|
+
height: THUMBNAIL_HEIGHT,
|
|
88
|
+
borderRadius: 4,
|
|
89
|
+
},
|
|
90
|
+
rowContent: {
|
|
91
|
+
flexShrink: 1,
|
|
92
|
+
},
|
|
93
|
+
rowIconRight: {
|
|
94
|
+
marginLeft: 'auto',
|
|
95
|
+
color: iconColor || theme.colors.iconColorDefaultDim,
|
|
96
|
+
opacity: isActive ? 1 : 0,
|
|
97
|
+
},
|
|
98
|
+
rowTitle: {
|
|
99
|
+
fontSize: 16,
|
|
100
|
+
flexShrink: 1,
|
|
101
|
+
},
|
|
102
|
+
})
|
|
103
|
+
}
|
package/src/hooks/use_api.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
useQuery,
|
|
6
6
|
} from '@tanstack/react-query'
|
|
7
7
|
import { ApiCollection, ApiError, ApiResource, ResourceObject } from '../types'
|
|
8
|
-
import { GetRequest, RequestData } from '../utils/client
|
|
8
|
+
import { GetRequest, RequestData } from '../utils/client'
|
|
9
9
|
import { App, useApiClient } from './use_api_client'
|
|
10
10
|
import { getRequestQueryKey, RequestQueryKey } from './use_suspense_api'
|
|
11
11
|
|
|
@@ -3,8 +3,8 @@ import { ChatContext } from '../contexts/chat_context'
|
|
|
3
3
|
import { Client } from '../utils/client'
|
|
4
4
|
import { Uri } from '../utils'
|
|
5
5
|
|
|
6
|
-
export type App = 'chat' | 'groups' | 'services'
|
|
7
|
-
const apps: App[] = ['chat', 'groups', 'services']
|
|
6
|
+
export type App = 'chat' | 'groups' | 'services' | 'people'
|
|
7
|
+
const apps: App[] = ['chat', 'groups', 'services', 'people']
|
|
8
8
|
|
|
9
9
|
export type ApiClient = { [_K in App]: Client }
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ import { useCallback } from 'react'
|
|
|
4
4
|
|
|
5
5
|
const cacheKeyGenerator = (key: string) => [`AsyncStorageResource:${key}`]
|
|
6
6
|
|
|
7
|
-
type SetValue<TCacheData> = (_itemValue?: TCacheData | null) => void
|
|
7
|
+
type SetValue<TCacheData> = (_itemValue?: TCacheData | null) => Promise<void>
|
|
8
8
|
|
|
9
9
|
export function useAsyncStorage<TCacheData>(
|
|
10
10
|
key: string,
|
|
@@ -28,11 +28,14 @@ export function useAsyncStorage<TCacheData>(
|
|
|
28
28
|
const setValue: SetValue<TCacheData> = useCallback(
|
|
29
29
|
itemValue => {
|
|
30
30
|
if (itemValue === null || itemValue === undefined) {
|
|
31
|
-
AsyncStorage.removeItem(key)
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
return AsyncStorage.removeItem(key).then(() => {
|
|
32
|
+
refetch()
|
|
33
|
+
})
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
|
|
36
|
+
return AsyncStorage.setItem(key, JSON.stringify(itemValue)).then(() => {
|
|
37
|
+
refetch()
|
|
38
|
+
})
|
|
36
39
|
},
|
|
37
40
|
[key, refetch]
|
|
38
41
|
)
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
UseSuspenseQueryOptions,
|
|
7
7
|
} from '@tanstack/react-query'
|
|
8
8
|
import { ApiCollection, ApiResource, ResourceObject } from '../types'
|
|
9
|
-
import { GetRequest, RequestData } from '../utils/client
|
|
9
|
+
import { GetRequest, RequestData } from '../utils/client'
|
|
10
10
|
import { App, useApiClient } from './use_api_client'
|
|
11
11
|
import { Log } from '../utils'
|
|
12
12
|
import { ApiError } from '../types/api_primitives'
|
|
@@ -2,7 +2,7 @@ import React, { useContext, useMemo } from 'react'
|
|
|
2
2
|
import { StyleSheet, View, ViewStyle } from 'react-native'
|
|
3
3
|
import { FlatList } from 'react-native-gesture-handler'
|
|
4
4
|
import { Heading } from '../../../components'
|
|
5
|
-
import { useTheme } from '../../../hooks'
|
|
5
|
+
import { useAtFontScaleBreakpoint, useTheme } from '../../../hooks'
|
|
6
6
|
import { FilterContext, useFilterContext } from '../context/conversation_filter_context'
|
|
7
7
|
import { FilterTypes } from '../filter_types'
|
|
8
8
|
import { useGroupsToFilter, useTeamsToFilter } from '../hooks/filters'
|
|
@@ -119,7 +119,7 @@ export const ConversationFilters = () => {
|
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
type: groupItems.length ? SectionTypes.header : SectionTypes.hidden,
|
|
122
|
-
data: { title: 'Groups' },
|
|
122
|
+
data: { title: 'Groups', style: styles.extraHeaderScalableSpace },
|
|
123
123
|
},
|
|
124
124
|
...groupItemData,
|
|
125
125
|
{
|
|
@@ -128,7 +128,7 @@ export const ConversationFilters = () => {
|
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
130
|
type: teamItems.length ? SectionTypes.header : SectionTypes.hidden,
|
|
131
|
-
data: { title: 'Teams' },
|
|
131
|
+
data: { title: 'Teams', style: styles.extraHeaderScalableSpace },
|
|
132
132
|
},
|
|
133
133
|
...teamItemData,
|
|
134
134
|
{
|
|
@@ -166,12 +166,12 @@ export const ConversationFilters = () => {
|
|
|
166
166
|
const useStyles = () => {
|
|
167
167
|
const { platformListPaddingBottom } = useFilterContext()
|
|
168
168
|
const theme = useTheme()
|
|
169
|
+
const atFontScaleBreakpoint = useAtFontScaleBreakpoint()
|
|
169
170
|
|
|
170
171
|
return StyleSheet.create({
|
|
171
172
|
flatlistContainer: {
|
|
172
173
|
paddingBottom: platformListPaddingBottom,
|
|
173
174
|
},
|
|
174
|
-
section: {},
|
|
175
175
|
sectionHeader: {
|
|
176
176
|
flexDirection: 'row',
|
|
177
177
|
justifyContent: 'space-between',
|
|
@@ -179,7 +179,9 @@ const useStyles = () => {
|
|
|
179
179
|
paddingBottom: 8,
|
|
180
180
|
paddingHorizontal: 16,
|
|
181
181
|
},
|
|
182
|
-
|
|
182
|
+
extraHeaderScalableSpace: {
|
|
183
|
+
marginTop: atFontScaleBreakpoint ? 24 : 0,
|
|
184
|
+
},
|
|
183
185
|
filterBar: {
|
|
184
186
|
backgroundColor: theme.colors.fillColorNeutral100Inverted,
|
|
185
187
|
flexDirection: 'row',
|
|
@@ -203,13 +205,14 @@ const useStyles = () => {
|
|
|
203
205
|
|
|
204
206
|
type HeaderProps = {
|
|
205
207
|
title: string
|
|
208
|
+
style?: ViewStyle
|
|
206
209
|
}
|
|
207
210
|
|
|
208
|
-
const Header = ({ title }: HeaderProps) => {
|
|
211
|
+
const Header = ({ title, style = {} }: HeaderProps) => {
|
|
209
212
|
const styles = useStyles()
|
|
210
213
|
|
|
211
214
|
return (
|
|
212
|
-
<View style={styles.sectionHeader}>
|
|
215
|
+
<View style={[styles.sectionHeader, style]}>
|
|
213
216
|
<Heading variant="h3">{title}</Heading>
|
|
214
217
|
</View>
|
|
215
218
|
)
|
|
@@ -3,33 +3,28 @@ import { NavigationProp, useNavigation } from '@react-navigation/native'
|
|
|
3
3
|
import React, { PropsWithChildren, useContext } from 'react'
|
|
4
4
|
import { StyleSheet, View, ViewStyle } from 'react-native'
|
|
5
5
|
import { Heading, Icon, Image, Text, TextButton } from '../../../components'
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
useAtFontScaleBreakpoint,
|
|
8
|
+
useFontScale,
|
|
9
|
+
useScalableNumberOfLines,
|
|
10
|
+
useTheme,
|
|
11
|
+
} from '../../../hooks'
|
|
7
12
|
import { useServicesTeamsMap } from '../../../hooks/services/use_services_team'
|
|
8
13
|
import { GroupResource } from '../../../types/resources/group_resource'
|
|
9
14
|
import { FilterContext } from '../context/conversation_filter_context'
|
|
10
15
|
import { FilterTypes } from '../filter_types'
|
|
11
16
|
import { FilteredGroup } from '../hooks/filters'
|
|
12
17
|
import { ConversationFilterStackParamList } from '../screen_props'
|
|
18
|
+
import { MAX_FONT_SIZE_MULTIPLIER, platformFontWeightBold } from '../../../utils/styles'
|
|
13
19
|
|
|
14
20
|
export type FilterProps = { group_source_app_name?: string; isActive: boolean; filter: FilterTypes }
|
|
15
21
|
|
|
16
22
|
export const FilterRow = ({ group_source_app_name, isActive, filter }: FilterProps) => {
|
|
17
|
-
const styles = useRowStyles({ isActive })
|
|
18
23
|
const { setAppFilter } = useContext(FilterContext)
|
|
19
24
|
|
|
20
25
|
return (
|
|
21
|
-
<PressableRow
|
|
22
|
-
style={styles.row}
|
|
23
|
-
onPress={() => setAppFilter({ group_source_app_name })}
|
|
24
|
-
isActive={isActive}
|
|
25
|
-
>
|
|
26
|
+
<PressableRow onPress={() => setAppFilter({ group_source_app_name })} isActive={isActive}>
|
|
26
27
|
<Text>{filter}</Text>
|
|
27
|
-
<Icon
|
|
28
|
-
name="general.check"
|
|
29
|
-
size={16}
|
|
30
|
-
style={styles.rowIconRight}
|
|
31
|
-
accessibilityElementsHidden
|
|
32
|
-
/>
|
|
33
28
|
</PressableRow>
|
|
34
29
|
)
|
|
35
30
|
}
|
|
@@ -40,7 +35,7 @@ export type GroupRowProps = {
|
|
|
40
35
|
}
|
|
41
36
|
|
|
42
37
|
export const GroupRow = ({ group, isActive }: GroupRowProps) => {
|
|
43
|
-
const styles = useRowStyles(
|
|
38
|
+
const styles = useRowStyles()
|
|
44
39
|
const { setGroupFilter } = useContext(FilterContext)
|
|
45
40
|
|
|
46
41
|
const handleFilterByGroup = () => {
|
|
@@ -50,27 +45,23 @@ export const GroupRow = ({ group, isActive }: GroupRowProps) => {
|
|
|
50
45
|
const { headerImage, membershipsCount } = group
|
|
51
46
|
|
|
52
47
|
return (
|
|
53
|
-
<PressableRow
|
|
48
|
+
<PressableRow onPress={handleFilterByGroup} isActive={isActive}>
|
|
54
49
|
{headerImage?.thumbnail && (
|
|
55
50
|
<Image
|
|
56
51
|
source={{ uri: headerImage?.thumbnail }}
|
|
57
52
|
resizeMode="cover"
|
|
58
53
|
style={styles.rowImage}
|
|
59
|
-
alt=
|
|
54
|
+
alt=""
|
|
60
55
|
/>
|
|
61
56
|
)}
|
|
62
|
-
<View style={styles.
|
|
57
|
+
<View style={styles.rowTextContainer}>
|
|
63
58
|
<Heading variant="h3" style={styles.rowTitle}>
|
|
64
59
|
{group.name}
|
|
65
60
|
</Heading>
|
|
66
|
-
{membershipsCount &&
|
|
61
|
+
{membershipsCount && (
|
|
62
|
+
<Text style={styles.rowSubtitle}>{group.membershipsCount} members</Text>
|
|
63
|
+
)}
|
|
67
64
|
</View>
|
|
68
|
-
<Icon
|
|
69
|
-
name="general.check"
|
|
70
|
-
size={16}
|
|
71
|
-
style={styles.rowIconRight}
|
|
72
|
-
accessibilityElementsHidden
|
|
73
|
-
/>
|
|
74
65
|
</PressableRow>
|
|
75
66
|
)
|
|
76
67
|
}
|
|
@@ -86,7 +77,8 @@ export const TeamRow = ({ team }: TeamRowProps) => {
|
|
|
86
77
|
const { params } = useContext(FilterContext)
|
|
87
78
|
const { chat_group_graph_id } = params
|
|
88
79
|
const isActive = chat_group_graph_id === team.id.toString()
|
|
89
|
-
const styles = useRowStyles(
|
|
80
|
+
const styles = useRowStyles()
|
|
81
|
+
const scalableNumberOfLines = useScalableNumberOfLines()
|
|
90
82
|
|
|
91
83
|
const handleFilterByGroup = () => {
|
|
92
84
|
setGroupFilter({ chat_group_graph_id: team.id })
|
|
@@ -97,19 +89,15 @@ export const TeamRow = ({ team }: TeamRowProps) => {
|
|
|
97
89
|
const serviceTypeName = concatedServiceTypeNames || servicesTeam?.group
|
|
98
90
|
|
|
99
91
|
return (
|
|
100
|
-
<PressableRow
|
|
101
|
-
<View style={styles.
|
|
92
|
+
<PressableRow onPress={handleFilterByGroup} isActive={isActive}>
|
|
93
|
+
<View style={styles.rowTextContainer}>
|
|
102
94
|
<Heading variant="h3" style={styles.rowTitle}>
|
|
103
95
|
{team.name}
|
|
104
96
|
</Heading>
|
|
105
|
-
<Text numberOfLines={
|
|
97
|
+
<Text numberOfLines={scalableNumberOfLines} style={styles.rowSubtitle}>
|
|
98
|
+
{serviceTypeName}
|
|
99
|
+
</Text>
|
|
106
100
|
</View>
|
|
107
|
-
<Icon
|
|
108
|
-
name="general.check"
|
|
109
|
-
size={16}
|
|
110
|
-
style={styles.rowIconRight}
|
|
111
|
-
accessibilityElementsHidden
|
|
112
|
-
/>
|
|
113
101
|
</PressableRow>
|
|
114
102
|
)
|
|
115
103
|
}
|
|
@@ -121,7 +109,7 @@ export const ViewMore = ({ routeName }: ViewMoreRowProps) => {
|
|
|
121
109
|
const navigation = useNavigation<NavigationProp<ConversationFilterStackParamList, 'Filters'>>()
|
|
122
110
|
|
|
123
111
|
return (
|
|
124
|
-
<View style={[styles.
|
|
112
|
+
<View style={[styles.rowWithoutBorder]}>
|
|
125
113
|
<TextButton onPress={() => navigation.navigate(routeName, {})} style={styles.viewMoreButton}>
|
|
126
114
|
View more
|
|
127
115
|
</TextButton>
|
|
@@ -135,15 +123,23 @@ export const PressableRow = ({
|
|
|
135
123
|
onPress,
|
|
136
124
|
style,
|
|
137
125
|
}: PropsWithChildren<{ isActive: boolean; onPress: () => void; style?: ViewStyle }>) => {
|
|
138
|
-
const styles = useRowStyles()
|
|
126
|
+
const styles = useRowStyles({ isActive })
|
|
139
127
|
return (
|
|
140
128
|
<PlatformPressable
|
|
141
|
-
style={styles.
|
|
129
|
+
style={styles.pressable}
|
|
142
130
|
onPress={onPress}
|
|
143
131
|
accessibilityRole="radio"
|
|
144
132
|
accessibilityState={{ selected: isActive }}
|
|
145
133
|
>
|
|
146
|
-
<View style={
|
|
134
|
+
<View style={styles.row}>
|
|
135
|
+
<View style={[styles.rowInner, style]}>{children}</View>
|
|
136
|
+
<Icon
|
|
137
|
+
name="general.check"
|
|
138
|
+
style={styles.rowIconRight}
|
|
139
|
+
accessibilityElementsHidden
|
|
140
|
+
maxFontSizeMultiplier={2.5}
|
|
141
|
+
/>
|
|
142
|
+
</View>
|
|
147
143
|
</PlatformPressable>
|
|
148
144
|
)
|
|
149
145
|
}
|
|
@@ -154,20 +150,35 @@ const THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO
|
|
|
154
150
|
|
|
155
151
|
const useRowStyles = ({ isActive = false }: { isActive?: boolean } = {}) => {
|
|
156
152
|
const theme = useTheme()
|
|
153
|
+
const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER })
|
|
154
|
+
const atFontScaleBreakpoint = useAtFontScaleBreakpoint()
|
|
155
|
+
|
|
157
156
|
return StyleSheet.create({
|
|
158
|
-
|
|
157
|
+
pressable: {
|
|
159
158
|
paddingLeft: 16,
|
|
160
159
|
},
|
|
161
|
-
|
|
160
|
+
row: {
|
|
162
161
|
flexDirection: 'row',
|
|
163
162
|
alignItems: 'center',
|
|
163
|
+
justifyContent: 'space-between',
|
|
164
164
|
gap: 12,
|
|
165
165
|
borderBottomWidth: 1,
|
|
166
|
-
borderBottomColor:
|
|
166
|
+
borderBottomColor: atFontScaleBreakpoint
|
|
167
|
+
? theme.colors.borderColorDefaultDark
|
|
168
|
+
: theme.colors.borderColorDefaultBase,
|
|
167
169
|
paddingVertical: 12,
|
|
168
170
|
paddingRight: 16,
|
|
169
171
|
},
|
|
170
|
-
|
|
172
|
+
rowInner: {
|
|
173
|
+
flexDirection: atFontScaleBreakpoint ? 'column' : 'row',
|
|
174
|
+
alignItems: atFontScaleBreakpoint ? 'flex-start' : 'center',
|
|
175
|
+
gap: 12,
|
|
176
|
+
flexShrink: 1,
|
|
177
|
+
},
|
|
178
|
+
rowTextContainer: {
|
|
179
|
+
flexShrink: 1,
|
|
180
|
+
},
|
|
181
|
+
rowWithoutBorder: {
|
|
171
182
|
flexDirection: 'row',
|
|
172
183
|
alignItems: 'center',
|
|
173
184
|
gap: 12,
|
|
@@ -178,23 +189,25 @@ const useRowStyles = ({ isActive = false }: { isActive?: boolean } = {}) => {
|
|
|
178
189
|
viewMoreButton: {
|
|
179
190
|
flex: 1,
|
|
180
191
|
},
|
|
181
|
-
row: {},
|
|
182
192
|
rowImage: {
|
|
183
|
-
width: THUMBNAIL_WIDTH,
|
|
184
|
-
height: THUMBNAIL_HEIGHT,
|
|
185
|
-
borderRadius: 4,
|
|
186
|
-
},
|
|
187
|
-
rowContent: {
|
|
188
|
-
flexShrink: 1,
|
|
193
|
+
width: THUMBNAIL_WIDTH * fontScale,
|
|
194
|
+
height: THUMBNAIL_HEIGHT * fontScale,
|
|
195
|
+
borderRadius: 4 * fontScale,
|
|
189
196
|
},
|
|
190
197
|
rowIconRight: {
|
|
191
|
-
|
|
198
|
+
fontSize: 16,
|
|
192
199
|
color: theme.colors.statusSuccessIcon,
|
|
193
200
|
opacity: isActive ? 1 : 0,
|
|
194
201
|
},
|
|
195
202
|
rowTitle: {
|
|
196
203
|
fontSize: 16,
|
|
197
204
|
flexShrink: 1,
|
|
205
|
+
fontWeight: atFontScaleBreakpoint ? 400 : platformFontWeightBold,
|
|
206
|
+
},
|
|
207
|
+
rowSubtitle: {
|
|
208
|
+
color: atFontScaleBreakpoint
|
|
209
|
+
? theme.colors.textColorDefaultSecondary
|
|
210
|
+
: theme.colors.textColorDefaultPrimary,
|
|
198
211
|
},
|
|
199
212
|
})
|
|
200
213
|
}
|
|
File without changes
|