@planningcenter/chat-react-native 3.16.0-rc.5 → 3.16.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/contexts/chat_context.d.ts +3 -0
- package/build/contexts/chat_context.d.ts.map +1 -1
- package/build/contexts/chat_context.js +3 -1
- package/build/contexts/chat_context.js.map +1 -1
- package/build/hooks/index.d.ts +3 -0
- package/build/hooks/index.d.ts.map +1 -1
- package/build/hooks/index.js +3 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use_current_person.d.ts.map +1 -1
- package/build/hooks/use_current_person.js +9 -1
- package/build/hooks/use_current_person.js.map +1 -1
- package/build/hooks/use_organization.d.ts +39 -0
- package/build/hooks/use_organization.d.ts.map +1 -0
- package/build/hooks/use_organization.js +14 -0
- package/build/hooks/use_organization.js.map +1 -0
- package/build/hooks/use_qualified_by_age.d.ts +2 -0
- package/build/hooks/use_qualified_by_age.d.ts.map +1 -0
- package/build/hooks/use_qualified_by_age.js +14 -0
- package/build/hooks/use_qualified_by_age.js.map +1 -0
- package/build/hooks/use_submit_age_check.d.ts +78 -0
- package/build/hooks/use_submit_age_check.d.ts.map +1 -0
- package/build/hooks/use_submit_age_check.js +37 -0
- package/build/hooks/use_submit_age_check.js.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/navigation/chat_access_gate.d.ts +3 -0
- package/build/navigation/chat_access_gate.d.ts.map +1 -0
- package/build/navigation/chat_access_gate.js +46 -0
- package/build/navigation/chat_access_gate.js.map +1 -0
- package/build/navigation/index.d.ts +6 -4
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +6 -3
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/screenLayout.d.ts +3 -0
- package/build/navigation/screenLayout.d.ts.map +1 -1
- package/build/navigation/screenLayout.js +8 -0
- package/build/navigation/screenLayout.js.map +1 -1
- package/build/screens/age_check/age_check_required_screen.d.ts +3 -0
- package/build/screens/age_check/age_check_required_screen.d.ts.map +1 -0
- package/build/screens/age_check/age_check_required_screen.js +148 -0
- package/build/screens/age_check/age_check_required_screen.js.map +1 -0
- package/build/screens/age_check/age_check_underage_screen.d.ts +6 -0
- package/build/screens/age_check/age_check_underage_screen.d.ts.map +1 -0
- package/build/screens/age_check/age_check_underage_screen.js +71 -0
- package/build/screens/age_check/age_check_underage_screen.js.map +1 -0
- package/build/screens/age_check/components/age_check_select_birthdate_modal.d.ts +11 -0
- package/build/screens/age_check/components/age_check_select_birthdate_modal.d.ts.map +1 -0
- package/build/screens/age_check/components/age_check_select_birthdate_modal.js +91 -0
- package/build/screens/age_check/components/age_check_select_birthdate_modal.js.map +1 -0
- package/build/screens/age_check/index.d.ts +3 -0
- package/build/screens/age_check/index.d.ts.map +1 -0
- package/build/screens/age_check/index.js +3 -0
- package/build/screens/age_check/index.js.map +1 -0
- package/build/screens/age_check/screen_props.d.ts +5 -0
- package/build/screens/age_check/screen_props.d.ts.map +1 -0
- package/build/screens/age_check/screen_props.js +2 -0
- package/build/screens/age_check/screen_props.js.map +1 -0
- package/build/types/resources/index.d.ts +1 -0
- package/build/types/resources/index.d.ts.map +1 -1
- package/build/types/resources/index.js +1 -0
- package/build/types/resources/index.js.map +1 -1
- package/build/types/resources/organization.d.ts +6 -0
- package/build/types/resources/organization.d.ts.map +1 -0
- package/build/types/resources/organization.js +2 -0
- package/build/types/resources/organization.js.map +1 -0
- package/build/types/resources/person.d.ts +7 -0
- package/build/types/resources/person.d.ts.map +1 -1
- package/build/types/resources/person.js +5 -1
- package/build/types/resources/person.js.map +1 -1
- package/package.json +3 -2
- package/src/contexts/chat_context.tsx +14 -1
- package/src/hooks/index.ts +3 -0
- package/src/hooks/use_current_person.ts +9 -1
- package/src/hooks/use_organization.ts +17 -0
- package/src/hooks/use_qualified_by_age.ts +17 -0
- package/src/hooks/use_submit_age_check.ts +48 -0
- package/src/index.tsx +1 -0
- package/src/navigation/chat_access_gate.tsx +60 -0
- package/src/navigation/index.tsx +6 -3
- package/src/navigation/screenLayout.tsx +11 -0
- package/src/screens/age_check/age_check_required_screen.tsx +197 -0
- package/src/screens/age_check/age_check_underage_screen.tsx +96 -0
- package/src/screens/age_check/components/age_check_select_birthdate_modal.tsx +143 -0
- package/src/screens/age_check/index.ts +2 -0
- package/src/screens/age_check/screen_props.ts +3 -0
- package/src/types/resources/index.ts +1 -0
- package/src/types/resources/organization.ts +6 -0
- package/src/types/resources/person.ts +10 -0
|
@@ -3,9 +3,11 @@ import { ColorSchemeName } from 'react-native';
|
|
|
3
3
|
import { DeepPartial } from '../types';
|
|
4
4
|
import { ENV, OauthType, PartialToken, ResponseError, Session } from '../utils';
|
|
5
5
|
import { ChatTheme, DefaultTheme } from '../utils/theme';
|
|
6
|
+
import { AgeCheckContactInfo } from '../screens/age_check/screen_props';
|
|
6
7
|
export interface ChatProviderProps {
|
|
7
8
|
env?: ENV;
|
|
8
9
|
giphyApiKey?: string;
|
|
10
|
+
onAgeDisqualification?: (params: AgeCheckContactInfo) => void;
|
|
9
11
|
onUnauthorizedResponse: (_response: ResponseError) => void;
|
|
10
12
|
token?: PartialToken;
|
|
11
13
|
tokenType?: OauthType;
|
|
@@ -15,6 +17,7 @@ export interface ChatProviderProps {
|
|
|
15
17
|
export interface ChatContextValue extends Omit<ChatProviderProps, 'theme'> {
|
|
16
18
|
session: Session;
|
|
17
19
|
theme: ChatTheme;
|
|
20
|
+
onAgeDisqualification: (params: AgeCheckContactInfo) => void;
|
|
18
21
|
}
|
|
19
22
|
export declare const ChatContext: React.Context<ChatContextValue>;
|
|
20
23
|
export declare function ChatProvider({ children, value }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat_context.d.ts","sourceRoot":"","sources":["../../src/contexts/chat_context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiC,MAAM,OAAO,CAAA;AACrD,OAAO,EAAE,eAAe,EAAkB,M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AAI,CAAA;CAC7D;AAED,eAAO,MAAM,WAAW,iCAStB,CAAA;AAEF,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAAE,QAAQ,EAAE,GAAG,CAAC;IAAC,KAAK,EAAE,iBAAiB,CAAA;CAAE,qBA4B5F;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC,CAAA;IACjC,WAAW,CAAC,EAAE,eAAe,CAAA;CAC9B;AAED,eAAO,MAAM,cAAc,wBAE1B,CAAA;AAED,eAAO,MAAM,kBAAkB,yDAG5B,oBAAoB,KAAG,SAYzB,CAAA"}
|
|
@@ -6,6 +6,7 @@ import { defaultTheme } from '../utils/theme';
|
|
|
6
6
|
export const ChatContext = createContext({
|
|
7
7
|
env: undefined,
|
|
8
8
|
giphyApiKey: undefined,
|
|
9
|
+
onAgeDisqualification: (_params) => { },
|
|
9
10
|
onUnauthorizedResponse: () => { },
|
|
10
11
|
session: new Session(),
|
|
11
12
|
theme: defaultTheme('light'),
|
|
@@ -13,13 +14,14 @@ export const ChatContext = createContext({
|
|
|
13
14
|
edgeToEdge: true,
|
|
14
15
|
});
|
|
15
16
|
export function ChatProvider({ children, value }) {
|
|
16
|
-
const { env, token, onUnauthorizedResponse, giphyApiKey, tokenType, edgeToEdge = true } = value;
|
|
17
|
+
const { env, token, onAgeDisqualification = (_params) => { }, onUnauthorizedResponse, giphyApiKey, tokenType, edgeToEdge = true, } = value;
|
|
17
18
|
const theme = useCreateChatTheme(value.theme || {});
|
|
18
19
|
const session = useMemo(() => new Session({ token, env, type: tokenType }), [env, token, tokenType]);
|
|
19
20
|
const contextValue = {
|
|
20
21
|
edgeToEdge,
|
|
21
22
|
env,
|
|
22
23
|
giphyApiKey,
|
|
24
|
+
onAgeDisqualification,
|
|
23
25
|
onUnauthorizedResponse,
|
|
24
26
|
session,
|
|
25
27
|
theme,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat_context.js","sourceRoot":"","sources":["../../src/contexts/chat_context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,EAAmB,cAAc,EAAE,MAAM,cAAc,CAAA;AAE9D,OAAO,EAA+C,OAAO,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EAAa,YAAY,EAAgB,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"chat_context.js","sourceRoot":"","sources":["../../src/contexts/chat_context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,EAAmB,cAAc,EAAE,MAAM,cAAc,CAAA;AAE9D,OAAO,EAA+C,OAAO,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EAAa,YAAY,EAAgB,MAAM,gBAAgB,CAAA;AAoBtE,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAmB;IACzD,GAAG,EAAE,SAAS;IACd,WAAW,EAAE,SAAS;IACtB,qBAAqB,EAAE,CAAC,OAA4B,EAAE,EAAE,GAAE,CAAC;IAC3D,sBAAsB,EAAE,GAAG,EAAE,GAAE,CAAC;IAChC,OAAO,EAAE,IAAI,OAAO,EAAE;IACtB,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC;IAC5B,KAAK,EAAE,SAAS;IAChB,UAAU,EAAE,IAAI;CACjB,CAAC,CAAA;AAEF,MAAM,UAAU,YAAY,CAAC,EAAE,QAAQ,EAAE,KAAK,EAA+C;IAC3F,MAAM,EACJ,GAAG,EACH,KAAK,EACL,qBAAqB,GAAG,CAAC,OAA4B,EAAE,EAAE,GAAE,CAAC,EAC5D,sBAAsB,EACtB,W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CAAA","sourcesContent":["import { merge } from 'lodash'\nimport React, { createContext, useMemo } from 'react'\nimport { ColorSchemeName, useColorScheme } from 'react-native'\nimport { DeepPartial } from '../types'\nimport { ENV, OauthType, PartialToken, ResponseError, Session } from '../utils'\nimport { ChatTheme, defaultTheme, DefaultTheme } from '../utils/theme'\nimport { AgeCheckContactInfo } from '../screens/age_check/screen_props'\n\nexport interface ChatProviderProps {\n env?: ENV\n giphyApiKey?: string\n onAgeDisqualification?: (params: AgeCheckContactInfo) => void\n onUnauthorizedResponse: (_response: ResponseError) => void\n token?: PartialToken\n tokenType?: OauthType\n theme: CreateChatThemeProps\n edgeToEdge?: boolean\n}\n\nexport interface ChatContextValue extends Omit<ChatProviderProps, 'theme'> {\n session: Session\n theme: ChatTheme\n onAgeDisqualification: (params: AgeCheckContactInfo) => void\n}\n\nexport const ChatContext = createContext<ChatContextValue>({\n env: undefined,\n giphyApiKey: undefined,\n onAgeDisqualification: (_params: AgeCheckContactInfo) => {},\n onUnauthorizedResponse: () => {},\n session: new Session(),\n theme: defaultTheme('light'),\n token: undefined,\n edgeToEdge: true,\n})\n\nexport function ChatProvider({ children, value }: { children: any; value: ChatProviderProps }) {\n const {\n env,\n token,\n onAgeDisqualification = (_params: AgeCheckContactInfo) => {},\n onUnauthorizedResponse,\n giphyApiKey,\n tokenType,\n edgeToEdge = true,\n } = value\n const theme = useCreateChatTheme(value.theme || {})\n const session = useMemo(\n () => new Session({ token, env, type: tokenType }),\n [env, token, tokenType]\n )\n\n const contextValue: ChatContextValue = {\n edgeToEdge,\n env,\n giphyApiKey,\n onAgeDisqualification,\n onUnauthorizedResponse,\n session,\n theme,\n token,\n }\n\n return <ChatContext.Provider value={contextValue}>{children}</ChatContext.Provider>\n}\n\nexport interface CreateChatThemeProps {\n theme?: DeepPartial<DefaultTheme>\n colorScheme?: ColorSchemeName\n}\n\nexport const useChatContext = () => {\n return React.useContext(ChatContext)\n}\n\nexport const useCreateChatTheme = ({\n theme: customTheme = {},\n colorScheme: appColorScheme,\n}: CreateChatThemeProps): ChatTheme => {\n const internalColorScheme = useColorScheme() || 'light'\n const colorScheme = appColorScheme || internalColorScheme\n\n const theme = {\n ...merge({}, defaultTheme(colorScheme), customTheme),\n colors: {\n ...merge({}, defaultTheme(colorScheme).colors, customTheme?.colors),\n },\n }\n\n return theme\n}\n"]}
|
package/build/hooks/index.d.ts
CHANGED
|
@@ -14,5 +14,8 @@ export * from './use_api_client';
|
|
|
14
14
|
export * from './use_message_reaction_toggle';
|
|
15
15
|
export * from './use_interaction_ghost_color';
|
|
16
16
|
export * from './use_at_font_scale_breakpoint';
|
|
17
|
+
export * from './use_qualified_by_age';
|
|
17
18
|
export * from './use_scalable_number_of_lines';
|
|
19
|
+
export * from './use_submit_age_check';
|
|
20
|
+
export * from './use_organization';
|
|
18
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,yCAAyC,CAAA;AACvD,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,kBAAkB,CAAA;AAChC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,gCAAgC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,yCAAyC,CAAA;AACvD,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,kBAAkB,CAAA;AAChC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA"}
|
package/build/hooks/index.js
CHANGED
|
@@ -14,5 +14,8 @@ export * from './use_api_client';
|
|
|
14
14
|
export * from './use_message_reaction_toggle';
|
|
15
15
|
export * from './use_interaction_ghost_color';
|
|
16
16
|
export * from './use_at_font_scale_breakpoint';
|
|
17
|
+
export * from './use_qualified_by_age';
|
|
17
18
|
export * from './use_scalable_number_of_lines';
|
|
19
|
+
export * from './use_submit_age_check';
|
|
20
|
+
export * from './use_organization';
|
|
18
21
|
//# sourceMappingURL=index.js.map
|
package/build/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,yCAAyC,CAAA;AACvD,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,kBAAkB,CAAA;AAChC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,gCAAgC,CAAA","sourcesContent":["export * from './use_async_storage'\nexport * from './use_animated_message_background_color'\nexport * from './use_theme'\nexport * from './use_suspense_api'\nexport * from './use_current_person'\nexport * from './use_font_scale'\nexport * from './use_create_android_ripple_color'\nexport * from './use_chat_permissions'\nexport * from './use_api_client'\nexport * from './use_groups_groups'\nexport * from './use_groups'\nexport * from './use_api'\nexport * from './use_api_client'\nexport * from './use_message_reaction_toggle'\nexport * from './use_interaction_ghost_color'\nexport * from './use_at_font_scale_breakpoint'\nexport * from './use_scalable_number_of_lines'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,yCAAyC,CAAA;AACvD,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,kBAAkB,CAAA;AAChC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA","sourcesContent":["export * from './use_async_storage'\nexport * from './use_animated_message_background_color'\nexport * from './use_theme'\nexport * from './use_suspense_api'\nexport * from './use_current_person'\nexport * from './use_font_scale'\nexport * from './use_create_android_ripple_color'\nexport * from './use_chat_permissions'\nexport * from './use_api_client'\nexport * from './use_groups_groups'\nexport * from './use_groups'\nexport * from './use_api'\nexport * from './use_api_client'\nexport * from './use_message_reaction_toggle'\nexport * from './use_interaction_ghost_color'\nexport * from './use_at_font_scale_breakpoint'\nexport * from './use_qualified_by_age'\nexport * from './use_scalable_number_of_lines'\nexport * from './use_submit_age_check'\nexport * from './use_organization'\n"]}
|
|
@@ -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;AAIhD,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;AAIhD,eAAO,MAAM,wBAAwB;;;;;;;CAepC,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"}
|
|
@@ -4,7 +4,15 @@ export const currentPersonRequestArgs = {
|
|
|
4
4
|
url: '/me',
|
|
5
5
|
data: {
|
|
6
6
|
fields: {
|
|
7
|
-
Person: [
|
|
7
|
+
Person: [
|
|
8
|
+
'id',
|
|
9
|
+
'name',
|
|
10
|
+
'avatar',
|
|
11
|
+
'can_chat',
|
|
12
|
+
'unread_count',
|
|
13
|
+
'pco_chat_enabled',
|
|
14
|
+
'age_qualification_status',
|
|
15
|
+
],
|
|
8
16
|
},
|
|
9
17
|
},
|
|
10
18
|
};
|
|
@@ -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;AAEtD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAGvE,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,GAAG,EAAE,KAAK;IACV,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,MAAM,EAAE,
|
|
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;AAEtD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAGvE,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,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,6CAA6C;QACvE,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,kEAAkE;KAC3F,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 { getRequestQueryKey, useSuspenseGet } from './use_suspense_api'\nimport { ApiResource } from '../types/api_primitives'\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: 5 * 60 * 1000, // 5 minutes - data stays fresh for 5 minutes\n gcTime: 30 * 60 * 1000, // 30 minutes - data stays in cache for 30 minutes when not in use\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,39 @@
|
|
|
1
|
+
import { OrganizationResource } from '../types';
|
|
2
|
+
import { App } from './use_api_client';
|
|
3
|
+
export declare const organizationRequestArgs: {
|
|
4
|
+
url: string;
|
|
5
|
+
data: {
|
|
6
|
+
fields: {
|
|
7
|
+
Organization: string[];
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
app: App;
|
|
11
|
+
};
|
|
12
|
+
export declare function useOrganization(): {
|
|
13
|
+
error: import("../types").ApiError | null;
|
|
14
|
+
status: "success" | "error";
|
|
15
|
+
isError: boolean;
|
|
16
|
+
isPending: false;
|
|
17
|
+
isLoading: false;
|
|
18
|
+
isLoadingError: false;
|
|
19
|
+
isRefetchError: boolean;
|
|
20
|
+
isSuccess: boolean;
|
|
21
|
+
dataUpdatedAt: number;
|
|
22
|
+
errorUpdatedAt: number;
|
|
23
|
+
failureCount: number;
|
|
24
|
+
failureReason: import("../types").ApiError | null;
|
|
25
|
+
errorUpdateCount: number;
|
|
26
|
+
isFetched: boolean;
|
|
27
|
+
isFetchedAfterMount: boolean;
|
|
28
|
+
isFetching: boolean;
|
|
29
|
+
isInitialLoading: boolean;
|
|
30
|
+
isPaused: boolean;
|
|
31
|
+
isRefetching: boolean;
|
|
32
|
+
isStale: boolean;
|
|
33
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("../types").ApiResource<OrganizationResource>, import("../types").ApiError>>;
|
|
34
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
35
|
+
data: OrganizationResource;
|
|
36
|
+
links: Record<string, string>;
|
|
37
|
+
meta: Record<string, unknown>;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=use_organization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_organization.d.ts","sourceRoot":"","sources":["../../src/hooks/use_organization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE/C,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAEtC,eAAO,MAAM,uBAAuB;;;;;;;SAOnB,GAAG;CACnB,CAAA;AAED,wBAAgB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;EAE9B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useSuspenseGet } from './use_suspense_api';
|
|
2
|
+
export const organizationRequestArgs = {
|
|
3
|
+
url: '/',
|
|
4
|
+
data: {
|
|
5
|
+
fields: {
|
|
6
|
+
Organization: ['contact_email'],
|
|
7
|
+
},
|
|
8
|
+
},
|
|
9
|
+
app: 'chat',
|
|
10
|
+
};
|
|
11
|
+
export function useOrganization() {
|
|
12
|
+
return useSuspenseGet(organizationRequestArgs);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=use_organization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_organization.js","sourceRoot":"","sources":["../../src/hooks/use_organization.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAGnD,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,GAAG,EAAE,GAAG;IACR,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,YAAY,EAAE,CAAC,eAAe,CAAC;SAChC;KACF;IACD,GAAG,EAAE,MAAa;CACnB,CAAA;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,cAAc,CAAuB,uBAAuB,CAAC,CAAA;AACtE,CAAC","sourcesContent":["import { OrganizationResource } from '../types'\nimport { useSuspenseGet } from './use_suspense_api'\nimport { App } from './use_api_client'\n\nexport const organizationRequestArgs = {\n url: '/',\n data: {\n fields: {\n Organization: ['contact_email'],\n },\n },\n app: 'chat' as App,\n}\n\nexport function useOrganization() {\n return useSuspenseGet<OrganizationResource>(organizationRequestArgs)\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_qualified_by_age.d.ts","sourceRoot":"","sources":["../../src/hooks/use_qualified_by_age.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,QAAO,OAYpC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AgeQualificationStatus } from '../types';
|
|
2
|
+
import { useApiGet } from './use_api';
|
|
3
|
+
import { currentPersonRequestArgs } from './use_current_person';
|
|
4
|
+
export const useQualifiedByAge = () => {
|
|
5
|
+
const { data: person, isFetched } = useApiGet(currentPersonRequestArgs);
|
|
6
|
+
if (!isFetched) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
if (!person) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
return person.ageQualificationStatus === AgeQualificationStatus.QUALIFIED;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=use_qualified_by_age.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_qualified_by_age.js","sourceRoot":"","sources":["../../src/hooks/use_qualified_by_age.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAyB,MAAM,UAAU,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AAE/D,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAY,EAAE;IAC7C,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,CAAwB,wBAAwB,CAAC,CAAA;IAE9F,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,KAAK,CAAA;IACd,CAAC;IAED,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,KAAK,CAAA;IACd,CAAC;IAED,OAAO,MAAM,CAAC,sBAAsB,KAAK,sBAAsB,CAAC,SAAS,CAAA;AAC3E,CAAC,CAAA","sourcesContent":["import { AgeQualificationStatus, CurrentPersonResource } from '../types'\nimport { useApiGet } from './use_api'\nimport { currentPersonRequestArgs } from './use_current_person'\n\nexport const useQualifiedByAge = (): boolean => {\n const { data: person, isFetched } = useApiGet<CurrentPersonResource>(currentPersonRequestArgs)\n\n if (!isFetched) {\n return false\n }\n\n if (!person) {\n return false\n }\n\n return person.ageQualificationStatus === AgeQualificationStatus.QUALIFIED\n}\n"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ApiResource } from '../types/api_primitives';
|
|
2
|
+
interface AgeCheckResource {
|
|
3
|
+
type: 'AgeCheck';
|
|
4
|
+
id: string;
|
|
5
|
+
stated_date: string;
|
|
6
|
+
status: 'passed' | 'failed';
|
|
7
|
+
}
|
|
8
|
+
export declare function useSubmitAgeCheck(): {
|
|
9
|
+
data: undefined;
|
|
10
|
+
variables: undefined;
|
|
11
|
+
error: null;
|
|
12
|
+
isError: false;
|
|
13
|
+
isIdle: true;
|
|
14
|
+
isPending: false;
|
|
15
|
+
isSuccess: false;
|
|
16
|
+
status: "idle";
|
|
17
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<ApiResource<AgeCheckResource>, Error, Date, unknown>;
|
|
18
|
+
reset: () => void;
|
|
19
|
+
context: unknown;
|
|
20
|
+
failureCount: number;
|
|
21
|
+
failureReason: Error | null;
|
|
22
|
+
isPaused: boolean;
|
|
23
|
+
submittedAt: number;
|
|
24
|
+
submitAgeCheck: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<AgeCheckResource>, Error, Date, unknown>;
|
|
25
|
+
} | {
|
|
26
|
+
data: undefined;
|
|
27
|
+
variables: Date;
|
|
28
|
+
error: null;
|
|
29
|
+
isError: false;
|
|
30
|
+
isIdle: false;
|
|
31
|
+
isPending: true;
|
|
32
|
+
isSuccess: false;
|
|
33
|
+
status: "pending";
|
|
34
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<ApiResource<AgeCheckResource>, Error, Date, unknown>;
|
|
35
|
+
reset: () => void;
|
|
36
|
+
context: unknown;
|
|
37
|
+
failureCount: number;
|
|
38
|
+
failureReason: Error | null;
|
|
39
|
+
isPaused: boolean;
|
|
40
|
+
submittedAt: number;
|
|
41
|
+
submitAgeCheck: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<AgeCheckResource>, Error, Date, unknown>;
|
|
42
|
+
} | {
|
|
43
|
+
data: undefined;
|
|
44
|
+
error: Error;
|
|
45
|
+
variables: Date;
|
|
46
|
+
isError: true;
|
|
47
|
+
isIdle: false;
|
|
48
|
+
isPending: false;
|
|
49
|
+
isSuccess: false;
|
|
50
|
+
status: "error";
|
|
51
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<ApiResource<AgeCheckResource>, Error, Date, unknown>;
|
|
52
|
+
reset: () => void;
|
|
53
|
+
context: unknown;
|
|
54
|
+
failureCount: number;
|
|
55
|
+
failureReason: Error | null;
|
|
56
|
+
isPaused: boolean;
|
|
57
|
+
submittedAt: number;
|
|
58
|
+
submitAgeCheck: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<AgeCheckResource>, Error, Date, unknown>;
|
|
59
|
+
} | {
|
|
60
|
+
data: ApiResource<AgeCheckResource>;
|
|
61
|
+
error: null;
|
|
62
|
+
variables: Date;
|
|
63
|
+
isError: false;
|
|
64
|
+
isIdle: false;
|
|
65
|
+
isPending: false;
|
|
66
|
+
isSuccess: true;
|
|
67
|
+
status: "success";
|
|
68
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<ApiResource<AgeCheckResource>, Error, Date, unknown>;
|
|
69
|
+
reset: () => void;
|
|
70
|
+
context: unknown;
|
|
71
|
+
failureCount: number;
|
|
72
|
+
failureReason: Error | null;
|
|
73
|
+
isPaused: boolean;
|
|
74
|
+
submittedAt: number;
|
|
75
|
+
submitAgeCheck: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<AgeCheckResource>, Error, Date, unknown>;
|
|
76
|
+
};
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=use_submit_age_check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_submit_age_check.d.ts","sourceRoot":"","sources":["../../src/hooks/use_submit_age_check.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAGrD,UAAU,gBAAgB;IACxB,IAAI,EAAE,UAAU,CAAA;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAA;CAC5B;AAED,wBAAgB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiChC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Alert } from 'react-native';
|
|
2
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
3
|
+
import { useApiClient } from './use_api_client';
|
|
4
|
+
import { currentPersonQueryKey } from './use_current_person';
|
|
5
|
+
import { Haptic } from '../utils/native_adapters';
|
|
6
|
+
export function useSubmitAgeCheck() {
|
|
7
|
+
const apiClient = useApiClient();
|
|
8
|
+
const queryClient = useQueryClient();
|
|
9
|
+
const { mutateAsync: submitAgeCheck, ...mutation } = useMutation({
|
|
10
|
+
mutationKey: ['submitAgeCheck'],
|
|
11
|
+
mutationFn: (date) => apiClient.people.post({
|
|
12
|
+
url: '/me/age_checks',
|
|
13
|
+
data: {
|
|
14
|
+
fields: { AgeCheck: 'stated_date,status' },
|
|
15
|
+
data: {
|
|
16
|
+
type: 'AgeCheck',
|
|
17
|
+
attributes: {
|
|
18
|
+
stated_date: date.toISOString(),
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
}),
|
|
23
|
+
onSuccess: (response) => {
|
|
24
|
+
queryClient.invalidateQueries({ queryKey: currentPersonQueryKey });
|
|
25
|
+
if (response.data.status === 'passed') {
|
|
26
|
+
Haptic.notificationSuccess();
|
|
27
|
+
Alert.alert('Profile updated', `Your birthdate has been updated.`);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
onError: () => {
|
|
31
|
+
Haptic.notificationError();
|
|
32
|
+
Alert.alert('Oops', `We were unable to update your birthdate. Please try again.`);
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
return { submitAgeCheck, ...mutation };
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=use_submit_age_check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_submit_age_check.js","sourceRoot":"","sources":["../../src/hooks/use_submit_age_check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AASjD,MAAM,UAAU,iBAAiB;IAC/B,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAChC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAA;IAEpC,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,QAAQ,EAAE,GAAG,WAAW,CAAC;QAC/D,WAAW,EAAE,CAAC,gBAAgB,CAAC;QAC/B,UAAU,EAAE,CAAC,IAAU,EAAE,EAAE,CACzB,SAAS,CAAC,MAAM,CAAC,IAAI,CAAgC;YACnD,GAAG,EAAE,gBAAgB;YACrB,IAAI,EAAE;gBACJ,MAAM,EAAE,EAAE,QAAQ,EAAE,oBAAoB,EAAE;gBAC1C,IAAI,EAAE;oBACJ,IAAI,EAAE,UAAU;oBAChB,UAAU,EAAE;wBACV,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;qBAChC;iBACF;aACF;SACF,CAAC;QACJ,SAAS,EAAE,CAAC,QAAuC,EAAE,EAAE;YACrD,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,qBAAqB,EAAE,CAAC,CAAA;YAClE,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;gBACtC,MAAM,CAAC,mBAAmB,EAAE,CAAA;gBAC5B,KAAK,CAAC,KAAK,CAAC,iBAAiB,EAAE,kCAAkC,CAAC,CAAA;YACpE,CAAC;QACH,CAAC;QACD,OAAO,EAAE,GAAG,EAAE;YACZ,MAAM,CAAC,iBAAiB,EAAE,CAAA;YAC1B,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,4DAA4D,CAAC,CAAA;QACnF,CAAC;KACF,CAAC,CAAA;IAEF,OAAO,EAAE,cAAc,EAAE,GAAG,QAAQ,EAAE,CAAA;AACxC,CAAC","sourcesContent":["import { Alert } from 'react-native'\nimport { useMutation, useQueryClient } from '@tanstack/react-query'\nimport { useApiClient } from './use_api_client'\nimport { currentPersonQueryKey } from './use_current_person'\nimport { ApiResource } from '../types/api_primitives'\nimport { Haptic } from '../utils/native_adapters'\n\ninterface AgeCheckResource {\n type: 'AgeCheck'\n id: string\n stated_date: string\n status: 'passed' | 'failed'\n}\n\nexport function useSubmitAgeCheck() {\n const apiClient = useApiClient()\n const queryClient = useQueryClient()\n\n const { mutateAsync: submitAgeCheck, ...mutation } = useMutation({\n mutationKey: ['submitAgeCheck'],\n mutationFn: (date: Date) =>\n apiClient.people.post<ApiResource<AgeCheckResource>>({\n url: '/me/age_checks',\n data: {\n fields: { AgeCheck: 'stated_date,status' },\n data: {\n type: 'AgeCheck',\n attributes: {\n stated_date: date.toISOString(),\n },\n },\n },\n }),\n onSuccess: (response: ApiResource<AgeCheckResource>) => {\n queryClient.invalidateQueries({ queryKey: currentPersonQueryKey })\n if (response.data.status === 'passed') {\n Haptic.notificationSuccess()\n Alert.alert('Profile updated', `Your birthdate has been updated.`)\n }\n },\n onError: () => {\n Haptic.notificationError()\n Alert.alert('Oops', `We were unable to update your birthdate. Please try again.`)\n },\n })\n\n return { submitAgeCheck, ...mutation }\n}\n"]}
|
package/build/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './contexts/chat_context';
|
|
|
4
4
|
export * from './navigation';
|
|
5
5
|
export { ScreenLayout } from './navigation/screenLayout';
|
|
6
6
|
export * from './screens';
|
|
7
|
+
export { AgeCheckUnderageScreen } from './screens/age_check/age_check_underage_screen';
|
|
7
8
|
export * from './types';
|
|
8
9
|
export { platformFontWeightBold, Session, TemporaryDefaultColorsType, Uri } from './utils';
|
|
9
10
|
export * from './utils/client';
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACvF,cAAc,yBAAyB,CAAA;AACvC,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,0BAA0B,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAC1F,cAAc,gBAAgB,CAAA;AAC9B,cAAc,yBAAyB,CAAA;AACvC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACvF,cAAc,yBAAyB,CAAA;AACvC,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,cAAc,WAAW,CAAA;AACzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAA;AACtF,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,0BAA0B,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAC1F,cAAc,gBAAgB,CAAA;AAC9B,cAAc,yBAAyB,CAAA;AACvC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA"}
|
package/build/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export * from './contexts/chat_context';
|
|
|
4
4
|
export * from './navigation';
|
|
5
5
|
export { ScreenLayout } from './navigation/screenLayout';
|
|
6
6
|
export * from './screens';
|
|
7
|
+
export { AgeCheckUnderageScreen } from './screens/age_check/age_check_underage_screen'; // TODO: add to barrel
|
|
7
8
|
export * from './types';
|
|
8
9
|
export { platformFontWeightBold, Session, Uri } from './utils';
|
|
9
10
|
export * from './utils/client';
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACvF,cAAc,yBAAyB,CAAA;AACvC,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAA8B,GAAG,EAAE,MAAM,SAAS,CAAA;AAC1F,cAAc,gBAAgB,CAAA;AAC9B,cAAc,yBAAyB,CAAA;AACvC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA","sourcesContent":["export { GroupConversations } from './components'\nexport { ApiProvider, chatQueryClient, useFocusManager } from './contexts/api_provider'\nexport * from './contexts/chat_context'\nexport * from './navigation'\nexport { ScreenLayout } from './navigation/screenLayout'\nexport * from './screens'\nexport * from './types'\nexport { platformFontWeightBold, Session, TemporaryDefaultColorsType, Uri } from './utils'\nexport * from './utils/client'\nexport * from './utils/native_adapters'\nexport { default as Event } from './polyfills/events/Event'\nexport { CustomEvent } from './polyfills/events/CustomEvent'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACvF,cAAc,yBAAyB,CAAA;AACvC,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,cAAc,WAAW,CAAA;AACzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAA,CAAC,sBAAsB;AAC7G,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAA8B,GAAG,EAAE,MAAM,SAAS,CAAA;AAC1F,cAAc,gBAAgB,CAAA;AAC9B,cAAc,yBAAyB,CAAA;AACvC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA","sourcesContent":["export { GroupConversations } from './components'\nexport { ApiProvider, chatQueryClient, useFocusManager } from './contexts/api_provider'\nexport * from './contexts/chat_context'\nexport * from './navigation'\nexport { ScreenLayout } from './navigation/screenLayout'\nexport * from './screens'\nexport { AgeCheckUnderageScreen } from './screens/age_check/age_check_underage_screen' // TODO: add to barrel\nexport * from './types'\nexport { platformFontWeightBold, Session, TemporaryDefaultColorsType, Uri } from './utils'\nexport * from './utils/client'\nexport * from './utils/native_adapters'\nexport { default as Event } from './polyfills/events/Event'\nexport { CustomEvent } from './polyfills/events/CustomEvent'\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat_access_gate.d.ts","sourceRoot":"","sources":["../../src/navigation/chat_access_gate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAqB,MAAM,OAAO,CAAA;AASnE,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,qBA0B7D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { currentPersonRequestArgs } from '../hooks/use_current_person';
|
|
3
|
+
import { AgeCheckRequiredScreen } from '../screens/age_check/age_check_required_screen';
|
|
4
|
+
import { DefaultLoading } from '../components/page/loading';
|
|
5
|
+
import { useApiGet, useOrganization } from '../hooks';
|
|
6
|
+
import { AgeQualificationStatus } from '../types';
|
|
7
|
+
import { useChatContext } from '../contexts/chat_context';
|
|
8
|
+
import { AgeCheckUnderageScreen } from '../screens/age_check/age_check_underage_screen';
|
|
9
|
+
export function ChatAccessGate({ children }) {
|
|
10
|
+
const { data: person, isFetched } = useApiGet(currentPersonRequestArgs);
|
|
11
|
+
const { data: organization } = useOrganization();
|
|
12
|
+
const ageQualificationStatus = person?.ageQualificationStatus;
|
|
13
|
+
const contactEmail = organization?.contactEmail;
|
|
14
|
+
useAgeDisqualification(ageQualificationStatus, contactEmail);
|
|
15
|
+
if (!isFetched) {
|
|
16
|
+
return <DefaultLoading />;
|
|
17
|
+
}
|
|
18
|
+
if (!person) {
|
|
19
|
+
throw new Error('Current person not found');
|
|
20
|
+
}
|
|
21
|
+
if (ageQualificationStatus === AgeQualificationStatus.DISQUALIFIED) {
|
|
22
|
+
return <AgeCheckUnderageScreen contactEmail={contactEmail}/>;
|
|
23
|
+
}
|
|
24
|
+
if (ageQualificationStatus === AgeQualificationStatus.UNKNOWN) {
|
|
25
|
+
return <AgeCheckRequiredScreen />;
|
|
26
|
+
}
|
|
27
|
+
return <>{children}</>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Helper hook that handles the age disqualification logic.
|
|
31
|
+
*
|
|
32
|
+
* If a host app provides an onAgeDisqualification callback, it will be called
|
|
33
|
+
* when a user is found to be disqualified by their age.
|
|
34
|
+
*/
|
|
35
|
+
function useAgeDisqualification(ageQualificationStatus, contactEmail) {
|
|
36
|
+
const { onAgeDisqualification } = useChatContext();
|
|
37
|
+
const hasCalledCallbackRef = useRef(false);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (ageQualificationStatus === AgeQualificationStatus.DISQUALIFIED &&
|
|
40
|
+
!hasCalledCallbackRef.current) {
|
|
41
|
+
hasCalledCallbackRef.current = true;
|
|
42
|
+
onAgeDisqualification({ contactEmail: contactEmail || '' });
|
|
43
|
+
}
|
|
44
|
+
}, [ageQualificationStatus, onAgeDisqualification, contactEmail]);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=chat_access_gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat_access_g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AAsB,KAAK,sBAAsB,CAAC,OAAO,EAAE,CAAC;QAC9D,OAAO,CAAC,sBAAsB,CAAC,AAAD,EAAG,CAAA;IACnC,CAAC;IAED,OAAO,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAA;AACxB,CAAC;AAED;;;;;GAKG;AACH,SAAS,sBAAsB,CAC7B,sBAAuE,EACvE,YAAgC;IAEhC,MAAM,EAAE,qBAAqB,EAAE,GAAG,cAAc,EAAE,CAAA;IAClD,MAAM,oBAAoB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IAE1C,SAAS,CAAC,GAAG,EAAE;QACb,IACE,sBAAsB,KAAK,sBAAsB,CAAC,YAAY;YAC9D,CAAC,oBAAoB,CAAC,OAAO,EAC7B,CAAC;YACD,oBAAoB,CAAC,OAAO,GAAG,IAAI,CAAA;YACnC,qBAAqB,CAAC,EAAE,YAAY,EAAE,YAAY,IAAI,EAAE,EAAE,CAAC,CAAA;QAC7D,CAAC;IACH,CAAC,EAAE,CAAC,sBAAsB,EAAE,qBAAqB,EAAE,YAAY,CAAC,CAAC,CAAA;AACnE,CAAC","sourcesContent":["import React, { PropsWithChildren, useEffect, useRef } from 'react'\nimport { currentPersonRequestArgs } from '../hooks/use_current_person'\nimport { AgeCheckRequiredScreen } from '../screens/age_check/age_check_required_screen'\nimport { DefaultLoading } from '../components/page/loading'\nimport { useApiGet, useOrganization } from '../hooks'\nimport { AgeQualificationStatus, CurrentPersonResource } from '../types'\nimport { useChatContext } from '../contexts/chat_context'\nimport { AgeCheckUnderageScreen } from '../screens/age_check/age_check_underage_screen'\n\nexport function ChatAccessGate({ children }: PropsWithChildren) {\n const { data: person, isFetched } = useApiGet<CurrentPersonResource>(currentPersonRequestArgs)\n const { data: organization } = useOrganization()\n\n const ageQualificationStatus = person?.ageQualificationStatus\n const contactEmail = organization?.contactEmail\n\n useAgeDisqualification(ageQualificationStatus, contactEmail)\n\n if (!isFetched) {\n return <DefaultLoading />\n }\n\n if (!person) {\n throw new Error('Current person not found')\n }\n\n if (ageQualificationStatus === AgeQualificationStatus.DISQUALIFIED) {\n return <AgeCheckUnderageScreen contactEmail={contactEmail} />\n }\n\n if (ageQualificationStatus === AgeQualificationStatus.UNKNOWN) {\n return <AgeCheckRequiredScreen />\n }\n\n return <>{children}</>\n}\n\n/**\n * Helper hook that handles the age disqualification logic.\n *\n * If a host app provides an onAgeDisqualification callback, it will be called\n * when a user is found to be disqualified by their age.\n */\nfunction useAgeDisqualification(\n ageQualificationStatus: CurrentPersonResource['ageQualificationStatus'],\n contactEmail: string | undefined\n) {\n const { onAgeDisqualification } = useChatContext()\n const hasCalledCallbackRef = useRef(false)\n\n useEffect(() => {\n if (\n ageQualificationStatus === AgeQualificationStatus.DISQUALIFIED &&\n !hasCalledCallbackRef.current\n ) {\n hasCalledCallbackRef.current = true\n onAgeDisqualification({ contactEmail: contactEmail || '' })\n }\n }, [ageQualificationStatus, onAgeDisqualification, contactEmail])\n}\n"]}
|
|
@@ -11,8 +11,8 @@ import { ConversationsScreen } from '../screens/conversations/conversations_scre
|
|
|
11
11
|
import { MessageActionsScreen } from '../screens/message_actions_screen';
|
|
12
12
|
import { NotFound } from '../screens/not_found';
|
|
13
13
|
import { ReactionsScreen } from '../screens/reactions_screen';
|
|
14
|
+
import { ScreenLayoutWithChatAccessGate } from './screenLayout';
|
|
14
15
|
import { SendGiphyScreen } from '../screens/send_giphy_screen';
|
|
15
|
-
import { ScreenLayout } from './screenLayout';
|
|
16
16
|
export declare const NewConversationStack: import("@react-navigation/native").TypedNavigator<{
|
|
17
17
|
ParamList: import("@react-navigation/native").ParamListBase;
|
|
18
18
|
NavigatorID: undefined;
|
|
@@ -28,7 +28,7 @@ export declare const NewConversationStack: import("@react-navigation/native").Ty
|
|
|
28
28
|
readonly screenOptions: {
|
|
29
29
|
readonly headerBackButtonDisplayMode: "minimal";
|
|
30
30
|
};
|
|
31
|
-
readonly screenLayout: typeof
|
|
31
|
+
readonly screenLayout: typeof ScreenLayoutWithChatAccessGate;
|
|
32
32
|
readonly screens: {
|
|
33
33
|
readonly ConversationSelectRecipients: {
|
|
34
34
|
readonly screen: ({ route, }: import("../screens/conversation_select_recipients/types/screen_props").ConversationSelectRecipientsScreenProps) => React.JSX.Element;
|
|
@@ -108,7 +108,7 @@ export declare const ChatStack: import("@react-navigation/native").TypedNavigato
|
|
|
108
108
|
readonly screenOptions: {
|
|
109
109
|
readonly headerBackButtonDisplayMode: "minimal";
|
|
110
110
|
};
|
|
111
|
-
readonly screenLayout: typeof
|
|
111
|
+
readonly screenLayout: typeof ScreenLayoutWithChatAccessGate;
|
|
112
112
|
readonly screens: {
|
|
113
113
|
readonly Conversations: {
|
|
114
114
|
readonly screen: typeof ConversationsScreen;
|
|
@@ -146,6 +146,7 @@ export declare const ChatStack: import("@react-navigation/native").TypedNavigato
|
|
|
146
146
|
};
|
|
147
147
|
readonly TeamConversation: {
|
|
148
148
|
readonly screen: ({ route }: import("../screens/team_conversation_screen").TeamConversationScreenProps) => React.JSX.Element;
|
|
149
|
+
readonly if: () => boolean;
|
|
149
150
|
readonly options: {
|
|
150
151
|
readonly title: "Finding conversation...";
|
|
151
152
|
readonly animation: "none";
|
|
@@ -180,7 +181,7 @@ export declare const ChatStack: import("@react-navigation/native").TypedNavigato
|
|
|
180
181
|
readonly screenOptions: {
|
|
181
182
|
readonly headerBackButtonDisplayMode: "minimal";
|
|
182
183
|
};
|
|
183
|
-
readonly screenLayout: typeof
|
|
184
|
+
readonly screenLayout: typeof ScreenLayoutWithChatAccessGate;
|
|
184
185
|
readonly screens: {
|
|
185
186
|
readonly ConversationSelectRecipients: {
|
|
186
187
|
readonly screen: ({ route, }: import("../screens/conversation_select_recipients/types/screen_props").ConversationSelectRecipientsScreenProps) => React.JSX.Element;
|
|
@@ -246,6 +247,7 @@ export declare const ChatStack: import("@react-navigation/native").TypedNavigato
|
|
|
246
247
|
};
|
|
247
248
|
};
|
|
248
249
|
}>;
|
|
250
|
+
readonly if: () => boolean;
|
|
249
251
|
readonly options: {
|
|
250
252
|
readonly headerShown: false;
|
|
251
253
|
readonly presentation: "modal";
|
|
@@ -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,CAAA;AAChE,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EACL,uBAAuB,EAExB,MAAM,yDAAyD,CAAA;AAChE,OAAO,EAAE,eAAe,EAA0B,MAAM,8BAA8B,CAAA;AACtF,OAAO,EACL,yBAAyB,EAE1B,MAAM,sDAAsD,CAAA;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAWlF,OAAO,EAEL,kBAAkB,EAEnB,MAAM,gCAAgC,CAAA;AAIvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAA;AAEnF,OAAO,EACL,oBAAoB,EAErB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAA0B,MAAM,6BAA6B,CAAA;AACrF,OAAO,EAAE,
|
|
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,CAAA;AAChE,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EACL,uBAAuB,EAExB,MAAM,yDAAyD,CAAA;AAChE,OAAO,EAAE,eAAe,EAA0B,MAAM,8BAA8B,CAAA;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qpS,KAAK;;;;iDAtKrrS,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAsKooS,gBAAiB,KAAK;;;;;;;;;;;;;;;;;;EAThtS,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"}
|
|
@@ -21,9 +21,10 @@ import { GetHelpScreen } from '../screens/get_help_screen';
|
|
|
21
21
|
import { MessageActionsScreen, MessageActionsScreenOptions, } from '../screens/message_actions_screen';
|
|
22
22
|
import { NotFound } from '../screens/not_found';
|
|
23
23
|
import { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen';
|
|
24
|
+
import { ScreenLayoutWithChatAccessGate } from './screenLayout';
|
|
24
25
|
import { SendGiphyScreen, SendGiphyScreenOptions } from '../screens/send_giphy_screen';
|
|
25
26
|
import { TeamConversationScreen } from '../screens/team_conversation_screen';
|
|
26
|
-
import {
|
|
27
|
+
import { useQualifiedByAge } from '../hooks';
|
|
27
28
|
const HEADER_BACK_BUTTON_LAYOUT_RESET_STYLES = {
|
|
28
29
|
marginLeft: Platform.select({ ios: -8, default: -3 }),
|
|
29
30
|
marginRight: Platform.select({ ios: 0, default: 30 }),
|
|
@@ -33,7 +34,7 @@ export const NewConversationStack = createNativeStackNavigator({
|
|
|
33
34
|
screenOptions: {
|
|
34
35
|
headerBackButtonDisplayMode: 'minimal',
|
|
35
36
|
},
|
|
36
|
-
screenLayout:
|
|
37
|
+
screenLayout: ScreenLayoutWithChatAccessGate,
|
|
37
38
|
screens: {
|
|
38
39
|
ConversationSelectRecipients: {
|
|
39
40
|
screen: ConversationSelectRecipientsScreen,
|
|
@@ -75,7 +76,7 @@ export const ChatStack = createNativeStackNavigator({
|
|
|
75
76
|
screenOptions: {
|
|
76
77
|
headerBackButtonDisplayMode: 'minimal',
|
|
77
78
|
},
|
|
78
|
-
screenLayout:
|
|
79
|
+
screenLayout: ScreenLayoutWithChatAccessGate,
|
|
79
80
|
screens: {
|
|
80
81
|
Conversations: {
|
|
81
82
|
screen: ConversationsScreen,
|
|
@@ -120,6 +121,7 @@ export const ChatStack = createNativeStackNavigator({
|
|
|
120
121
|
},
|
|
121
122
|
TeamConversation: {
|
|
122
123
|
screen: TeamConversationScreen,
|
|
124
|
+
if: useQualifiedByAge,
|
|
123
125
|
options: {
|
|
124
126
|
title: 'Finding conversation...',
|
|
125
127
|
animation: 'none',
|
|
@@ -136,6 +138,7 @@ export const ChatStack = createNativeStackNavigator({
|
|
|
136
138
|
},
|
|
137
139
|
New: {
|
|
138
140
|
screen: NewConversationStack,
|
|
141
|
+
if: useQualifiedByAge,
|
|
139
142
|
options: {
|
|
140
143
|
headerShown: false,
|
|
141
144
|
presentation: 'modal',
|