@planningcenter/chat-react-native 3.39.0-rc.8 → 3.39.0-rc.9
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/hooks/use_current_person.d.ts.map +1 -1
- package/build/hooks/use_current_person.js +1 -0
- package/build/hooks/use_current_person.js.map +1 -1
- package/build/hooks/use_person_settings.d.ts +6 -0
- package/build/hooks/use_person_settings.d.ts.map +1 -0
- package/build/hooks/use_person_settings.js +26 -0
- package/build/hooks/use_person_settings.js.map +1 -0
- package/build/navigation/index.d.ts +13 -0
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +9 -0
- package/build/navigation/index.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 +4 -0
- package/build/screens/conversations/components/list_header_component.js.map +1 -1
- package/build/screens/index.d.ts +1 -0
- package/build/screens/index.d.ts.map +1 -1
- package/build/screens/index.js +1 -0
- package/build/screens/index.js.map +1 -1
- package/build/screens/settings_screen.d.ts +5 -0
- package/build/screens/settings_screen.d.ts.map +1 -0
- package/build/screens/settings_screen.js +56 -0
- package/build/screens/settings_screen.js.map +1 -0
- package/build/types/resources/person.d.ts +1 -0
- package/build/types/resources/person.d.ts.map +1 -1
- package/build/types/resources/person.js.map +1 -1
- package/package.json +2 -2
- package/src/hooks/use_current_person.ts +1 -0
- package/src/hooks/use_person_settings.ts +29 -0
- package/src/navigation/index.tsx +11 -0
- package/src/screens/conversations/components/list_header_component.tsx +12 -0
- package/src/screens/index.ts +1 -0
- package/src/screens/settings_screen.tsx +67 -0
- package/src/types/resources/person.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_current_person.d.ts","sourceRoot":"","sources":["../../src/hooks/use_current_person.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAKhD,eAAO,MAAM,wBAAwB;;;;;;;
|
|
1
|
+
{"version":3,"file":"use_current_person.d.ts","sourceRoot":"","sources":["../../src/hooks/use_current_person.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAKhD,eAAO,MAAM,wBAAwB;;;;;;;CAgBpC,CAAA;AAED,eAAO,MAAM,qBAAqB,8CAA+C,CAAA;AAEjF,eAAO,MAAM,gBAAgB,6BAO5B,CAAA;AAED,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;AAE5D,eAAO,MAAM,qBAAqB;qBAGtB,OAAO,CAAC,qBAAqB,CAAC,kBACvB,aAAa,CAAC,qBAAqB,CAAC;;CActD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_current_person.js","sourceRoot":"","sources":["../../src/hooks/use_current_person.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAGtD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEvE,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,GAAG,EAAE,KAAK;IACV,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,IAAI;gBACJ,MAAM;gBACN,QAAQ;gBACR,UAAU;gBACV,cAAc;gBACd,kBAAkB;gBAClB,0BAA0B;aAC3B;SACF;KACF;CACF,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC,wBAAwB,CAAC,CAAA;AAEjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,cAAc,CAAwB,wBAAwB,EAAE;QACvF,SAAS,EAAE,YAAY;QACvB,MAAM,EAAE,cAAc;KACvB,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAID,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAA;IACpC,MAAM,YAAY,GAAG,CACnB,MAAsC,EACtC,gBAAsD,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,EAChF,EAAE;QACF,WAAW,CAAC,YAAY,CAAqC,qBAAqB,EAAE,IAAI,CAAC,EAAE;YACzF,IAAI,CAAC,IAAI;gBAAE,OAAO,IAAI,CAAA;YAEtB,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAA;QAC5D,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,MAAM,gBAAgB,GAAG,GAAG,EAAE;QAC5B,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,qBAAqB,EAAE,CAAC,CAAA;IACpE,CAAC,CAAA;IAED,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAA;AAC/D,CAAC,CAAA","sourcesContent":["import { useQueryClient } from '@tanstack/react-query'\nimport { CurrentPersonResource } from '../types'\nimport { ApiResource } from '../types/api_primitives'\nimport { FIVE_MINUTES, THIRTY_MINUTES } from '../utils/time'\nimport { getRequestQueryKey, useSuspenseGet } from './use_suspense_api'\n\nexport const currentPersonRequestArgs = {\n url: '/me',\n data: {\n fields: {\n Person: [\n 'id',\n 'name',\n 'avatar',\n 'can_chat',\n 'unread_count',\n 'pco_chat_enabled',\n 'age_qualification_status',\n ],\n },\n },\n}\n\nexport const currentPersonQueryKey = getRequestQueryKey(currentPersonRequestArgs)\n\nexport const useCurrentPerson = () => {\n const { data: person } = useSuspenseGet<CurrentPersonResource>(currentPersonRequestArgs, {\n staleTime: FIVE_MINUTES,\n gcTime: THIRTY_MINUTES,\n })\n\n return person\n}\n\ntype ProcessRecord<T> = (record: T, update: Partial<T>) => T\n\nexport const useCurrentPersonCache = () => {\n const queryClient = useQueryClient()\n const handleUpdate = (\n update: Partial<CurrentPersonResource>,\n processRecord: ProcessRecord<CurrentPersonResource> = (r, u) => ({ ...r, ...u })\n ) => {\n queryClient.setQueryData<ApiResource<CurrentPersonResource>>(currentPersonQueryKey, data => {\n if (!data) return data\n\n return { ...data, data: processRecord(data.data, update) }\n })\n }\n\n const handleInvalidate = () => {\n queryClient.invalidateQueries({ queryKey: currentPersonQueryKey })\n }\n\n return { update: handleUpdate, invalidate: handleInvalidate }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"use_current_person.js","sourceRoot":"","sources":["../../src/hooks/use_current_person.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAGtD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEvE,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,GAAG,EAAE,KAAK;IACV,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,IAAI;gBACJ,MAAM;gBACN,QAAQ;gBACR,UAAU;gBACV,cAAc;gBACd,kBAAkB;gBAClB,0BAA0B;gBAC1B,0BAA0B;aAC3B;SACF;KACF;CACF,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC,wBAAwB,CAAC,CAAA;AAEjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,cAAc,CAAwB,wBAAwB,EAAE;QACvF,SAAS,EAAE,YAAY;QACvB,MAAM,EAAE,cAAc;KACvB,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAID,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAA;IACpC,MAAM,YAAY,GAAG,CACnB,MAAsC,EACtC,gBAAsD,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,EAChF,EAAE;QACF,WAAW,CAAC,YAAY,CAAqC,qBAAqB,EAAE,IAAI,CAAC,EAAE;YACzF,IAAI,CAAC,IAAI;gBAAE,OAAO,IAAI,CAAA;YAEtB,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAA;QAC5D,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,MAAM,gBAAgB,GAAG,GAAG,EAAE;QAC5B,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,qBAAqB,EAAE,CAAC,CAAA;IACpE,CAAC,CAAA;IAED,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAA;AAC/D,CAAC,CAAA","sourcesContent":["import { useQueryClient } from '@tanstack/react-query'\nimport { CurrentPersonResource } from '../types'\nimport { ApiResource } from '../types/api_primitives'\nimport { FIVE_MINUTES, THIRTY_MINUTES } from '../utils/time'\nimport { getRequestQueryKey, useSuspenseGet } from './use_suspense_api'\n\nexport const currentPersonRequestArgs = {\n url: '/me',\n data: {\n fields: {\n Person: [\n 'id',\n 'name',\n 'avatar',\n 'can_chat',\n 'unread_count',\n 'pco_chat_enabled',\n 'age_qualification_status',\n 'direct_messages_disabled',\n ],\n },\n },\n}\n\nexport const currentPersonQueryKey = getRequestQueryKey(currentPersonRequestArgs)\n\nexport const useCurrentPerson = () => {\n const { data: person } = useSuspenseGet<CurrentPersonResource>(currentPersonRequestArgs, {\n staleTime: FIVE_MINUTES,\n gcTime: THIRTY_MINUTES,\n })\n\n return person\n}\n\ntype ProcessRecord<T> = (record: T, update: Partial<T>) => T\n\nexport const useCurrentPersonCache = () => {\n const queryClient = useQueryClient()\n const handleUpdate = (\n update: Partial<CurrentPersonResource>,\n processRecord: ProcessRecord<CurrentPersonResource> = (r, u) => ({ ...r, ...u })\n ) => {\n queryClient.setQueryData<ApiResource<CurrentPersonResource>>(currentPersonQueryKey, data => {\n if (!data) return data\n\n return { ...data, data: processRecord(data.data, update) }\n })\n }\n\n const handleInvalidate = () => {\n queryClient.invalidateQueries({ queryKey: currentPersonQueryKey })\n }\n\n return { update: handleUpdate, invalidate: handleInvalidate }\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function usePersonSettings(): {
|
|
2
|
+
directMessagesDisabled: boolean;
|
|
3
|
+
setDirectMessagesDisabled: import("@tanstack/react-query").UseMutateFunction<import("..").ApiCollection | import("..").ApiResource, Error, boolean, void>;
|
|
4
|
+
isMutating: boolean;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=use_person_settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_person_settings.d.ts","sourceRoot":"","sources":["../../src/hooks/use_person_settings.ts"],"names":[],"mappings":"AAKA,wBAAgB,iBAAiB;;;;EAuBhC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useMutation } from '@tanstack/react-query';
|
|
2
|
+
import { throwResponseError } from '../utils/response_error';
|
|
3
|
+
import { useApiClient } from './use_api_client';
|
|
4
|
+
import { useCurrentPerson, useCurrentPersonCache } from './use_current_person';
|
|
5
|
+
export function usePersonSettings() {
|
|
6
|
+
const apiClient = useApiClient();
|
|
7
|
+
const person = useCurrentPerson();
|
|
8
|
+
const { update, invalidate } = useCurrentPersonCache();
|
|
9
|
+
const directMessagesDisabled = person?.directMessagesDisabled ?? false;
|
|
10
|
+
const { mutate: setDirectMessagesDisabled, isPending: isMutating } = useMutation({
|
|
11
|
+
mutationFn: (disabled) => {
|
|
12
|
+
const action = disabled ? 'disable_direct_messages' : 'enable_direct_messages';
|
|
13
|
+
return apiClient.chat
|
|
14
|
+
.post({ url: `/me/${action}`, data: { data: { type: 'Person', attributes: {} } } })
|
|
15
|
+
.catch(throwResponseError);
|
|
16
|
+
},
|
|
17
|
+
onMutate: disabled => {
|
|
18
|
+
update({ directMessagesDisabled: disabled });
|
|
19
|
+
},
|
|
20
|
+
onError: () => {
|
|
21
|
+
invalidate();
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
return { directMessagesDisabled, setDirectMessagesDisabled, isMutating };
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=use_person_settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_person_settings.js","sourceRoot":"","sources":["../../src/hooks/use_person_settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAE9E,MAAM,UAAU,iBAAiB;IAC/B,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAChC,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAA;IACjC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,qBAAqB,EAAE,CAAA;IAEtD,MAAM,sBAAsB,GAAG,MAAM,EAAE,sBAAsB,IAAI,KAAK,CAAA;IAEtE,MAAM,EAAE,MAAM,EAAE,yBAAyB,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC;QAC/E,UAAU,EAAE,CAAC,QAAiB,EAAE,EAAE;YAChC,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,wBAAwB,CAAA;YAC9E,OAAO,SAAS,CAAC,IAAI;iBAClB,IAAI,CAAC,EAAE,GAAG,EAAE,OAAO,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;iBAClF,KAAK,CAAC,kBAAkB,CAAC,CAAA;QAC9B,CAAC;QACD,QAAQ,EAAE,QAAQ,CAAC,EAAE;YACnB,MAAM,CAAC,EAAE,sBAAsB,EAAE,QAAQ,EAAE,CAAC,CAAA;QAC9C,CAAC;QACD,OAAO,EAAE,GAAG,EAAE;YACZ,UAAU,EAAE,CAAA;QACd,CAAC;KACF,CAAC,CAAA;IAEF,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,UAAU,EAAE,CAAA;AAC1E,CAAC","sourcesContent":["import { useMutation } from '@tanstack/react-query'\nimport { throwResponseError } from '../utils/response_error'\nimport { useApiClient } from './use_api_client'\nimport { useCurrentPerson, useCurrentPersonCache } from './use_current_person'\n\nexport function usePersonSettings() {\n const apiClient = useApiClient()\n const person = useCurrentPerson()\n const { update, invalidate } = useCurrentPersonCache()\n\n const directMessagesDisabled = person?.directMessagesDisabled ?? false\n\n const { mutate: setDirectMessagesDisabled, isPending: isMutating } = useMutation({\n mutationFn: (disabled: boolean) => {\n const action = disabled ? 'disable_direct_messages' : 'enable_direct_messages'\n return apiClient.chat\n .post({ url: `/me/${action}`, data: { data: { type: 'Person', attributes: {} } } })\n .catch(throwResponseError)\n },\n onMutate: disabled => {\n update({ directMessagesDisabled: disabled })\n },\n onError: () => {\n invalidate()\n },\n })\n\n return { directMessagesDisabled, setDirectMessagesDisabled, isMutating }\n}\n"]}
|
|
@@ -23,6 +23,7 @@ import { NotificationSettingsScreen } from '../screens/notification_settings_scr
|
|
|
23
23
|
import { PreferredAppSelectionScreen } from '../screens/preferred_app_selection_screen';
|
|
24
24
|
import { ReactionsScreen } from '../screens/reactions_screen';
|
|
25
25
|
import { SendGiphyScreen } from '../screens/send_giphy_screen';
|
|
26
|
+
import { SettingsScreen } from '../screens/settings_screen';
|
|
26
27
|
import { SystemMessagePeopleScreen } from '../screens/system_message_people_screen';
|
|
27
28
|
import { ScreenLayoutWithChatAccessGate } from './screenLayout';
|
|
28
29
|
export declare const NewConversationStack: import("@react-navigation/core").TypedNavigator<{
|
|
@@ -203,6 +204,18 @@ export declare const ChatStack: import("@react-navigation/core").TypedNavigator<
|
|
|
203
204
|
readonly screen: typeof AvatarPickerScreen;
|
|
204
205
|
readonly options: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
205
206
|
};
|
|
207
|
+
readonly ChatSettings: {
|
|
208
|
+
readonly screen: typeof SettingsScreen;
|
|
209
|
+
readonly options: ({ navigation }: {
|
|
210
|
+
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
211
|
+
navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<import("@react-navigation/routers").ParamListBase, string, undefined>;
|
|
212
|
+
theme: ReactNavigation.Theme;
|
|
213
|
+
}) => {
|
|
214
|
+
title: string;
|
|
215
|
+
headerBackVisible: false;
|
|
216
|
+
headerRight: (props: NativeStackHeaderRightProps) => React.JSX.Element;
|
|
217
|
+
};
|
|
218
|
+
};
|
|
206
219
|
readonly NotificationSettings: {
|
|
207
220
|
readonly screen: typeof NotificationSettingsScreen;
|
|
208
221
|
readonly options: ({ navigation }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAEL,2BAA2B,EAC5B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CA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A2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAqD3B,2BAA2B;;;;;;;;;;;;;;;;qCAc3B,2BAA2B;;;;;;;;;;;;qCAU3B,2BAA2B;;;;;;;;;;;;;;;;;qCAe3B,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDAlN3B,2BAA2B;;;;;;;;;;;;iDAU3B,2BAA2B;;;;;;;;;;;iDAa3B,2BAA2B;;;;;;;;;;;;iDAc3B,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDAkB3B,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6PtD,CAAA;AAEF,KAAK,kBAAkB,GAAG,eAAe,CAAC,OAAO,SAAS,CAAC,CAAA;AAE3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,eAAe,CAAC;QACxB,UAAU,aAAc,SAAQ,kBAAkB;SAAG;KACtD;CACF"}
|
|
@@ -33,6 +33,7 @@ import { NotificationSettingsScreen } from '../screens/notification_settings_scr
|
|
|
33
33
|
import { PreferredAppSelectionScreen } from '../screens/preferred_app_selection_screen';
|
|
34
34
|
import { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen';
|
|
35
35
|
import { SendGiphyScreen, SendGiphyScreenOptions } from '../screens/send_giphy_screen';
|
|
36
|
+
import { SettingsScreen } from '../screens/settings_screen';
|
|
36
37
|
import { SystemMessagePeopleScreen, SystemMessagePeopleScreenOptions, } from '../screens/system_message_people_screen';
|
|
37
38
|
import { TeamConversationScreen } from '../screens/team_conversation_screen';
|
|
38
39
|
import { ScreenLayoutWithChatAccessGate } from './screenLayout';
|
|
@@ -167,6 +168,14 @@ export const ChatStack = createNativeStackNavigator({
|
|
|
167
168
|
screen: AvatarPickerScreen,
|
|
168
169
|
options: AvatarPickerScreenOptions,
|
|
169
170
|
},
|
|
171
|
+
ChatSettings: {
|
|
172
|
+
screen: SettingsScreen,
|
|
173
|
+
options: ({ navigation }) => ({
|
|
174
|
+
title: 'Chat settings',
|
|
175
|
+
headerBackVisible: false,
|
|
176
|
+
headerRight: (props) => (<HeaderTextButton {...props} onPress={navigation.goBack} title="Done"/>),
|
|
177
|
+
}),
|
|
178
|
+
},
|
|
170
179
|
NotificationSettings: {
|
|
171
180
|
screen: NotificationSettingsScreen,
|
|
172
181
|
options: ({ navigation }) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EACL,0BAA0B,GAE3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EACL,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,qDAAqD,CAAA;AAC5D,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACtE,OAAO,EACL,uBAAuB,EACvB,8BAA8B,GAC/B,MAAM,yDAAyD,CAAA;AAChE,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,+BAA+B,GAChC,MAAM,+CAA+C,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACtF,OAAO,EACL,yBAAyB,EACzB,gCAAgC,GACjC,MAAM,sDAAsD,CAAA;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EACL,0CAA0C,EAC1C,kCAAkC,GACnC,MAAM,i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sBAAsB;SAChC;QACD,OAAO,EAAE;YACP,MAAM,EAAE,aAAa;YACrB,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;gBAC5B,WAAW,EAAE,UAAU;gBACvB,iBAAiB,EAAE,KAAK;gBACxB,YAAY,EAAE,OAAO;gBACrB,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,CACpB,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,EAAG,CAC1E;aACF,CAAC;SACH;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE;gBACP,KAAK,EAAE,KAAK;aACb;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,GAAG;aACV;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import { HeaderBackButton } from '@react-navigation/elements'\nimport { StaticParamList } from '@react-navigation/native'\nimport {\n createNativeStackNavigator,\n NativeStackHeaderRightProps,\n} from '@react-navigation/native-stack'\nimport { CardStyleInterpolators } from '@react-navigation/stack'\nimport React from 'react'\nimport { Platform } from 'react-native'\nimport { Icon } from '../components'\nimport {\n HeaderDoneButton,\n HeaderTextButton,\n} from '../components/display/platform_modal_header_buttons'\nimport { useDirectMessagesEnabled, useQualifiedByAge } from '../hooks'\nimport {\n AttachmentActionsScreen,\n AttachmentActionsScreenOptions,\n} from '../screens/attachment_actions/attachment_actions_screen'\nimport {\n AvatarPickerScreen,\n AvatarPickerScreenOptions,\n AvatarPickerCreateScreenOptions,\n} from '../screens/avatar_picker/avatar_picker_screen'\nimport { BugReportScreen, BugReportScreenOptions } from '../screens/bug_report_screen'\nimport {\n MessageReadReceiptsScreen,\n MessageReadReceiptsScreenOptions,\n} from '../screens/conversation/message_read_receipts_screen'\nimport { ConversationDetailsScreen } from '../screens/conversation_details_screen'\nimport {\n ConversationFilterReceipientsScreenOptions,\n ConversationFilterRecipientsScreen,\n} from '../screens/conversation_filter_recipients/conversation_filter_recipients_screen'\nimport { ConversationFiltersParams } from '../screens/conversation_filters/screen_props'\nimport {\n ConversationFiltersScreen,\n ConversationFiltersScreenOptions,\n} from '../screens/conversation_filters_screen'\nimport { ConversationNewScreen } from '../screens/conversation_new/conversation_new_screen'\nimport {\n ConversationNotificationLevelSelectScreen,\n ConversationNotificationLevelSelectScreenOptions,\n} from '../screens/conversation_notification_level_select_screen'\nimport {\n ConversationRouteProps,\n ConversationScreen,\n ConversationScreenTitle,\n} from '../screens/conversation_screen'\nimport { ConversationNewEntryScreen } from '../screens/conversation_select_recipients/conversation_new_entry_screen'\nimport { ConversationSelectDirectMessageRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen'\nimport { ConversationSelectGroupRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_group_recipients_screen'\nimport { ConversationSelectTeamsILeadRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen'\nimport { ConversationSelectRecipientsParams } from '../screens/conversation_select_recipients/types/screen_props'\nimport {\n ConversationSelectTypeScreen,\n ConversationSelectTypeScreenOptions,\n} from '../screens/conversation_select_type_screen'\nimport {\n ConversationsMoreActionsScreen,\n ConversationsMoreActionsScreenOptions,\n} from '../screens/conversations/conversations_more_actions_screen'\nimport { ConversationsScreen } from '../screens/conversations/conversations_screen'\nimport { GetHelpScreen } from '../screens/get_help_screen'\nimport {\n GroupNotificationLevelSelectScreen,\n GroupNotificationLevelSelectScreenOptions,\n} from '../screens/group_notification_level_select_screen'\nimport { GroupNotificationSettingsScreen } from '../screens/group_notification_settings_screen'\nimport {\n MessageActionsScreen,\n MessageActionsScreenOptions,\n} from '../screens/message_actions_screen'\nimport { MessageReportScreen, MessageReportScreenOptions } from '../screens/message_report_screen'\nimport { NotFound } from '../screens/not_found'\nimport { NotificationSettingsScreen } from '../screens/notification_settings_screen'\nimport { PreferredAppSelectionScreen } from '../screens/preferred_app_selection_screen'\nimport { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen'\nimport { SendGiphyScreen, SendGiphyScreenOptions } from '../screens/send_giphy_screen'\nimport {\n SystemMessagePeopleScreen,\n SystemMessagePeopleScreenOptions,\n} from '../screens/system_message_people_screen'\nimport { TeamConversationScreen } from '../screens/team_conversation_screen'\nimport { ScreenLayoutWithChatAccessGate } from './screenLayout'\n\nconst HEADER_BACK_BUTTON_LAYOUT_RESET_STYLES = {\n marginLeft: Platform.select({ ios: -8, default: -3 }),\n marginRight: Platform.select({ ios: 0, default: 30 }),\n}\n\nexport const NewConversationStack = createNativeStackNavigator({\n initialRouteName: 'ConversationNewEntry',\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayoutWithChatAccessGate,\n screens: {\n ConversationNewEntry: {\n screen: ConversationNewEntryScreen,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderTextButton {...props} onPress={navigation.goBack} title=\"Cancel\" />\n ),\n headerBackVisible: false,\n }),\n },\n ConversationSelectGroupRecipients: {\n screen: ConversationSelectGroupRecipientsScreen,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderTextButton\n {...props}\n onPress={() => navigation.popTo('Conversations', route.params)}\n title=\"Cancel\"\n />\n ),\n }),\n },\n ConversationSelectTeamsILeadRecipients: {\n screen: ConversationSelectTeamsILeadRecipientsScreen,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderTextButton\n {...props}\n onPress={() => navigation.popTo('Conversations', route.params)}\n title=\"Cancel\"\n />\n ),\n }),\n },\n ConversationSelectDirectMessageRecipients: {\n screen: ConversationSelectDirectMessageRecipientsScreen,\n if: useDirectMessagesEnabled,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderTextButton\n {...props}\n onPress={() => navigation.popTo('Conversations', route.params)}\n title=\"Cancel\"\n />\n ),\n }),\n },\n ConversationFilterRecipients: {\n screen: ConversationFilterRecipientsScreen,\n options: ConversationFilterReceipientsScreenOptions,\n },\n ConversationNew: {\n screen: ConversationNewScreen,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerLeft: () => null,\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderTextButton\n {...props}\n onPress={() => {\n const { chat_group_graph_id, group_source_app_name } =\n route.params as ConversationSelectRecipientsParams\n navigation.popTo('Conversations', { chat_group_graph_id, group_source_app_name })\n }}\n title=\"Cancel\"\n />\n ),\n }),\n },\n AvatarPicker: {\n screen: AvatarPickerScreen,\n options: AvatarPickerCreateScreenOptions,\n },\n },\n})\n\nexport const ChatStack = createNativeStackNavigator({\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayoutWithChatAccessGate,\n screens: {\n Conversations: {\n screen: ConversationsScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerBackVisible: false,\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderBackButton\n backImage={() => <Icon name=\"general.x\" size={18} color={props.tintColor} />}\n onPress={navigation.goBack}\n {...props}\n />\n ),\n }),\n },\n ConversationFilters: {\n screen: ConversationFiltersScreen,\n options: ConversationFiltersScreenOptions,\n },\n Conversation: {\n screen: ConversationScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (props: NativeStackHeaderRightProps) => {\n const { conversation_id, title, badge, deleted, muted } =\n route.params as ConversationRouteProps\n\n return (\n <ConversationScreenTitle\n conversation_id={conversation_id}\n badge={badge}\n deleted={deleted}\n muted={muted}\n {...props}\n >\n {title ?? 'Conversation'}\n </ConversationScreenTitle>\n )\n },\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderBackButton\n backImage={() => <Icon name=\"general.x\" size={18} color={props.tintColor} />}\n onPress={() => navigation.getParent()?.goBack()}\n />\n ),\n headerLeft: props => (\n <HeaderBackButton\n style={HEADER_BACK_BUTTON_LAYOUT_RESET_STYLES}\n displayMode=\"minimal\"\n onPress={() => {\n const params = route.params as ConversationRouteProps\n if ((params as ConversationFiltersParams)?.chat_group_graph_id) {\n // Ensure that conversations with a graph id pass them back to the conversation list\n const { chat_group_graph_id } = params\n navigation.popTo('Conversations', { chat_group_graph_id })\n } else {\n navigation.goBack()\n }\n }}\n {...props}\n />\n ),\n }),\n },\n ConversationReply: {\n screen: ConversationScreen,\n options: ({ route, navigation }) => ({\n title: (route.params as ConversationRouteProps)?.title ?? 'Reply',\n headerLeft: props => (\n <HeaderBackButton\n style={HEADER_BACK_BUTTON_LAYOUT_RESET_STYLES}\n displayMode=\"minimal\"\n onPress={() => navigation.goBack()}\n {...props}\n />\n ),\n }),\n },\n TeamConversation: {\n screen: TeamConversationScreen,\n if: useQualifiedByAge,\n options: {\n title: 'Finding conversation...',\n animation: 'none',\n cardStyleInterpolator: CardStyleInterpolators.forNoAnimation,\n },\n },\n ConversationDetails: {\n screen: ConversationDetailsScreen,\n options: ({ navigation }) => ({\n presentation: 'modal',\n title: 'Conversation details',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderTextButton {...props} onPress={navigation.goBack} title=\"Done\" />\n ),\n }),\n },\n AvatarPicker: {\n screen: AvatarPickerScreen,\n options: AvatarPickerScreenOptions,\n },\n NotificationSettings: {\n screen: NotificationSettingsScreen,\n options: ({ navigation }) => ({\n title: 'Chat',\n headerBackVisible: false,\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderTextButton {...props} onPress={navigation.goBack} title=\"Done\" />\n ),\n }),\n },\n PreferredAppSelection: {\n screen: PreferredAppSelectionScreen,\n options: {\n title: 'Preferred app',\n },\n },\n GroupNotificationSettings: {\n screen: GroupNotificationSettingsScreen,\n options: ({ route, navigation }) => ({\n title: (route.params as { title?: string })?.title || 'Group Settings',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderDoneButton {...props} navigation={navigation} />\n ),\n }),\n },\n GroupNotificationLevelSelect: {\n screen: GroupNotificationLevelSelectScreen,\n options: GroupNotificationLevelSelectScreenOptions,\n },\n ConversationNotificationLevelSelect: {\n screen: ConversationNotificationLevelSelectScreen,\n options: ConversationNotificationLevelSelectScreenOptions,\n },\n New: {\n screen: NewConversationStack,\n if: useQualifiedByAge,\n options: {\n headerShown: false,\n presentation: 'modal',\n },\n },\n GroupConversationNew: {\n screen: ConversationNewScreen,\n if: useQualifiedByAge,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerLeft: () => null,\n headerRight: props => (\n <HeaderTextButton\n {...props}\n onPress={() => navigation.getParent()?.goBack()}\n title=\"Cancel\"\n />\n ),\n }),\n },\n SendGiphy: {\n screen: SendGiphyScreen,\n options: SendGiphyScreenOptions,\n },\n ConversationsMoreActions: {\n screen: ConversationsMoreActionsScreen,\n options: ConversationsMoreActionsScreenOptions,\n },\n MessageActions: {\n screen: MessageActionsScreen,\n // Something about sheetAllowedDetents declared inline breaks TS\n options: MessageActionsScreenOptions,\n },\n MessageReport: {\n screen: MessageReportScreen,\n options: MessageReportScreenOptions,\n },\n AttachmentActions: {\n screen: AttachmentActionsScreen,\n options: AttachmentActionsScreenOptions,\n },\n ConversationSelectType: {\n screen: ConversationSelectTypeScreen,\n options: ConversationSelectTypeScreenOptions,\n },\n Reactions: {\n screen: ReactionsScreen,\n options: ReactionsScreenOptions,\n },\n SystemMessagePeople: {\n screen: SystemMessagePeopleScreen,\n options: SystemMessagePeopleScreenOptions,\n },\n MessageReadReceipts: {\n screen: MessageReadReceiptsScreen,\n options: MessageReadReceiptsScreenOptions,\n },\n BugReport: {\n screen: BugReportScreen,\n options: BugReportScreenOptions,\n },\n GetHelp: {\n screen: GetHelpScreen,\n options: ({ navigation }) => ({\n headerTitle: 'Get help',\n headerBackVisible: false,\n presentation: 'modal',\n headerRight: props => (\n <HeaderTextButton {...props} onPress={navigation.goBack} title=\"Close\" />\n ),\n }),\n },\n NotFound: {\n screen: NotFound,\n options: {\n title: '404',\n },\n linking: {\n path: '*',\n },\n },\n },\n})\n\ntype ChatStackParamList = StaticParamList<typeof ChatStack>\n\ndeclare global {\n namespace ReactNavigation {\n interface RootParamList extends ChatStackParamList {}\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EACL,0BAA0B,GAE3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EACL,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,qDAAqD,CAAA;AAC5D,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACtE,OAAO,EACL,uBAAuB,EACvB,8BAA8B,GAC/B,MAAM,yDAAyD,CAAA;AAChE,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,+BAA+B,GAChC,MAAM,+CAA+C,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACtF,OAAO,EACL,yBAAyB,EACzB,gCAAgC,GACjC,MAAM,sDAAsD,CAAA;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EACL,0CAA0C,EAC1C,kCAAkC,GACnC,MAAM,iFAAiF,CAAA;AAExF,OAAO,EACL,yBAAyB,EACzB,gCAAgC,GACjC,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAA;AAC3F,OAAO,EACL,y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eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,mBAAmB,EAAE;YACnB,MAAM,EAAE,yBAAyB;YACjC,OAAO,EAAE,gCAAgC;SAC1C;QACD,mBAAmB,EAAE;YACnB,MAAM,EAAE,yBAAyB;YACjC,OAAO,EAAE,gCAAgC;SAC1C;QACD,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,OAAO,EAAE;YACP,MAAM,EAAE,aAAa;YACrB,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;gBAC5B,WAAW,EAAE,UAAU;gBACvB,iBAAiB,EAAE,KAAK;gBACxB,YAAY,EAAE,OAAO;gBACrB,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,CACpB,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,EAAG,CAC1E;aACF,CAAC;SACH;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE;gBACP,KAAK,EAAE,KAAK;aACb;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,GAAG;aACV;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import { HeaderBackButton } from '@react-navigation/elements'\nimport { StaticParamList } from '@react-navigation/native'\nimport {\n createNativeStackNavigator,\n NativeStackHeaderRightProps,\n} from '@react-navigation/native-stack'\nimport { CardStyleInterpolators } from '@react-navigation/stack'\nimport React from 'react'\nimport { Platform } from 'react-native'\nimport { Icon } from '../components'\nimport {\n HeaderDoneButton,\n HeaderTextButton,\n} from '../components/display/platform_modal_header_buttons'\nimport { useDirectMessagesEnabled, useQualifiedByAge } from '../hooks'\nimport {\n AttachmentActionsScreen,\n AttachmentActionsScreenOptions,\n} from '../screens/attachment_actions/attachment_actions_screen'\nimport {\n AvatarPickerScreen,\n AvatarPickerScreenOptions,\n AvatarPickerCreateScreenOptions,\n} from '../screens/avatar_picker/avatar_picker_screen'\nimport { BugReportScreen, BugReportScreenOptions } from '../screens/bug_report_screen'\nimport {\n MessageReadReceiptsScreen,\n MessageReadReceiptsScreenOptions,\n} from '../screens/conversation/message_read_receipts_screen'\nimport { ConversationDetailsScreen } from '../screens/conversation_details_screen'\nimport {\n ConversationFilterReceipientsScreenOptions,\n ConversationFilterRecipientsScreen,\n} from '../screens/conversation_filter_recipients/conversation_filter_recipients_screen'\nimport { ConversationFiltersParams } from '../screens/conversation_filters/screen_props'\nimport {\n ConversationFiltersScreen,\n ConversationFiltersScreenOptions,\n} from '../screens/conversation_filters_screen'\nimport { ConversationNewScreen } from '../screens/conversation_new/conversation_new_screen'\nimport {\n ConversationNotificationLevelSelectScreen,\n ConversationNotificationLevelSelectScreenOptions,\n} from '../screens/conversation_notification_level_select_screen'\nimport {\n ConversationRouteProps,\n ConversationScreen,\n ConversationScreenTitle,\n} from '../screens/conversation_screen'\nimport { ConversationNewEntryScreen } from '../screens/conversation_select_recipients/conversation_new_entry_screen'\nimport { ConversationSelectDirectMessageRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen'\nimport { ConversationSelectGroupRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_group_recipients_screen'\nimport { ConversationSelectTeamsILeadRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen'\nimport { ConversationSelectRecipientsParams } from '../screens/conversation_select_recipients/types/screen_props'\nimport {\n ConversationSelectTypeScreen,\n ConversationSelectTypeScreenOptions,\n} from '../screens/conversation_select_type_screen'\nimport {\n ConversationsMoreActionsScreen,\n ConversationsMoreActionsScreenOptions,\n} from '../screens/conversations/conversations_more_actions_screen'\nimport { ConversationsScreen } from '../screens/conversations/conversations_screen'\nimport { GetHelpScreen } from '../screens/get_help_screen'\nimport {\n GroupNotificationLevelSelectScreen,\n GroupNotificationLevelSelectScreenOptions,\n} from '../screens/group_notification_level_select_screen'\nimport { GroupNotificationSettingsScreen } from '../screens/group_notification_settings_screen'\nimport {\n MessageActionsScreen,\n MessageActionsScreenOptions,\n} from '../screens/message_actions_screen'\nimport { MessageReportScreen, MessageReportScreenOptions } from '../screens/message_report_screen'\nimport { NotFound } from '../screens/not_found'\nimport { NotificationSettingsScreen } from '../screens/notification_settings_screen'\nimport { PreferredAppSelectionScreen } from '../screens/preferred_app_selection_screen'\nimport { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen'\nimport { SendGiphyScreen, SendGiphyScreenOptions } from '../screens/send_giphy_screen'\nimport { SettingsScreen } from '../screens/settings_screen'\nimport {\n SystemMessagePeopleScreen,\n SystemMessagePeopleScreenOptions,\n} from '../screens/system_message_people_screen'\nimport { TeamConversationScreen } from '../screens/team_conversation_screen'\nimport { ScreenLayoutWithChatAccessGate } from './screenLayout'\n\nconst HEADER_BACK_BUTTON_LAYOUT_RESET_STYLES = {\n marginLeft: Platform.select({ ios: -8, default: -3 }),\n marginRight: Platform.select({ ios: 0, default: 30 }),\n}\n\nexport const NewConversationStack = createNativeStackNavigator({\n initialRouteName: 'ConversationNewEntry',\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayoutWithChatAccessGate,\n screens: {\n ConversationNewEntry: {\n screen: ConversationNewEntryScreen,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderTextButton {...props} onPress={navigation.goBack} title=\"Cancel\" />\n ),\n headerBackVisible: false,\n }),\n },\n ConversationSelectGroupRecipients: {\n screen: ConversationSelectGroupRecipientsScreen,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderTextButton\n {...props}\n onPress={() => navigation.popTo('Conversations', route.params)}\n title=\"Cancel\"\n />\n ),\n }),\n },\n ConversationSelectTeamsILeadRecipients: {\n screen: ConversationSelectTeamsILeadRecipientsScreen,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderTextButton\n {...props}\n onPress={() => navigation.popTo('Conversations', route.params)}\n title=\"Cancel\"\n />\n ),\n }),\n },\n ConversationSelectDirectMessageRecipients: {\n screen: ConversationSelectDirectMessageRecipientsScreen,\n if: useDirectMessagesEnabled,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderTextButton\n {...props}\n onPress={() => navigation.popTo('Conversations', route.params)}\n title=\"Cancel\"\n />\n ),\n }),\n },\n ConversationFilterRecipients: {\n screen: ConversationFilterRecipientsScreen,\n options: ConversationFilterReceipientsScreenOptions,\n },\n ConversationNew: {\n screen: ConversationNewScreen,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerLeft: () => null,\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderTextButton\n {...props}\n onPress={() => {\n const { chat_group_graph_id, group_source_app_name } =\n route.params as ConversationSelectRecipientsParams\n navigation.popTo('Conversations', { chat_group_graph_id, group_source_app_name })\n }}\n title=\"Cancel\"\n />\n ),\n }),\n },\n AvatarPicker: {\n screen: AvatarPickerScreen,\n options: AvatarPickerCreateScreenOptions,\n },\n },\n})\n\nexport const ChatStack = createNativeStackNavigator({\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayoutWithChatAccessGate,\n screens: {\n Conversations: {\n screen: ConversationsScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerBackVisible: false,\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderBackButton\n backImage={() => <Icon name=\"general.x\" size={18} color={props.tintColor} />}\n onPress={navigation.goBack}\n {...props}\n />\n ),\n }),\n },\n ConversationFilters: {\n screen: ConversationFiltersScreen,\n options: ConversationFiltersScreenOptions,\n },\n Conversation: {\n screen: ConversationScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (props: NativeStackHeaderRightProps) => {\n const { conversation_id, title, badge, deleted, muted } =\n route.params as ConversationRouteProps\n\n return (\n <ConversationScreenTitle\n conversation_id={conversation_id}\n badge={badge}\n deleted={deleted}\n muted={muted}\n {...props}\n >\n {title ?? 'Conversation'}\n </ConversationScreenTitle>\n )\n },\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderBackButton\n backImage={() => <Icon name=\"general.x\" size={18} color={props.tintColor} />}\n onPress={() => navigation.getParent()?.goBack()}\n />\n ),\n headerLeft: props => (\n <HeaderBackButton\n style={HEADER_BACK_BUTTON_LAYOUT_RESET_STYLES}\n displayMode=\"minimal\"\n onPress={() => {\n const params = route.params as ConversationRouteProps\n if ((params as ConversationFiltersParams)?.chat_group_graph_id) {\n // Ensure that conversations with a graph id pass them back to the conversation list\n const { chat_group_graph_id } = params\n navigation.popTo('Conversations', { chat_group_graph_id })\n } else {\n navigation.goBack()\n }\n }}\n {...props}\n />\n ),\n }),\n },\n ConversationReply: {\n screen: ConversationScreen,\n options: ({ route, navigation }) => ({\n title: (route.params as ConversationRouteProps)?.title ?? 'Reply',\n headerLeft: props => (\n <HeaderBackButton\n style={HEADER_BACK_BUTTON_LAYOUT_RESET_STYLES}\n displayMode=\"minimal\"\n onPress={() => navigation.goBack()}\n {...props}\n />\n ),\n }),\n },\n TeamConversation: {\n screen: TeamConversationScreen,\n if: useQualifiedByAge,\n options: {\n title: 'Finding conversation...',\n animation: 'none',\n cardStyleInterpolator: CardStyleInterpolators.forNoAnimation,\n },\n },\n ConversationDetails: {\n screen: ConversationDetailsScreen,\n options: ({ navigation }) => ({\n presentation: 'modal',\n title: 'Conversation details',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderTextButton {...props} onPress={navigation.goBack} title=\"Done\" />\n ),\n }),\n },\n AvatarPicker: {\n screen: AvatarPickerScreen,\n options: AvatarPickerScreenOptions,\n },\n ChatSettings: {\n screen: SettingsScreen,\n options: ({ navigation }) => ({\n title: 'Chat settings',\n headerBackVisible: false,\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderTextButton {...props} onPress={navigation.goBack} title=\"Done\" />\n ),\n }),\n },\n NotificationSettings: {\n screen: NotificationSettingsScreen,\n options: ({ navigation }) => ({\n title: 'Chat',\n headerBackVisible: false,\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderTextButton {...props} onPress={navigation.goBack} title=\"Done\" />\n ),\n }),\n },\n PreferredAppSelection: {\n screen: PreferredAppSelectionScreen,\n options: {\n title: 'Preferred app',\n },\n },\n GroupNotificationSettings: {\n screen: GroupNotificationSettingsScreen,\n options: ({ route, navigation }) => ({\n title: (route.params as { title?: string })?.title || 'Group Settings',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderDoneButton {...props} navigation={navigation} />\n ),\n }),\n },\n GroupNotificationLevelSelect: {\n screen: GroupNotificationLevelSelectScreen,\n options: GroupNotificationLevelSelectScreenOptions,\n },\n ConversationNotificationLevelSelect: {\n screen: ConversationNotificationLevelSelectScreen,\n options: ConversationNotificationLevelSelectScreenOptions,\n },\n New: {\n screen: NewConversationStack,\n if: useQualifiedByAge,\n options: {\n headerShown: false,\n presentation: 'modal',\n },\n },\n GroupConversationNew: {\n screen: ConversationNewScreen,\n if: useQualifiedByAge,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerLeft: () => null,\n headerRight: props => (\n <HeaderTextButton\n {...props}\n onPress={() => navigation.getParent()?.goBack()}\n title=\"Cancel\"\n />\n ),\n }),\n },\n SendGiphy: {\n screen: SendGiphyScreen,\n options: SendGiphyScreenOptions,\n },\n ConversationsMoreActions: {\n screen: ConversationsMoreActionsScreen,\n options: ConversationsMoreActionsScreenOptions,\n },\n MessageActions: {\n screen: MessageActionsScreen,\n // Something about sheetAllowedDetents declared inline breaks TS\n options: MessageActionsScreenOptions,\n },\n MessageReport: {\n screen: MessageReportScreen,\n options: MessageReportScreenOptions,\n },\n AttachmentActions: {\n screen: AttachmentActionsScreen,\n options: AttachmentActionsScreenOptions,\n },\n ConversationSelectType: {\n screen: ConversationSelectTypeScreen,\n options: ConversationSelectTypeScreenOptions,\n },\n Reactions: {\n screen: ReactionsScreen,\n options: ReactionsScreenOptions,\n },\n SystemMessagePeople: {\n screen: SystemMessagePeopleScreen,\n options: SystemMessagePeopleScreenOptions,\n },\n MessageReadReceipts: {\n screen: MessageReadReceiptsScreen,\n options: MessageReadReceiptsScreenOptions,\n },\n BugReport: {\n screen: BugReportScreen,\n options: BugReportScreenOptions,\n },\n GetHelp: {\n screen: GetHelpScreen,\n options: ({ navigation }) => ({\n headerTitle: 'Get help',\n headerBackVisible: false,\n presentation: 'modal',\n headerRight: props => (\n <HeaderTextButton {...props} onPress={navigation.goBack} title=\"Close\" />\n ),\n }),\n },\n NotFound: {\n screen: NotFound,\n options: {\n title: '404',\n },\n linking: {\n path: '*',\n },\n },\n },\n})\n\ntype ChatStackParamList = StaticParamList<typeof ChatStack>\n\ndeclare global {\n namespace ReactNavigation {\n interface RootParamList extends ChatStackParamList {}\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list_header_component.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversations/components/list_header_component.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAA;AAiCnD,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"list_header_component.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversations/components/list_header_component.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAA;AAiCnD,eAAO,MAAM,mBAAmB,yBAgO/B,CAAA"}
|
|
@@ -70,6 +70,9 @@ export const ListHeaderComponent = () => {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
}, [navigation, route.params, entryMode, newConversationFromFilter]);
|
|
73
|
+
const handleChatSettings = useCallback(() => {
|
|
74
|
+
navigation.navigate('ChatSettings', {});
|
|
75
|
+
}, [navigation]);
|
|
73
76
|
const handleMoreOptions = useCallback(() => {
|
|
74
77
|
navigation.navigate('ConversationsMoreActions');
|
|
75
78
|
}, [navigation]);
|
|
@@ -118,6 +121,7 @@ export const ListHeaderComponent = () => {
|
|
|
118
121
|
</TextButton>
|
|
119
122
|
</View>
|
|
120
123
|
<View style={styles.actionsContainer}>
|
|
124
|
+
{directMessagesEnabled && (<ListHeaderActionButton name="general.cog" onPress={handleChatSettings} accessibilityLabel="Chat settings" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}/>)}
|
|
121
125
|
{canCreateConversations && (<ListHeaderActionButton name="churchCenter.signups" onPress={handleNewConversationNavigation} accessibilityLabel="New conversation" testID="conversations-new-conversation-button" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}/>)}
|
|
122
126
|
{appName !== 'services' && (<ListHeaderActionButton name="general.threeDots" onPress={handleMoreOptions} accessibilityLabel="More options" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}/>)}
|
|
123
127
|
{shouldShowHeaderFiltersButton && <ToggleButton {...moreFiltersButtonProps}/>}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list_header_component.js","sourceRoot":"","sources":["../../../../src/screens/conversations/components/list_header_component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,uBAAuB,EACvB,QAAQ,GACT,MAAM,gBAAgB,CAA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YAC5B,GAAG,EAAE,CAAC;YACN,iBAAiB,EAAE,sBAAsB;YACzC,QAAQ,EAAE,CAAC;SACZ;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,CAAC;YACP,QAAQ,EAAE,EAAE;SACb;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { RouteProp, useNavigation, useRoute } from '@react-navigation/native'\nimport React, { useCallback, useMemo } from 'react'\nimport { Alert, ScrollView, StyleSheet, View } from 'react-native'\nimport { Heading, TextButton, ToggleButton } from '../../../components'\nimport {\n useAtFontScaleBreakpoint,\n useCanCreateConversations,\n useCurrentPersonCache,\n useDirectMessagesEnabled,\n useHasDirectMessages,\n useNewConversationEntry,\n useTheme,\n} from '../../../hooks'\nimport { useAppName } from '../../../hooks/use_app_name'\nimport { useMarkAllRead } from '../../../hooks/use_conversations_actions'\nimport { useCanDisplayGroups } from '../../../hooks/use_groups'\nimport { useNewConversationFromFilter } from '../../../hooks/use_new_conversation_from_filter'\nimport { GraphId } from '../../../types/resources/group_resource'\nimport { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../../utils'\nimport { Haptic } from '../../../utils/native_adapters'\nimport { ConversationsScreenProps } from '../conversations_screen'\nimport { ChatGroupBadge } from './chat_group_badge'\nimport { ListHeaderActionButton } from './list_header_action_button'\n\nconst ROW_PADDING_HORIZONTAL = 16\n\nenum FilterTypes {\n All = 'All',\n Groups = 'Groups',\n Teams = 'Teams',\n DMs = 'DMs',\n More = 'More',\n}\n\nexport const ListHeaderComponent = () => {\n const navigation = useNavigation()\n const canFilterByTeams = useCanDisplayGroups({ source_app_name: 'Services', source_type: 'Team' })\n const canFilterByGroups = useCanDisplayGroups({ source_app_name: 'Groups', source_type: 'Group' })\n const directMessagesEnabled = useDirectMessagesEnabled()\n const hasDirectMessages = useHasDirectMessages()\n const canFilterByDMs = directMessagesEnabled && hasDirectMessages\n const route = useRoute<RouteProp<ConversationsScreenProps['route']>>()\n const {\n chat_group_graph_id,\n group_source_app_name = '',\n show_direct_messages,\n } = route.params || {}\n const currentPersonCache = useCurrentPersonCache()\n const { markAllRead, isPending } = useMarkAllRead()\n const canCreateConversations = useCanCreateConversations()\n const entryMode = useNewConversationEntry()\n const newConversationFromFilter = useNewConversationFromFilter(\n chat_group_graph_id as GraphId | undefined\n )\n const appName = useAppName()\n\n const active: FilterTypes = useMemo(() => {\n if (chat_group_graph_id) {\n return FilterTypes.More\n } else if (/groups/i.test(group_source_app_name)) {\n return FilterTypes.Groups\n } else if (/services/i.test(group_source_app_name)) {\n return FilterTypes.Teams\n } else if (show_direct_messages) {\n return FilterTypes.DMs\n }\n\n return FilterTypes.All\n }, [chat_group_graph_id, group_source_app_name, show_direct_messages])\n\n const handleNewConversationNavigation = useCallback(() => {\n if (newConversationFromFilter || entryMode === 'select_type') {\n return navigation.navigate('ConversationSelectType', {\n ...route.params,\n newConversationFromFilter,\n })\n }\n\n if (entryMode === 'groups') {\n return navigation.navigate('New', {\n screen: 'ConversationSelectGroupRecipients',\n params: { ...route.params },\n })\n }\n\n if (entryMode === 'teams') {\n return navigation.navigate('New', {\n screen: 'ConversationSelectTeamsILeadRecipients',\n params: { ...route.params },\n })\n }\n }, [navigation, route.params, entryMode, newConversationFromFilter])\n\n const handleMoreOptions = useCallback(() => {\n navigation.navigate('ConversationsMoreActions')\n }, [navigation])\n\n const handleOpenConversationFilters = useCallback(() => {\n navigation.navigate('ConversationFilters', {\n chat_group_graph_id,\n group_source_app_name,\n show_direct_messages,\n })\n }, [navigation, chat_group_graph_id, group_source_app_name, show_direct_messages])\n\n const handleMarkAllRead = useCallback(() => {\n currentPersonCache.update({ unreadCount: 0 })\n Haptic.notificationSuccess()\n markAllRead()\n }, [currentPersonCache, markAllRead])\n\n const alertMarkAllRead = useCallback(() => {\n if (active === FilterTypes.All) return handleMarkAllRead()\n\n Alert.alert('Mark all read', 'This includes conversations not shown by the current filter.', [\n { text: 'Cancel' },\n { text: 'OK', onPress: () => handleMarkAllRead() },\n ])\n }, [active, handleMarkAllRead])\n\n const hasSomeSourceFilterCapability = canFilterByTeams || canFilterByGroups\n const hasMultiSourceFilterCapabilities = canFilterByTeams && canFilterByGroups\n const showFilterRow = hasMultiSourceFilterCapabilities || canFilterByDMs\n const shouldShowHeaderFiltersButton = hasSomeSourceFilterCapability && !showFilterRow\n const moreFiltersButtonA11yLabel = shouldShowHeaderFiltersButton\n ? 'View filters'\n : 'View more filters'\n\n const moreFiltersButtonProps = {\n onPress: handleOpenConversationFilters,\n active: active === FilterTypes.More,\n iconNameRight: 'general.threeReducingHorizontalBars' as const,\n accessibilityLabel: moreFiltersButtonA11yLabel,\n }\n\n const styles = useStyles({ shouldShowHeaderFiltersButton })\n\n return (\n <View style={styles.listHeader}>\n <View style={styles.headingRow}>\n <View style={styles.titleContainer}>\n <Heading numberOfLines={1} variant=\"h2\">\n Conversations\n </Heading>\n <TextButton\n onPress={alertMarkAllRead}\n disabled={isPending}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n accessibilityShowsLargeContentViewer\n accessibilityLargeContentTitle=\"Mark all read\"\n >\n Mark all read\n </TextButton>\n </View>\n <View style={styles.actionsContainer}>\n {canCreateConversations && (\n <ListHeaderActionButton\n name=\"churchCenter.signups\"\n onPress={handleNewConversationNavigation}\n accessibilityLabel=\"New conversation\"\n testID=\"conversations-new-conversation-button\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n />\n )}\n {appName !== 'services' && (\n <ListHeaderActionButton\n name=\"general.threeDots\"\n onPress={handleMoreOptions}\n accessibilityLabel=\"More options\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n />\n )}\n {shouldShowHeaderFiltersButton && <ToggleButton {...moreFiltersButtonProps} />}\n </View>\n </View>\n {showFilterRow && (\n <ScrollView\n horizontal\n showsHorizontalScrollIndicator={false}\n contentContainerStyle={styles.filterRow}\n accessibilityRole=\"toolbar\"\n >\n <ToggleButton\n title={FilterTypes.All}\n active={active === FilterTypes.All}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: undefined,\n show_direct_messages: undefined,\n })\n }\n accessibilityLabel=\"Show all conversations\"\n style={styles.filterButton}\n />\n {canFilterByGroups && (\n <ToggleButton\n title={FilterTypes.Groups}\n active={active === FilterTypes.Groups}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: 'Groups',\n show_direct_messages: undefined,\n })\n }\n accessibilityLabel=\"Filter to group conversations\"\n style={styles.filterButton}\n />\n )}\n {canFilterByTeams && (\n <ToggleButton\n title={FilterTypes.Teams}\n active={active === FilterTypes.Teams}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: 'Services',\n show_direct_messages: undefined,\n })\n }\n accessibilityLabel=\"Filter to team conversations\"\n style={styles.filterButton}\n />\n )}\n {canFilterByDMs && (\n <ToggleButton\n title={FilterTypes.DMs}\n active={active === FilterTypes.DMs}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: undefined,\n show_direct_messages: true,\n })\n }\n accessibilityLabel=\"Filter to direct message conversations\"\n style={styles.filterButton}\n />\n )}\n <ToggleButton {...moreFiltersButtonProps} />\n </ScrollView>\n )}\n <ChatGroupBadge rowPaddingHorizontal={ROW_PADDING_HORIZONTAL} />\n </View>\n )\n}\n\nconst useStyles = ({\n shouldShowHeaderFiltersButton,\n}: {\n shouldShowHeaderFiltersButton: boolean\n}) => {\n const theme = useTheme()\n const atFontScaleBreakpoint = useAtFontScaleBreakpoint(\n shouldShowHeaderFiltersButton ? 1.2 : undefined\n )\n\n return StyleSheet.create({\n listHeader: {\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.fillColorNeutral050Base,\n paddingBottom: 16,\n gap: 16,\n },\n headingRow: {\n gap: 12,\n flexDirection: atFontScaleBreakpoint ? 'column' : 'row',\n alignItems: atFontScaleBreakpoint ? 'flex-start' : 'center',\n justifyContent: 'space-between',\n paddingBottom: atFontScaleBreakpoint ? 4 : 0,\n paddingHorizontal: ROW_PADDING_HORIZONTAL,\n },\n titleContainer: {\n gap: 8,\n },\n actionsContainer: {\n flexDirection: 'row',\n gap: 8,\n alignItems: 'center',\n },\n markAllReadRow: {\n paddingBottom: 4,\n },\n filterRow: {\n flexDirection: 'row',\n justifyContent: 'flex-start',\n gap: 8,\n paddingHorizontal: ROW_PADDING_HORIZONTAL,\n flexGrow: 1,\n },\n filterButton: {\n flex: 1,\n minWidth: 65,\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"list_header_component.js","sourceRoot":"","sources":["../../../../src/screens/conversations/components/list_header_component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,uBAAuB,EACvB,QAAQ,GACT,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAA;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAA;AAE9F,OAAO,EAAE,iCAAiC,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAA;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,oBA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YAC5B,GAAG,EAAE,CAAC;YACN,iBAAiB,EAAE,sBAAsB;YACzC,QAAQ,EAAE,CAAC;SACZ;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,CAAC;YACP,QAAQ,EAAE,EAAE;SACb;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { RouteProp, useNavigation, useRoute } from '@react-navigation/native'\nimport React, { useCallback, useMemo } from 'react'\nimport { Alert, ScrollView, StyleSheet, View } from 'react-native'\nimport { Heading, TextButton, ToggleButton } from '../../../components'\nimport {\n useAtFontScaleBreakpoint,\n useCanCreateConversations,\n useCurrentPersonCache,\n useDirectMessagesEnabled,\n useHasDirectMessages,\n useNewConversationEntry,\n useTheme,\n} from '../../../hooks'\nimport { useAppName } from '../../../hooks/use_app_name'\nimport { useMarkAllRead } from '../../../hooks/use_conversations_actions'\nimport { useCanDisplayGroups } from '../../../hooks/use_groups'\nimport { useNewConversationFromFilter } from '../../../hooks/use_new_conversation_from_filter'\nimport { GraphId } from '../../../types/resources/group_resource'\nimport { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../../utils'\nimport { Haptic } from '../../../utils/native_adapters'\nimport { ConversationsScreenProps } from '../conversations_screen'\nimport { ChatGroupBadge } from './chat_group_badge'\nimport { ListHeaderActionButton } from './list_header_action_button'\n\nconst ROW_PADDING_HORIZONTAL = 16\n\nenum FilterTypes {\n All = 'All',\n Groups = 'Groups',\n Teams = 'Teams',\n DMs = 'DMs',\n More = 'More',\n}\n\nexport const ListHeaderComponent = () => {\n const navigation = useNavigation()\n const canFilterByTeams = useCanDisplayGroups({ source_app_name: 'Services', source_type: 'Team' })\n const canFilterByGroups = useCanDisplayGroups({ source_app_name: 'Groups', source_type: 'Group' })\n const directMessagesEnabled = useDirectMessagesEnabled()\n const hasDirectMessages = useHasDirectMessages()\n const canFilterByDMs = directMessagesEnabled && hasDirectMessages\n const route = useRoute<RouteProp<ConversationsScreenProps['route']>>()\n const {\n chat_group_graph_id,\n group_source_app_name = '',\n show_direct_messages,\n } = route.params || {}\n const currentPersonCache = useCurrentPersonCache()\n const { markAllRead, isPending } = useMarkAllRead()\n const canCreateConversations = useCanCreateConversations()\n const entryMode = useNewConversationEntry()\n const newConversationFromFilter = useNewConversationFromFilter(\n chat_group_graph_id as GraphId | undefined\n )\n const appName = useAppName()\n\n const active: FilterTypes = useMemo(() => {\n if (chat_group_graph_id) {\n return FilterTypes.More\n } else if (/groups/i.test(group_source_app_name)) {\n return FilterTypes.Groups\n } else if (/services/i.test(group_source_app_name)) {\n return FilterTypes.Teams\n } else if (show_direct_messages) {\n return FilterTypes.DMs\n }\n\n return FilterTypes.All\n }, [chat_group_graph_id, group_source_app_name, show_direct_messages])\n\n const handleNewConversationNavigation = useCallback(() => {\n if (newConversationFromFilter || entryMode === 'select_type') {\n return navigation.navigate('ConversationSelectType', {\n ...route.params,\n newConversationFromFilter,\n })\n }\n\n if (entryMode === 'groups') {\n return navigation.navigate('New', {\n screen: 'ConversationSelectGroupRecipients',\n params: { ...route.params },\n })\n }\n\n if (entryMode === 'teams') {\n return navigation.navigate('New', {\n screen: 'ConversationSelectTeamsILeadRecipients',\n params: { ...route.params },\n })\n }\n }, [navigation, route.params, entryMode, newConversationFromFilter])\n\n const handleChatSettings = useCallback(() => {\n navigation.navigate('ChatSettings', {})\n }, [navigation])\n\n const handleMoreOptions = useCallback(() => {\n navigation.navigate('ConversationsMoreActions')\n }, [navigation])\n\n const handleOpenConversationFilters = useCallback(() => {\n navigation.navigate('ConversationFilters', {\n chat_group_graph_id,\n group_source_app_name,\n show_direct_messages,\n })\n }, [navigation, chat_group_graph_id, group_source_app_name, show_direct_messages])\n\n const handleMarkAllRead = useCallback(() => {\n currentPersonCache.update({ unreadCount: 0 })\n Haptic.notificationSuccess()\n markAllRead()\n }, [currentPersonCache, markAllRead])\n\n const alertMarkAllRead = useCallback(() => {\n if (active === FilterTypes.All) return handleMarkAllRead()\n\n Alert.alert('Mark all read', 'This includes conversations not shown by the current filter.', [\n { text: 'Cancel' },\n { text: 'OK', onPress: () => handleMarkAllRead() },\n ])\n }, [active, handleMarkAllRead])\n\n const hasSomeSourceFilterCapability = canFilterByTeams || canFilterByGroups\n const hasMultiSourceFilterCapabilities = canFilterByTeams && canFilterByGroups\n const showFilterRow = hasMultiSourceFilterCapabilities || canFilterByDMs\n const shouldShowHeaderFiltersButton = hasSomeSourceFilterCapability && !showFilterRow\n const moreFiltersButtonA11yLabel = shouldShowHeaderFiltersButton\n ? 'View filters'\n : 'View more filters'\n\n const moreFiltersButtonProps = {\n onPress: handleOpenConversationFilters,\n active: active === FilterTypes.More,\n iconNameRight: 'general.threeReducingHorizontalBars' as const,\n accessibilityLabel: moreFiltersButtonA11yLabel,\n }\n\n const styles = useStyles({ shouldShowHeaderFiltersButton })\n\n return (\n <View style={styles.listHeader}>\n <View style={styles.headingRow}>\n <View style={styles.titleContainer}>\n <Heading numberOfLines={1} variant=\"h2\">\n Conversations\n </Heading>\n <TextButton\n onPress={alertMarkAllRead}\n disabled={isPending}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n accessibilityShowsLargeContentViewer\n accessibilityLargeContentTitle=\"Mark all read\"\n >\n Mark all read\n </TextButton>\n </View>\n <View style={styles.actionsContainer}>\n {directMessagesEnabled && (\n <ListHeaderActionButton\n name=\"general.cog\"\n onPress={handleChatSettings}\n accessibilityLabel=\"Chat settings\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n />\n )}\n {canCreateConversations && (\n <ListHeaderActionButton\n name=\"churchCenter.signups\"\n onPress={handleNewConversationNavigation}\n accessibilityLabel=\"New conversation\"\n testID=\"conversations-new-conversation-button\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n />\n )}\n {appName !== 'services' && (\n <ListHeaderActionButton\n name=\"general.threeDots\"\n onPress={handleMoreOptions}\n accessibilityLabel=\"More options\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n />\n )}\n {shouldShowHeaderFiltersButton && <ToggleButton {...moreFiltersButtonProps} />}\n </View>\n </View>\n {showFilterRow && (\n <ScrollView\n horizontal\n showsHorizontalScrollIndicator={false}\n contentContainerStyle={styles.filterRow}\n accessibilityRole=\"toolbar\"\n >\n <ToggleButton\n title={FilterTypes.All}\n active={active === FilterTypes.All}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: undefined,\n show_direct_messages: undefined,\n })\n }\n accessibilityLabel=\"Show all conversations\"\n style={styles.filterButton}\n />\n {canFilterByGroups && (\n <ToggleButton\n title={FilterTypes.Groups}\n active={active === FilterTypes.Groups}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: 'Groups',\n show_direct_messages: undefined,\n })\n }\n accessibilityLabel=\"Filter to group conversations\"\n style={styles.filterButton}\n />\n )}\n {canFilterByTeams && (\n <ToggleButton\n title={FilterTypes.Teams}\n active={active === FilterTypes.Teams}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: 'Services',\n show_direct_messages: undefined,\n })\n }\n accessibilityLabel=\"Filter to team conversations\"\n style={styles.filterButton}\n />\n )}\n {canFilterByDMs && (\n <ToggleButton\n title={FilterTypes.DMs}\n active={active === FilterTypes.DMs}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: undefined,\n show_direct_messages: true,\n })\n }\n accessibilityLabel=\"Filter to direct message conversations\"\n style={styles.filterButton}\n />\n )}\n <ToggleButton {...moreFiltersButtonProps} />\n </ScrollView>\n )}\n <ChatGroupBadge rowPaddingHorizontal={ROW_PADDING_HORIZONTAL} />\n </View>\n )\n}\n\nconst useStyles = ({\n shouldShowHeaderFiltersButton,\n}: {\n shouldShowHeaderFiltersButton: boolean\n}) => {\n const theme = useTheme()\n const atFontScaleBreakpoint = useAtFontScaleBreakpoint(\n shouldShowHeaderFiltersButton ? 1.2 : undefined\n )\n\n return StyleSheet.create({\n listHeader: {\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.fillColorNeutral050Base,\n paddingBottom: 16,\n gap: 16,\n },\n headingRow: {\n gap: 12,\n flexDirection: atFontScaleBreakpoint ? 'column' : 'row',\n alignItems: atFontScaleBreakpoint ? 'flex-start' : 'center',\n justifyContent: 'space-between',\n paddingBottom: atFontScaleBreakpoint ? 4 : 0,\n paddingHorizontal: ROW_PADDING_HORIZONTAL,\n },\n titleContainer: {\n gap: 8,\n },\n actionsContainer: {\n flexDirection: 'row',\n gap: 8,\n alignItems: 'center',\n },\n markAllReadRow: {\n paddingBottom: 4,\n },\n filterRow: {\n flexDirection: 'row',\n justifyContent: 'flex-start',\n gap: 8,\n paddingHorizontal: ROW_PADDING_HORIZONTAL,\n flexGrow: 1,\n },\n filterButton: {\n flex: 1,\n minWidth: 65,\n },\n })\n}\n"]}
|
package/build/screens/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/screens/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,4CAA4C,CAAA;AAC1D,cAAc,gCAAgC,CAAA;AAC9C,cAAc,kCAAkC,CAAA;AAChD,cAAc,sCAAsC,CAAA;AACpD,cAAc,wEAAwE,CAAA;AACtF,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,6CAA6C,CAAA;AAC3D,cAAc,+BAA+B,CAAA;AAC7C,cAAc,qCAAqC,CAAA;AACnD,cAAc,8EAA8E,CAAA;AAC5F,cAAc,qFAAqF,CAAA;AACnG,cAAc,gDAAgD,CAAA;AAC9D,cAAc,sCAAsC,CAAA;AACpD,cAAc,gCAAgC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/screens/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,4CAA4C,CAAA;AAC1D,cAAc,gCAAgC,CAAA;AAC9C,cAAc,kCAAkC,CAAA;AAChD,cAAc,sCAAsC,CAAA;AACpD,cAAc,wEAAwE,CAAA;AACtF,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,6CAA6C,CAAA;AAC3D,cAAc,+BAA+B,CAAA;AAC7C,cAAc,qCAAqC,CAAA;AACnD,cAAc,8EAA8E,CAAA;AAC5F,cAAc,qFAAqF,CAAA;AACnG,cAAc,gDAAgD,CAAA;AAC9D,cAAc,sCAAsC,CAAA;AACpD,cAAc,gCAAgC,CAAA"}
|
package/build/screens/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/screens/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,4CAA4C,CAAA;AAC1D,cAAc,gCAAgC,CAAA;AAC9C,cAAc,kCAAkC,CAAA;AAChD,cAAc,sCAAsC,CAAA;AACpD,cAAc,wEAAwE,CAAA;AACtF,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,6CAA6C,CAAA;AAC3D,cAAc,+BAA+B,CAAA;AAC7C,cAAc,qCAAqC,CAAA;AACnD,cAAc,8EAA8E,CAAA;AAC5F,cAAc,qFAAqF,CAAA;AACnG,cAAc,gDAAgD,CAAA;AAC9D,cAAc,sCAAsC,CAAA;AACpD,cAAc,gCAAgC,CAAA","sourcesContent":["export * from './design_system_screen'\nexport * from './conversation_details_screen'\nexport * from './conversation_screen'\nexport * from './conversation_new/conversation_new_screen'\nexport * from './notification_settings_screen'\nexport * from './preferred_app_selection_screen'\nexport * from './group_notification_settings_screen'\nexport * from './conversation_filter_recipients/conversation_filter_recipients_screen'\nexport * from './message_actions_screen'\nexport * from './message_report_screen'\nexport * from './send_giphy_screen'\nexport * from './not_found'\nexport * from './reactions_screen'\nexport * from './team_conversation_screen'\nexport * from './bug_report_screen'\nexport * from './conversation/message_read_receipts_screen'\nexport * from './conversation_filters_screen'\nexport * from './conversation_filters/screen_props'\nexport * from './conversation_select_recipients/conversation_select_group_recipients_screen'\nexport * from './conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen'\nexport * from './attachment_actions/attachment_actions_screen'\nexport * from './conversations/conversations_screen'\nexport * from './system_message_people_screen'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/screens/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,4CAA4C,CAAA;AAC1D,cAAc,gCAAgC,CAAA;AAC9C,cAAc,kCAAkC,CAAA;AAChD,cAAc,sCAAsC,CAAA;AACpD,cAAc,wEAAwE,CAAA;AACtF,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,6CAA6C,CAAA;AAC3D,cAAc,+BAA+B,CAAA;AAC7C,cAAc,qCAAqC,CAAA;AACnD,cAAc,8EAA8E,CAAA;AAC5F,cAAc,qFAAqF,CAAA;AACnG,cAAc,gDAAgD,CAAA;AAC9D,cAAc,sCAAsC,CAAA;AACpD,cAAc,gCAAgC,CAAA","sourcesContent":["export * from './settings_screen'\nexport * from './design_system_screen'\nexport * from './conversation_details_screen'\nexport * from './conversation_screen'\nexport * from './conversation_new/conversation_new_screen'\nexport * from './notification_settings_screen'\nexport * from './preferred_app_selection_screen'\nexport * from './group_notification_settings_screen'\nexport * from './conversation_filter_recipients/conversation_filter_recipients_screen'\nexport * from './message_actions_screen'\nexport * from './message_report_screen'\nexport * from './send_giphy_screen'\nexport * from './not_found'\nexport * from './reactions_screen'\nexport * from './team_conversation_screen'\nexport * from './bug_report_screen'\nexport * from './conversation/message_read_receipts_screen'\nexport * from './conversation_filters_screen'\nexport * from './conversation_filters/screen_props'\nexport * from './conversation_select_recipients/conversation_select_group_recipients_screen'\nexport * from './conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen'\nexport * from './attachment_actions/attachment_actions_screen'\nexport * from './conversations/conversations_screen'\nexport * from './system_message_people_screen'\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type SettingsScreenProps = StaticScreenProps<{}>;
|
|
4
|
+
export declare function SettingsScreen({}: SettingsScreenProps): React.JSX.Element;
|
|
5
|
+
//# sourceMappingURL=settings_screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings_screen.d.ts","sourceRoot":"","sources":["../../src/screens/settings_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAA;AAEvD,wBAAgB,cAAc,CAAC,EAAE,EAAE,mBAAmB,qBA0BrD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import { Heading, Text } from '../components';
|
|
4
|
+
import { Switch } from '../components/display/switch';
|
|
5
|
+
import { useTheme } from '../hooks';
|
|
6
|
+
import { usePersonSettings } from '../hooks/use_person_settings';
|
|
7
|
+
export function SettingsScreen({}) {
|
|
8
|
+
const styles = useStyles();
|
|
9
|
+
const { directMessagesDisabled, setDirectMessagesDisabled, isMutating } = usePersonSettings();
|
|
10
|
+
return (<View style={styles.container}>
|
|
11
|
+
<View style={styles.sectionOuter}>
|
|
12
|
+
<View style={styles.sectionHeader}>
|
|
13
|
+
<Heading variant="h2">Messages</Heading>
|
|
14
|
+
</View>
|
|
15
|
+
<View style={styles.settingRow}>
|
|
16
|
+
<View style={styles.settingRowText}>
|
|
17
|
+
<Text>Allow direct messages</Text>
|
|
18
|
+
<Text variant="tertiary">
|
|
19
|
+
When disabled, you won't be able to participate in direct messages.
|
|
20
|
+
</Text>
|
|
21
|
+
</View>
|
|
22
|
+
<Switch value={!directMessagesDisabled} onValueChange={enabled => setDirectMessagesDisabled(!enabled)} disabled={isMutating}/>
|
|
23
|
+
</View>
|
|
24
|
+
</View>
|
|
25
|
+
</View>);
|
|
26
|
+
}
|
|
27
|
+
const useStyles = () => {
|
|
28
|
+
const { colors } = useTheme();
|
|
29
|
+
return StyleSheet.create({
|
|
30
|
+
container: {
|
|
31
|
+
flex: 1,
|
|
32
|
+
},
|
|
33
|
+
sectionOuter: {
|
|
34
|
+
paddingLeft: 16,
|
|
35
|
+
},
|
|
36
|
+
sectionHeader: {
|
|
37
|
+
paddingRight: 16,
|
|
38
|
+
paddingTop: 24,
|
|
39
|
+
paddingBottom: 12,
|
|
40
|
+
borderBottomWidth: 1,
|
|
41
|
+
borderBottomColor: colors.borderColorDefaultBase,
|
|
42
|
+
},
|
|
43
|
+
settingRow: {
|
|
44
|
+
flexDirection: 'row',
|
|
45
|
+
alignItems: 'flex-start',
|
|
46
|
+
justifyContent: 'space-between',
|
|
47
|
+
paddingRight: 16,
|
|
48
|
+
paddingVertical: 12,
|
|
49
|
+
},
|
|
50
|
+
settingRowText: {
|
|
51
|
+
flex: 1,
|
|
52
|
+
gap: 8,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=settings_screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings_screen.js","sourceRoot":"","sources":["../../src/screens/settings_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAIhE,MAAM,UAAU,cAAc,CAAC,EAAuB;IACpD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,UAAU,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAE7F,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAC/B;QAAA,CAAC,IAAI,CAAC,KAAK,CAAC,C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ACD,cAAc,EAAE;YACd,IAAI,EAAE,CAAC;YACP,GAAG,EAAE,CAAC;SACP;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StaticScreenProps } from '@react-navigation/native'\nimport React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Heading, Text } from '../components'\nimport { Switch } from '../components/display/switch'\nimport { useTheme } from '../hooks'\nimport { usePersonSettings } from '../hooks/use_person_settings'\n\nexport type SettingsScreenProps = StaticScreenProps<{}>\n\nexport function SettingsScreen({}: SettingsScreenProps) {\n const styles = useStyles()\n const { directMessagesDisabled, setDirectMessagesDisabled, isMutating } = usePersonSettings()\n\n return (\n <View style={styles.container}>\n <View style={styles.sectionOuter}>\n <View style={styles.sectionHeader}>\n <Heading variant=\"h2\">Messages</Heading>\n </View>\n <View style={styles.settingRow}>\n <View style={styles.settingRowText}>\n <Text>Allow direct messages</Text>\n <Text variant=\"tertiary\">\n When disabled, you won't be able to participate in direct messages.\n </Text>\n </View>\n <Switch\n value={!directMessagesDisabled}\n onValueChange={enabled => setDirectMessagesDisabled(!enabled)}\n disabled={isMutating}\n />\n </View>\n </View>\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n container: {\n flex: 1,\n },\n sectionOuter: {\n paddingLeft: 16,\n },\n sectionHeader: {\n paddingRight: 16,\n paddingTop: 24,\n paddingBottom: 12,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n settingRow: {\n flexDirection: 'row',\n alignItems: 'flex-start',\n justifyContent: 'space-between',\n paddingRight: 16,\n paddingVertical: 12,\n },\n settingRowText: {\n flex: 1,\n gap: 8,\n },\n })\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"person.d.ts","sourceRoot":"","sources":["../../../src/types/resources/person.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,eAAO,MAAM,sBAAsB;;;;CAIzB,CAAA;AAEV,MAAM,MAAM,sBAAsB,GAChC,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,OAAO,sBAAsB,CAAC,CAAA;AAEtE,MAAM,WAAW,cAAe,SAAQ,cAAc;IACpD,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,OAAO,CAAA;IACvB,sBAAsB,CAAC,EAAE,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"person.d.ts","sourceRoot":"","sources":["../../../src/types/resources/person.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,eAAO,MAAM,sBAAsB;;;;CAIzB,CAAA;AAEV,MAAM,MAAM,sBAAsB,GAChC,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,OAAO,sBAAsB,CAAC,CAAA;AAEtE,MAAM,WAAW,cAAe,SAAQ,cAAc;IACpD,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,OAAO,CAAA;IACvB,sBAAsB,CAAC,EAAE,sBAAsB,CAAA;IAC/C,sBAAsB,EAAE,OAAO,CAAA;CAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"person.js","sourceRoot":"","sources":["../../../src/types/resources/person.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,SAAS,EAAE,WAAW;IACtB,YAAY,EAAE,cAAc;IAC5B,OAAO,EAAE,SAAS;CACV,CAAA","sourcesContent":["import { ResourceObject } from '../api_primitives'\n\nexport const AgeQualificationStatus = {\n QUALIFIED: 'qualified',\n DISQUALIFIED: 'disqualified',\n UNKNOWN: 'unknown',\n} as const\n\nexport type AgeQualificationStatus =\n (typeof AgeQualificationStatus)[keyof typeof AgeQualificationStatus]\n\nexport interface PersonResource extends ResourceObject {\n id: number\n type: 'Person'\n name: string\n avatar: string\n}\n\nexport interface CurrentPersonResource extends PersonResource {\n canChat: boolean\n unreadCount: number\n pcoChatEnabled: boolean\n ageQualificationStatus?: AgeQualificationStatus\n}\n"]}
|
|
1
|
+
{"version":3,"file":"person.js","sourceRoot":"","sources":["../../../src/types/resources/person.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,SAAS,EAAE,WAAW;IACtB,YAAY,EAAE,cAAc;IAC5B,OAAO,EAAE,SAAS;CACV,CAAA","sourcesContent":["import { ResourceObject } from '../api_primitives'\n\nexport const AgeQualificationStatus = {\n QUALIFIED: 'qualified',\n DISQUALIFIED: 'disqualified',\n UNKNOWN: 'unknown',\n} as const\n\nexport type AgeQualificationStatus =\n (typeof AgeQualificationStatus)[keyof typeof AgeQualificationStatus]\n\nexport interface PersonResource extends ResourceObject {\n id: number\n type: 'Person'\n name: string\n avatar: string\n}\n\nexport interface CurrentPersonResource extends PersonResource {\n canChat: boolean\n unreadCount: number\n pcoChatEnabled: boolean\n ageQualificationStatus?: AgeQualificationStatus\n directMessagesDisabled: boolean\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/chat-react-native",
|
|
3
|
-
"version": "3.39.0-rc.
|
|
3
|
+
"version": "3.39.0-rc.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"react-native": "./src/index.tsx",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"react-native-url-polyfill": "^2.0.0",
|
|
73
73
|
"typescript": "~5.9.2"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "efc42ba18a6b517142779c36df3eb96ce6606d1f"
|
|
76
76
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useMutation } from '@tanstack/react-query'
|
|
2
|
+
import { throwResponseError } from '../utils/response_error'
|
|
3
|
+
import { useApiClient } from './use_api_client'
|
|
4
|
+
import { useCurrentPerson, useCurrentPersonCache } from './use_current_person'
|
|
5
|
+
|
|
6
|
+
export function usePersonSettings() {
|
|
7
|
+
const apiClient = useApiClient()
|
|
8
|
+
const person = useCurrentPerson()
|
|
9
|
+
const { update, invalidate } = useCurrentPersonCache()
|
|
10
|
+
|
|
11
|
+
const directMessagesDisabled = person?.directMessagesDisabled ?? false
|
|
12
|
+
|
|
13
|
+
const { mutate: setDirectMessagesDisabled, isPending: isMutating } = useMutation({
|
|
14
|
+
mutationFn: (disabled: boolean) => {
|
|
15
|
+
const action = disabled ? 'disable_direct_messages' : 'enable_direct_messages'
|
|
16
|
+
return apiClient.chat
|
|
17
|
+
.post({ url: `/me/${action}`, data: { data: { type: 'Person', attributes: {} } } })
|
|
18
|
+
.catch(throwResponseError)
|
|
19
|
+
},
|
|
20
|
+
onMutate: disabled => {
|
|
21
|
+
update({ directMessagesDisabled: disabled })
|
|
22
|
+
},
|
|
23
|
+
onError: () => {
|
|
24
|
+
invalidate()
|
|
25
|
+
},
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
return { directMessagesDisabled, setDirectMessagesDisabled, isMutating }
|
|
29
|
+
}
|
package/src/navigation/index.tsx
CHANGED
|
@@ -77,6 +77,7 @@ import { NotificationSettingsScreen } from '../screens/notification_settings_scr
|
|
|
77
77
|
import { PreferredAppSelectionScreen } from '../screens/preferred_app_selection_screen'
|
|
78
78
|
import { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen'
|
|
79
79
|
import { SendGiphyScreen, SendGiphyScreenOptions } from '../screens/send_giphy_screen'
|
|
80
|
+
import { SettingsScreen } from '../screens/settings_screen'
|
|
80
81
|
import {
|
|
81
82
|
SystemMessagePeopleScreen,
|
|
82
83
|
SystemMessagePeopleScreenOptions,
|
|
@@ -280,6 +281,16 @@ export const ChatStack = createNativeStackNavigator({
|
|
|
280
281
|
screen: AvatarPickerScreen,
|
|
281
282
|
options: AvatarPickerScreenOptions,
|
|
282
283
|
},
|
|
284
|
+
ChatSettings: {
|
|
285
|
+
screen: SettingsScreen,
|
|
286
|
+
options: ({ navigation }) => ({
|
|
287
|
+
title: 'Chat settings',
|
|
288
|
+
headerBackVisible: false,
|
|
289
|
+
headerRight: (props: NativeStackHeaderRightProps) => (
|
|
290
|
+
<HeaderTextButton {...props} onPress={navigation.goBack} title="Done" />
|
|
291
|
+
),
|
|
292
|
+
}),
|
|
293
|
+
},
|
|
283
294
|
NotificationSettings: {
|
|
284
295
|
screen: NotificationSettingsScreen,
|
|
285
296
|
options: ({ navigation }) => ({
|
|
@@ -91,6 +91,10 @@ export const ListHeaderComponent = () => {
|
|
|
91
91
|
}
|
|
92
92
|
}, [navigation, route.params, entryMode, newConversationFromFilter])
|
|
93
93
|
|
|
94
|
+
const handleChatSettings = useCallback(() => {
|
|
95
|
+
navigation.navigate('ChatSettings', {})
|
|
96
|
+
}, [navigation])
|
|
97
|
+
|
|
94
98
|
const handleMoreOptions = useCallback(() => {
|
|
95
99
|
navigation.navigate('ConversationsMoreActions')
|
|
96
100
|
}, [navigation])
|
|
@@ -153,6 +157,14 @@ export const ListHeaderComponent = () => {
|
|
|
153
157
|
</TextButton>
|
|
154
158
|
</View>
|
|
155
159
|
<View style={styles.actionsContainer}>
|
|
160
|
+
{directMessagesEnabled && (
|
|
161
|
+
<ListHeaderActionButton
|
|
162
|
+
name="general.cog"
|
|
163
|
+
onPress={handleChatSettings}
|
|
164
|
+
accessibilityLabel="Chat settings"
|
|
165
|
+
maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}
|
|
166
|
+
/>
|
|
167
|
+
)}
|
|
156
168
|
{canCreateConversations && (
|
|
157
169
|
<ListHeaderActionButton
|
|
158
170
|
name="churchCenter.signups"
|
package/src/screens/index.ts
CHANGED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { StaticScreenProps } from '@react-navigation/native'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { StyleSheet, View } from 'react-native'
|
|
4
|
+
import { Heading, Text } from '../components'
|
|
5
|
+
import { Switch } from '../components/display/switch'
|
|
6
|
+
import { useTheme } from '../hooks'
|
|
7
|
+
import { usePersonSettings } from '../hooks/use_person_settings'
|
|
8
|
+
|
|
9
|
+
export type SettingsScreenProps = StaticScreenProps<{}>
|
|
10
|
+
|
|
11
|
+
export function SettingsScreen({}: SettingsScreenProps) {
|
|
12
|
+
const styles = useStyles()
|
|
13
|
+
const { directMessagesDisabled, setDirectMessagesDisabled, isMutating } = usePersonSettings()
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<View style={styles.container}>
|
|
17
|
+
<View style={styles.sectionOuter}>
|
|
18
|
+
<View style={styles.sectionHeader}>
|
|
19
|
+
<Heading variant="h2">Messages</Heading>
|
|
20
|
+
</View>
|
|
21
|
+
<View style={styles.settingRow}>
|
|
22
|
+
<View style={styles.settingRowText}>
|
|
23
|
+
<Text>Allow direct messages</Text>
|
|
24
|
+
<Text variant="tertiary">
|
|
25
|
+
When disabled, you won't be able to participate in direct messages.
|
|
26
|
+
</Text>
|
|
27
|
+
</View>
|
|
28
|
+
<Switch
|
|
29
|
+
value={!directMessagesDisabled}
|
|
30
|
+
onValueChange={enabled => setDirectMessagesDisabled(!enabled)}
|
|
31
|
+
disabled={isMutating}
|
|
32
|
+
/>
|
|
33
|
+
</View>
|
|
34
|
+
</View>
|
|
35
|
+
</View>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const useStyles = () => {
|
|
40
|
+
const { colors } = useTheme()
|
|
41
|
+
return StyleSheet.create({
|
|
42
|
+
container: {
|
|
43
|
+
flex: 1,
|
|
44
|
+
},
|
|
45
|
+
sectionOuter: {
|
|
46
|
+
paddingLeft: 16,
|
|
47
|
+
},
|
|
48
|
+
sectionHeader: {
|
|
49
|
+
paddingRight: 16,
|
|
50
|
+
paddingTop: 24,
|
|
51
|
+
paddingBottom: 12,
|
|
52
|
+
borderBottomWidth: 1,
|
|
53
|
+
borderBottomColor: colors.borderColorDefaultBase,
|
|
54
|
+
},
|
|
55
|
+
settingRow: {
|
|
56
|
+
flexDirection: 'row',
|
|
57
|
+
alignItems: 'flex-start',
|
|
58
|
+
justifyContent: 'space-between',
|
|
59
|
+
paddingRight: 16,
|
|
60
|
+
paddingVertical: 12,
|
|
61
|
+
},
|
|
62
|
+
settingRowText: {
|
|
63
|
+
flex: 1,
|
|
64
|
+
gap: 8,
|
|
65
|
+
},
|
|
66
|
+
})
|
|
67
|
+
}
|