@planningcenter/chat-react-native 3.18.0-rc.10 → 3.18.0-rc.12

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.
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAA;AASxC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAqB7C;;GAEG;AACH,UAAU,YAAa,SAAQ,eAAe;IAC5C,4BAA4B,EAAE,OAAO,CAAA;IACrC,eAAe,EAAE,MAAM,CAAA;IACvB,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,wBAAgB,OAAO,CAAC,EACtB,4BAA4B,EAC5B,eAAe,EACf,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,GAAG,OAAO,EACX,EAAE,YAAY,qBAmQd"}
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAexC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAsB7C;;GAEG;AACH,UAAU,YAAa,SAAQ,eAAe;IAC5C,4BAA4B,EAAE,OAAO,CAAA;IACrC,eAAe,EAAE,MAAM,CAAA;IACvB,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,wBAAgB,OAAO,CAAC,EACtB,4BAA4B,EAC5B,eAAe,EACf,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,GAAG,OAAO,EACX,EAAE,YAAY,qBAyRd"}
@@ -1,6 +1,6 @@
1
1
  import { useNavigation } from '@react-navigation/native';
2
2
  import React, { useEffect } from 'react';
3
- import { Pressable, StyleSheet, useWindowDimensions, View } from 'react-native';
3
+ import { Pressable, StyleSheet, useWindowDimensions, View, } from 'react-native';
4
4
  import { MessageReaction } from '../../components/conversation/message_reaction';
5
5
  import { Avatar, Icon, Spinner, Text, TextButton, TextInlineButton } from '../../components/display';
6
6
  import { useAnimatedMessageBackgroundColor, useInteractionGhostBackgroundColor, useTheme, } from '../../hooks';
@@ -16,9 +16,10 @@ import { Haptic } from '../../utils/native_adapters';
16
16
  import { TheirReplyConnector, MyReplyConnector, AVATAR_CONNECTOR_SPACING } from './reply_connectors';
17
17
  import { pluralize } from '../../utils';
18
18
  import { useConversationMessage } from '../../hooks/use_conversation_message';
19
+ import { some } from 'lodash';
19
20
  import { isNewMessage } from '../../utils/cache/messages_cache';
20
21
  export function Message({ canDeleteNonAuthoredMessages, conversation_id, latestReadMessageSortKey, inReplyScreen, repliesEnabled, ...message }) {
21
- const { text, reactionCounts, pending, error } = message;
22
+ const { text, reactionCounts, pending, error, attachments, author } = message;
22
23
  const styles = useMessageStyles(message);
23
24
  const navigation = useNavigation();
24
25
  const { colors } = useTheme();
@@ -37,23 +38,27 @@ export function Message({ canDeleteNonAuthoredMessages, conversation_id, latestR
37
38
  enabled: !!message.replyRootId,
38
39
  });
39
40
  const metaProps = {
40
- authorName: message.author.name,
41
+ authorName: author.name,
41
42
  createdAt: message.createdAt,
42
43
  };
43
44
  const renderAuthor = (!message.mine && message.renderAuthor) || false;
44
45
  const showReplyCountButton = !inReplyScreen && message.replyRootId === message.id && repliesEnabled;
45
46
  const isReplyRootMessage = message.replyRootId === message.id;
46
47
  const isDeletedReplyRootMessage = isReplyRootMessage && !!message.deletedAt;
48
+ const replyToReplyRootMessage = repliesEnabled && !isReplyRootMessage && !!message.replyRootId;
47
49
  const replyCountText = pluralize(message.replyCount, 'reply');
48
50
  const messagePendingLabel = isPersisted ? 'Saving' : 'Sending';
49
- const replyRootAuthorName = message.replyRootId
50
- ? replyRootMessage?.author.name
51
- : message.author.name;
51
+ const replyRootAuthorName = message.replyRootId ? replyRootMessage?.author.name : author.name;
52
+ const messageText = isDeletedReplyRootMessage ? 'Message deleted' : text;
52
53
  const messageBottomMargin = message.lastInGroup || message.nextIsReplyShadowMessage
53
54
  ? 16
54
55
  : hasReactions || showMessageMeta || showReplyCountButton
55
56
  ? 8
56
57
  : 4;
58
+ const messageIsReplyLabel = replyToReplyRootMessage ? 'Reply' : '';
59
+ const attachmentLabel = some(attachments) ? pluralize(attachments.length, 'attachment') : '';
60
+ const replyCountLabel = isReplyRootMessage ? replyCountText : '';
61
+ const accessibilityLabel = `${author?.name || ''} ${messageIsReplyLabel} ${attachmentLabel} ${messageText || ''} ${timestamp} ${replyCountLabel}`;
57
62
  useEffect(() => {
58
63
  if (pending) {
59
64
  const timer = setTimeout(() => {
@@ -113,25 +118,36 @@ export function Message({ canDeleteNonAuthoredMessages, conversation_id, latestR
113
118
  navigation.navigate('ConversationReply', {
114
119
  conversation_id,
115
120
  reply_root_id: message.id,
116
- reply_root_author_name: message.author.name,
121
+ reply_root_author_name: author.name,
117
122
  });
118
123
  };
119
- return (<Pressable onLongPress={handleMessageLongPress} onPress={handleMessagePress} onPressIn={handleMessagePressIn} onPressOut={handleMessagePressOut} android_ripple={{ color: colors.androidRippleNeutral, borderless: false, foreground: true }} accessibilityHint="Long press to view message actions like reacting and copying." disabled={isDeletedReplyRootMessage}>
124
+ const accessibilityActions = [
125
+ {
126
+ name: 'navigateToReplies',
127
+ label: 'Navigate to replies',
128
+ },
129
+ ];
130
+ const handleAccessibilityAction = (event) => {
131
+ if (event.nativeEvent.actionName === 'navigateToReplies') {
132
+ handleNavigateToReplyPress();
133
+ }
134
+ };
135
+ return (<Pressable onLongPress={handleMessageLongPress} onPress={handleMessagePress} onPressIn={handleMessagePressIn} onPressOut={handleMessagePressOut} android_ripple={{ color: colors.androidRippleNeutral, borderless: false, foreground: true }} accessibilityRole="button" accessibilityLabel={accessibilityLabel} accessibilityHint="Long press to view message actions like reacting and copying." accessibilityActions={isReplyRootMessage ? accessibilityActions : undefined} onAccessibilityAction={isReplyRootMessage ? handleAccessibilityAction : undefined} disabled={isDeletedReplyRootMessage}>
120
136
  <Animated.View style={[styles.message, animatedBackgroundColor]}>
121
137
  {!message.mine && (<View>
122
- {renderAuthor ? (<Avatar size={'md'} sourceUri={message.author.avatar} style={styles.avatar} maxFontSizeMultiplier={1} minFontSizeMultiplier={1} fallbackIconName={isDeletedReplyRootMessage ? 'publishing.trash' : 'general.person'} showFallback={isDeletedReplyRootMessage}/>) : (<View style={styles.avatarPlaceholder}/>)}
138
+ {renderAuthor ? (<Avatar size={'md'} sourceUri={author.avatar} style={styles.avatar} maxFontSizeMultiplier={1} minFontSizeMultiplier={1} fallbackIconName={isDeletedReplyRootMessage ? 'publishing.trash' : 'general.person'} showFallback={isDeletedReplyRootMessage}/>) : (<View style={styles.avatarPlaceholder}/>)}
123
139
  {repliesEnabled && (<TheirReplyConnector message={message} messageBubbleHeight={messageBubbleHeight}/>)}
124
140
  </View>)}
125
141
  <View style={[styles.messageContent, { marginBottom: messageBottomMargin }]}>
126
142
  {renderAuthor && !isDeletedReplyRootMessage && (<Text variant="footnote" style={styles.authorName}>
127
- {message.author.name}
143
+ {author.name}
128
144
  </Text>)}
129
145
  <View style={styles.messageBubble} onLayout={e => setMessageBubbleHeight(e.nativeEvent.layout.height)}>
130
146
  {isDeletedReplyRootMessage ? (<View style={styles.messageText}>
131
- <Text style={styles.replyRootDeletedText}>Message deleted</Text>
147
+ <Text style={styles.replyRootDeletedText}>{messageText}</Text>
132
148
  </View>) : (<>
133
149
  <ErrorBoundary>
134
- <MessageAttachments attachments={message.attachments} metaProps={metaProps} onMessageAttachmentLongPress={handleMessageAttachmentLongPress} onMessageLongPress={handleMessageLongPress}/>
150
+ <MessageAttachments attachments={attachments} metaProps={metaProps} onMessageAttachmentLongPress={handleMessageAttachmentLongPress} onMessageLongPress={handleMessageLongPress}/>
135
151
  </ErrorBoundary>
136
152
  {text && (<View style={styles.messageText}>
137
153
  <MessageMarkdown text={text}/>
@@ -1 +1 @@
1
- {"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/components/conversation/message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AACpG,OAAO,EACL,iCAAiC,EACjC,kCAAkC,EAClC,QAAQ,GACT,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,aAAa,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEpD,OAAO,EACL,4CAA4C,EAC5C,kCAAkC,EAClC,wBAAwB,GACzB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,QAAQ,MAAM,yBAAyB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAA;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AACpG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAs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ACD,iBAAiB,EAAE;YACjB,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY;SAC5C;QACD,WAAW,EAAE;YACX,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY;YAChD,GAAG,EAAE,CAAC;SACP;QACD,UAAU,EAAE;YACV,UAAU,EAAE,wBAAwB;SACrC;QACD,yBAAyB,EAAE;YACzB,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;SACP;QACD,cAAc,EAAE;YACd,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;SACP;QACD,SAAS,EAAE;YACT,KAAK,EAAE,MAAM,CAAC,eAAe;SAC9B;QACD,SAAS,EAAE;YACT,KAAK,EAAE,MAAM,CAAC,eAAe;SAC9B;QACD,oBAAoB,EAAE;YACpB,KAAK,EAAE,MAAM,CAAC,yBAAyB;YACvC,SAAS,EAAE,QAAQ;SACpB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport React, { useEffect } from 'react'\nimport { Pressable, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { MessageReaction } from '../../components/conversation/message_reaction'\nimport { Avatar, Icon, Spinner, Text, TextButton, TextInlineButton } from '../../components/display'\nimport {\n useAnimatedMessageBackgroundColor,\n useInteractionGhostBackgroundColor,\n useTheme,\n} from '../../hooks'\nimport { MessageResource } from '../../types'\nimport { ReactionCountResource } from '../../types/resources/reaction'\nimport { MessageAttachments } from './message_attachments'\nimport ErrorBoundary from '../page/error_boundary'\nimport { MessageMarkdown } from './message_markdown'\nimport { DenormalizedMessageAttachmentResource } from '../../types/resources/denormalized_attachment_resource'\nimport {\n CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n MESSAGE_AUTHOR_AVATAR_COLUMN_WIDTH,\n platformFontWeightMedium,\n} from '../../utils/styles'\nimport Animated from 'react-native-reanimated'\nimport { useLiveRelativeTime } from '../../hooks/use_live_relative_time'\nimport { MessageReadReceipts } from './message_read_receipts'\nimport { useMessageCreateOrUpdate } from '../../hooks/use_message_create_or_update'\nimport { Haptic } from '../../utils/native_adapters'\nimport { TheirReplyConnector, MyReplyConnector, AVATAR_CONNECTOR_SPACING } from './reply_connectors'\nimport { pluralize } from '../../utils'\nimport { useConversationMessage } from '../../hooks/use_conversation_message'\nimport { isNewMessage } from '../../utils/cache/messages_cache'\n\n/** Message\n * Component for display of a message within a conversation list\n */\ninterface MessageProps extends MessageResource {\n canDeleteNonAuthoredMessages: boolean\n conversation_id: number\n latestReadMessageSortKey?: string\n inReplyScreen?: boolean\n repliesEnabled?: boolean\n}\n\nexport function Message({\n canDeleteNonAuthoredMessages,\n conversation_id,\n latestReadMessageSortKey,\n inReplyScreen,\n repliesEnabled,\n ...message\n}: MessageProps) {\n const { text, reactionCounts, pending, error } = message\n const styles = useMessageStyles(message)\n const navigation = useNavigation()\n const { colors } = useTheme()\n const hasReactions = reactionCounts.length > 0\n const [showMessageMetaToggle, setShowMessageMetaToggle] = React.useState(false)\n const showMessageMeta =\n showMessageMetaToggle || message.myLatestInConversation || !!pending || !!error || false\n const timestamp = useLiveRelativeTime(message.createdAt)\n const wasEdited = Boolean(message.textEditedAt)\n const isPersisted = !isNewMessage(message)\n const [temporarilyHidePendingState, setTemporarilyHidePendingState] = React.useState(true)\n const [messageBubbleHeight, setMessageBubbleHeight] = React.useState(0)\n const { animatedBackgroundColor, handleMessagePressIn, handleMessagePressOut } =\n useAnimatedMessageBackgroundColor()\n const { message: replyRootMessage } = useConversationMessage({\n conversation_id,\n messageId: message.replyRootId || '',\n enabled: !!message.replyRootId,\n })\n\n const metaProps = {\n authorName: message.author.name,\n createdAt: message.createdAt,\n }\n\n const renderAuthor = (!message.mine && message.renderAuthor) || false\n const showReplyCountButton =\n !inReplyScreen && message.replyRootId === message.id && repliesEnabled\n const isReplyRootMessage = message.replyRootId === message.id\n const isDeletedReplyRootMessage = isReplyRootMessage && !!message.deletedAt\n\n const replyCountText = pluralize(message.replyCount, 'reply')\n const messagePendingLabel = isPersisted ? 'Saving' : 'Sending'\n const replyRootAuthorName = message.replyRootId\n ? replyRootMessage?.author.name\n : message.author.name\n\n const messageBottomMargin =\n message.lastInGroup || message.nextIsReplyShadowMessage\n ? 16\n : hasReactions || showMessageMeta || showReplyCountButton\n ? 8\n : 4\n\n useEffect(() => {\n if (pending) {\n const timer = setTimeout(() => {\n setTemporarilyHidePendingState(false)\n }, 2000)\n return () => clearTimeout(timer)\n }\n return () => {}\n }, [pending])\n\n const retryFailedSaveMutation = useMessageCreateOrUpdate({\n conversationId: conversation_id,\n message,\n })\n\n const handleRetry = () => {\n if (text && error) {\n retryFailedSaveMutation.mutateAsync({\n text,\n attachments: message.attachmentsForCreate,\n })\n }\n }\n\n const handleMessagePress = () => {\n setShowMessageMetaToggle(!showMessageMetaToggle)\n }\n\n const handleMessageLongPress = () => {\n if (!isPersisted) return\n\n Haptic.impactLight()\n navigation.navigate('MessageActions', {\n message_id: message.id,\n conversation_id,\n canDeleteNonAuthoredMessages,\n inReplyScreen,\n reply_root_author_name: replyRootAuthorName,\n })\n }\n\n const handleReactionLongPress = (reaction: ReactionCountResource) => {\n Haptic.impactLight()\n navigation.navigate('Reactions', {\n message_id: message.id,\n conversation_id,\n reaction_value: reaction.value,\n })\n }\n\n const handleMessageAttachmentLongPress = (attachment: DenormalizedMessageAttachmentResource) => {\n Haptic.impactLight()\n navigation.navigate('AttachmentActions', {\n attachmentId: attachment?.id,\n attachmentContentType: attachment?.attributes.contentType,\n attachmentUrl: attachment?.attributes.url,\n conversation_id,\n canDeleteNonAuthoredMessages,\n myMessage: message.mine,\n })\n }\n\n const handleNavigateToReplyPress = () => {\n navigation.navigate('ConversationReply', {\n conversation_id,\n reply_root_id: message.id,\n reply_root_author_name: message.author.name,\n })\n }\n\n return (\n <Pressable\n onLongPress={handleMessageLongPress}\n onPress={handleMessagePress}\n onPressIn={handleMessagePressIn}\n onPressOut={handleMessagePressOut}\n android_ripple={{ color: colors.androidRippleNeutral, borderless: false, foreground: true }}\n accessibilityHint=\"Long press to view message actions like reacting and copying.\"\n disabled={isDeletedReplyRootMessage}\n >\n <Animated.View style={[styles.message, animatedBackgroundColor]}>\n {!message.mine && (\n <View>\n {renderAuthor ? (\n <Avatar\n size={'md'}\n sourceUri={message.author.avatar}\n style={styles.avatar}\n maxFontSizeMultiplier={1}\n minFontSizeMultiplier={1}\n fallbackIconName={isDeletedReplyRootMessage ? 'publishing.trash' : 'general.person'}\n showFallback={isDeletedReplyRootMessage}\n />\n ) : (\n <View style={styles.avatarPlaceholder} />\n )}\n {repliesEnabled && (\n <TheirReplyConnector message={message} messageBubbleHeight={messageBubbleHeight} />\n )}\n </View>\n )}\n <View style={[styles.messageContent, { marginBottom: messageBottomMargin }]}>\n {renderAuthor && !isDeletedReplyRootMessage && (\n <Text variant=\"footnote\" style={styles.authorName}>\n {message.author.name}\n </Text>\n )}\n <View\n style={styles.messageBubble}\n onLayout={e => setMessageBubbleHeight(e.nativeEvent.layout.height)}\n >\n {isDeletedReplyRootMessage ? (\n <View style={styles.messageText}>\n <Text style={styles.replyRootDeletedText}>Message deleted</Text>\n </View>\n ) : (\n <>\n <ErrorBoundary>\n <MessageAttachments\n attachments={message.attachments}\n metaProps={metaProps}\n onMessageAttachmentLongPress={handleMessageAttachmentLongPress}\n onMessageLongPress={handleMessageLongPress}\n />\n </ErrorBoundary>\n {text && (\n <View style={styles.messageText}>\n <MessageMarkdown text={text} />\n </View>\n )}\n </>\n )}\n </View>\n {showReplyCountButton && (\n <TextButton\n variant=\"footnote\"\n onPress={handleNavigateToReplyPress}\n style={styles.messageReplyCount}\n accessibilityHint=\"Navigates to reply screen for this message\"\n accessibilityRole=\"link\"\n >\n {replyCountText}\n </TextButton>\n )}\n {hasReactions && !isDeletedReplyRootMessage && (\n <View style={styles.messageReactions}>\n {reactionCounts.map(reaction => (\n <MessageReaction\n key={reaction.value}\n reaction={reaction}\n onLongPress={handleReactionLongPress}\n message={message}\n conversationId={conversation_id}\n />\n ))}\n </View>\n )}\n {showMessageMeta && !isDeletedReplyRootMessage && (\n <View style={styles.messageMeta}>\n {message.mine && !pending && !error && (\n <MessageReadReceipts\n message={message}\n latestReadMessageSortKey={latestReadMessageSortKey}\n />\n )}\n {error ? (\n <View style={styles.errorContainer}>\n {retryFailedSaveMutation.isPending ? (\n <Spinner size={12} />\n ) : (\n <Icon name=\"general.exclamationTriangle\" size={12} style={styles.errorIcon} />\n )}\n <Text variant=\"footnote\" style={styles.errorText}>\n Failed to {isPersisted ? 'edit' : 'send'} |{' '}\n <TextInlineButton\n onPress={handleRetry}\n variant=\"footnote\"\n appearance=\"danger\"\n disabled={retryFailedSaveMutation.isPending}\n >\n Try again\n </TextInlineButton>\n </Text>\n </View>\n ) : pending && (!temporarilyHidePendingState || isPersisted) ? (\n <View style={styles.pendingIndicatorContainer}>\n <Icon\n name=\"general.outlinedClock\"\n size={12}\n color={colors.iconColorDefaultSecondary}\n />\n <Text variant=\"footnote\">{messagePendingLabel}</Text>\n </View>\n ) : isPersisted ? (\n <Text variant=\"footnote\">{timestamp}</Text>\n ) : null}\n {!pending && !error && wasEdited && (\n <Text variant=\"footnote\">\n |{' '}\n <Text variant=\"footnote\" style={styles.editedText}>\n Edited\n </Text>\n </Text>\n )}\n </View>\n )}\n </View>\n {repliesEnabled && message.mine && (\n <MyReplyConnector message={message} messageBubbleHeight={messageBubbleHeight} />\n )}\n </Animated.View>\n </Pressable>\n )\n}\n\nconst useMessageStyles = ({ mine }: MessageResource) => {\n const { colors } = useTheme()\n const myMessageBackgroundColor = useInteractionGhostBackgroundColor()\n const { width } = useWindowDimensions()\n const tabletWidth = width >= 744 // Smallest iPad Mini's width\n\n const messageBubbleBackgroundColor = mine ? myMessageBackgroundColor : colors.fillColorNeutral070\n\n return StyleSheet.create({\n message: {\n gap: 8,\n flexDirection: mine ? 'row-reverse' : 'row',\n paddingHorizontal: CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n },\n messageContent: {\n flex: 1,\n gap: 4,\n },\n avatar: {\n marginBottom: AVATAR_CONNECTOR_SPACING,\n },\n avatarPlaceholder: {\n width: MESSAGE_AUTHOR_AVATAR_COLUMN_WIDTH, // Same width as avatar\n },\n authorName: {\n fontWeight: platformFontWeightMedium,\n },\n messageBubble: {\n backgroundColor: messageBubbleBackgroundColor,\n borderRadius: 8,\n maxWidth: tabletWidth ? 360 : '80%',\n alignSelf: mine ? 'flex-end' : 'flex-start',\n },\n messageText: {\n paddingVertical: 6,\n paddingHorizontal: 8,\n },\n messageReactions: {\n flexDirection: 'row',\n gap: 4,\n justifyContent: mine ? 'flex-end' : 'flex-start',\n },\n messageReplyCount: {\n alignSelf: mine ? 'flex-end' : 'flex-start',\n },\n messageMeta: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: mine ? 'flex-end' : 'flex-start',\n gap: 4,\n },\n editedText: {\n fontWeight: platformFontWeightMedium,\n },\n pendingIndicatorContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n },\n errorContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n },\n errorIcon: {\n color: colors.statusErrorIcon,\n },\n errorText: {\n color: colors.statusErrorText,\n },\n replyRootDeletedText: {\n color: colors.textColorDefaultSecondary,\n fontStyle: 'italic',\n },\n })\n}\n"]}
1
+ {"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/components/conversation/message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAEL,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,IAAI,GACL,MAAM,cAAc,CAAA;AACrB,O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Q;YACpB,GAAG,EAAE,CAAC;SACP;QACD,cAAc,EAAE;YACd,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;SACP;QACD,SAAS,EAAE;YACT,KAAK,EAAE,MAAM,CAAC,eAAe;SAC9B;QACD,SAAS,EAAE;YACT,KAAK,EAAE,MAAM,CAAC,eAAe;SAC9B;QACD,oBAAoB,EAAE;YACpB,KAAK,EAAE,MAAM,CAAC,yBAAyB;YACvC,SAAS,EAAE,QAAQ;SACpB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport React, { useEffect } from 'react'\nimport {\n AccessibilityActionEvent,\n Pressable,\n StyleSheet,\n useWindowDimensions,\n View,\n} from 'react-native'\nimport { MessageReaction } from '../../components/conversation/message_reaction'\nimport { Avatar, Icon, Spinner, Text, TextButton, TextInlineButton } from '../../components/display'\nimport {\n useAnimatedMessageBackgroundColor,\n useInteractionGhostBackgroundColor,\n useTheme,\n} from '../../hooks'\nimport { MessageResource } from '../../types'\nimport { ReactionCountResource } from '../../types/resources/reaction'\nimport { MessageAttachments } from './message_attachments'\nimport ErrorBoundary from '../page/error_boundary'\nimport { MessageMarkdown } from './message_markdown'\nimport { DenormalizedMessageAttachmentResource } from '../../types/resources/denormalized_attachment_resource'\nimport {\n CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n MESSAGE_AUTHOR_AVATAR_COLUMN_WIDTH,\n platformFontWeightMedium,\n} from '../../utils/styles'\nimport Animated from 'react-native-reanimated'\nimport { useLiveRelativeTime } from '../../hooks/use_live_relative_time'\nimport { MessageReadReceipts } from './message_read_receipts'\nimport { useMessageCreateOrUpdate } from '../../hooks/use_message_create_or_update'\nimport { Haptic } from '../../utils/native_adapters'\nimport { TheirReplyConnector, MyReplyConnector, AVATAR_CONNECTOR_SPACING } from './reply_connectors'\nimport { pluralize } from '../../utils'\nimport { useConversationMessage } from '../../hooks/use_conversation_message'\nimport { some } from 'lodash'\nimport { isNewMessage } from '../../utils/cache/messages_cache'\n\n/** Message\n * Component for display of a message within a conversation list\n */\ninterface MessageProps extends MessageResource {\n canDeleteNonAuthoredMessages: boolean\n conversation_id: number\n latestReadMessageSortKey?: string\n inReplyScreen?: boolean\n repliesEnabled?: boolean\n}\n\nexport function Message({\n canDeleteNonAuthoredMessages,\n conversation_id,\n latestReadMessageSortKey,\n inReplyScreen,\n repliesEnabled,\n ...message\n}: MessageProps) {\n const { text, reactionCounts, pending, error, attachments, author } = message\n const styles = useMessageStyles(message)\n const navigation = useNavigation()\n const { colors } = useTheme()\n const hasReactions = reactionCounts.length > 0\n const [showMessageMetaToggle, setShowMessageMetaToggle] = React.useState(false)\n const showMessageMeta =\n showMessageMetaToggle || message.myLatestInConversation || !!pending || !!error || false\n const timestamp = useLiveRelativeTime(message.createdAt)\n const wasEdited = Boolean(message.textEditedAt)\n const isPersisted = !isNewMessage(message)\n const [temporarilyHidePendingState, setTemporarilyHidePendingState] = React.useState(true)\n const [messageBubbleHeight, setMessageBubbleHeight] = React.useState(0)\n const { animatedBackgroundColor, handleMessagePressIn, handleMessagePressOut } =\n useAnimatedMessageBackgroundColor()\n const { message: replyRootMessage } = useConversationMessage({\n conversation_id,\n messageId: message.replyRootId || '',\n enabled: !!message.replyRootId,\n })\n\n const metaProps = {\n authorName: author.name,\n createdAt: message.createdAt,\n }\n\n const renderAuthor = (!message.mine && message.renderAuthor) || false\n const showReplyCountButton =\n !inReplyScreen && message.replyRootId === message.id && repliesEnabled\n const isReplyRootMessage = message.replyRootId === message.id\n const isDeletedReplyRootMessage = isReplyRootMessage && !!message.deletedAt\n const replyToReplyRootMessage = repliesEnabled && !isReplyRootMessage && !!message.replyRootId\n\n const replyCountText = pluralize(message.replyCount, 'reply')\n const messagePendingLabel = isPersisted ? 'Saving' : 'Sending'\n const replyRootAuthorName = message.replyRootId ? replyRootMessage?.author.name : author.name\n const messageText = isDeletedReplyRootMessage ? 'Message deleted' : text\n\n const messageBottomMargin =\n message.lastInGroup || message.nextIsReplyShadowMessage\n ? 16\n : hasReactions || showMessageMeta || showReplyCountButton\n ? 8\n : 4\n\n const messageIsReplyLabel = replyToReplyRootMessage ? 'Reply' : ''\n const attachmentLabel = some(attachments) ? pluralize(attachments.length, 'attachment') : ''\n const replyCountLabel = isReplyRootMessage ? replyCountText : ''\n const accessibilityLabel = `${author?.name || ''} ${messageIsReplyLabel} ${attachmentLabel} ${messageText || ''} ${timestamp} ${replyCountLabel}`\n\n useEffect(() => {\n if (pending) {\n const timer = setTimeout(() => {\n setTemporarilyHidePendingState(false)\n }, 2000)\n return () => clearTimeout(timer)\n }\n return () => {}\n }, [pending])\n\n const retryFailedSaveMutation = useMessageCreateOrUpdate({\n conversationId: conversation_id,\n message,\n })\n\n const handleRetry = () => {\n if (text && error) {\n retryFailedSaveMutation.mutateAsync({\n text,\n attachments: message.attachmentsForCreate,\n })\n }\n }\n\n const handleMessagePress = () => {\n setShowMessageMetaToggle(!showMessageMetaToggle)\n }\n\n const handleMessageLongPress = () => {\n if (!isPersisted) return\n\n Haptic.impactLight()\n navigation.navigate('MessageActions', {\n message_id: message.id,\n conversation_id,\n canDeleteNonAuthoredMessages,\n inReplyScreen,\n reply_root_author_name: replyRootAuthorName,\n })\n }\n\n const handleReactionLongPress = (reaction: ReactionCountResource) => {\n Haptic.impactLight()\n navigation.navigate('Reactions', {\n message_id: message.id,\n conversation_id,\n reaction_value: reaction.value,\n })\n }\n\n const handleMessageAttachmentLongPress = (attachment: DenormalizedMessageAttachmentResource) => {\n Haptic.impactLight()\n navigation.navigate('AttachmentActions', {\n attachmentId: attachment?.id,\n attachmentContentType: attachment?.attributes.contentType,\n attachmentUrl: attachment?.attributes.url,\n conversation_id,\n canDeleteNonAuthoredMessages,\n myMessage: message.mine,\n })\n }\n\n const handleNavigateToReplyPress = () => {\n navigation.navigate('ConversationReply', {\n conversation_id,\n reply_root_id: message.id,\n reply_root_author_name: author.name,\n })\n }\n\n const accessibilityActions = [\n {\n name: 'navigateToReplies',\n label: 'Navigate to replies',\n },\n ]\n\n const handleAccessibilityAction = (event: AccessibilityActionEvent) => {\n if (event.nativeEvent.actionName === 'navigateToReplies') {\n handleNavigateToReplyPress()\n }\n }\n\n return (\n <Pressable\n onLongPress={handleMessageLongPress}\n onPress={handleMessagePress}\n onPressIn={handleMessagePressIn}\n onPressOut={handleMessagePressOut}\n android_ripple={{ color: colors.androidRippleNeutral, borderless: false, foreground: true }}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint=\"Long press to view message actions like reacting and copying.\"\n accessibilityActions={isReplyRootMessage ? accessibilityActions : undefined}\n onAccessibilityAction={isReplyRootMessage ? handleAccessibilityAction : undefined}\n disabled={isDeletedReplyRootMessage}\n >\n <Animated.View style={[styles.message, animatedBackgroundColor]}>\n {!message.mine && (\n <View>\n {renderAuthor ? (\n <Avatar\n size={'md'}\n sourceUri={author.avatar}\n style={styles.avatar}\n maxFontSizeMultiplier={1}\n minFontSizeMultiplier={1}\n fallbackIconName={isDeletedReplyRootMessage ? 'publishing.trash' : 'general.person'}\n showFallback={isDeletedReplyRootMessage}\n />\n ) : (\n <View style={styles.avatarPlaceholder} />\n )}\n {repliesEnabled && (\n <TheirReplyConnector message={message} messageBubbleHeight={messageBubbleHeight} />\n )}\n </View>\n )}\n <View style={[styles.messageContent, { marginBottom: messageBottomMargin }]}>\n {renderAuthor && !isDeletedReplyRootMessage && (\n <Text variant=\"footnote\" style={styles.authorName}>\n {author.name}\n </Text>\n )}\n <View\n style={styles.messageBubble}\n onLayout={e => setMessageBubbleHeight(e.nativeEvent.layout.height)}\n >\n {isDeletedReplyRootMessage ? (\n <View style={styles.messageText}>\n <Text style={styles.replyRootDeletedText}>{messageText}</Text>\n </View>\n ) : (\n <>\n <ErrorBoundary>\n <MessageAttachments\n attachments={attachments}\n metaProps={metaProps}\n onMessageAttachmentLongPress={handleMessageAttachmentLongPress}\n onMessageLongPress={handleMessageLongPress}\n />\n </ErrorBoundary>\n {text && (\n <View style={styles.messageText}>\n <MessageMarkdown text={text} />\n </View>\n )}\n </>\n )}\n </View>\n {showReplyCountButton && (\n <TextButton\n variant=\"footnote\"\n onPress={handleNavigateToReplyPress}\n style={styles.messageReplyCount}\n accessibilityHint=\"Navigates to reply screen for this message\"\n accessibilityRole=\"link\"\n >\n {replyCountText}\n </TextButton>\n )}\n {hasReactions && !isDeletedReplyRootMessage && (\n <View style={styles.messageReactions}>\n {reactionCounts.map(reaction => (\n <MessageReaction\n key={reaction.value}\n reaction={reaction}\n onLongPress={handleReactionLongPress}\n message={message}\n conversationId={conversation_id}\n />\n ))}\n </View>\n )}\n {showMessageMeta && !isDeletedReplyRootMessage && (\n <View style={styles.messageMeta}>\n {message.mine && !pending && !error && (\n <MessageReadReceipts\n message={message}\n latestReadMessageSortKey={latestReadMessageSortKey}\n />\n )}\n {error ? (\n <View style={styles.errorContainer}>\n {retryFailedSaveMutation.isPending ? (\n <Spinner size={12} />\n ) : (\n <Icon name=\"general.exclamationTriangle\" size={12} style={styles.errorIcon} />\n )}\n <Text variant=\"footnote\" style={styles.errorText}>\n Failed to {isPersisted ? 'edit' : 'send'} |{' '}\n <TextInlineButton\n onPress={handleRetry}\n variant=\"footnote\"\n appearance=\"danger\"\n disabled={retryFailedSaveMutation.isPending}\n >\n Try again\n </TextInlineButton>\n </Text>\n </View>\n ) : pending && (!temporarilyHidePendingState || isPersisted) ? (\n <View style={styles.pendingIndicatorContainer}>\n <Icon\n name=\"general.outlinedClock\"\n size={12}\n color={colors.iconColorDefaultSecondary}\n />\n <Text variant=\"footnote\">{messagePendingLabel}</Text>\n </View>\n ) : isPersisted ? (\n <Text variant=\"footnote\">{timestamp}</Text>\n ) : null}\n {!pending && !error && wasEdited && (\n <Text variant=\"footnote\">\n |{' '}\n <Text variant=\"footnote\" style={styles.editedText}>\n Edited\n </Text>\n </Text>\n )}\n </View>\n )}\n </View>\n {repliesEnabled && message.mine && (\n <MyReplyConnector message={message} messageBubbleHeight={messageBubbleHeight} />\n )}\n </Animated.View>\n </Pressable>\n )\n}\n\nconst useMessageStyles = ({ mine }: MessageResource) => {\n const { colors } = useTheme()\n const myMessageBackgroundColor = useInteractionGhostBackgroundColor()\n const { width } = useWindowDimensions()\n const tabletWidth = width >= 744 // Smallest iPad Mini's width\n\n const messageBubbleBackgroundColor = mine ? myMessageBackgroundColor : colors.fillColorNeutral070\n\n return StyleSheet.create({\n message: {\n gap: 8,\n flexDirection: mine ? 'row-reverse' : 'row',\n paddingHorizontal: CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n },\n messageContent: {\n flex: 1,\n gap: 4,\n },\n avatar: {\n marginBottom: AVATAR_CONNECTOR_SPACING,\n },\n avatarPlaceholder: {\n width: MESSAGE_AUTHOR_AVATAR_COLUMN_WIDTH, // Same width as avatar\n },\n authorName: {\n fontWeight: platformFontWeightMedium,\n },\n messageBubble: {\n backgroundColor: messageBubbleBackgroundColor,\n borderRadius: 8,\n maxWidth: tabletWidth ? 360 : '80%',\n alignSelf: mine ? 'flex-end' : 'flex-start',\n },\n messageText: {\n paddingVertical: 6,\n paddingHorizontal: 8,\n },\n messageReactions: {\n flexDirection: 'row',\n gap: 4,\n justifyContent: mine ? 'flex-end' : 'flex-start',\n },\n messageReplyCount: {\n alignSelf: mine ? 'flex-end' : 'flex-start',\n },\n messageMeta: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: mine ? 'flex-end' : 'flex-start',\n gap: 4,\n },\n editedText: {\n fontWeight: platformFontWeightMedium,\n },\n pendingIndicatorContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n },\n errorContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n },\n errorIcon: {\n color: colors.statusErrorIcon,\n },\n errorText: {\n color: colors.statusErrorText,\n },\n replyRootDeletedText: {\n color: colors.textColorDefaultSecondary,\n fontStyle: 'italic',\n },\n })\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"reply_shadow_message.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/reply_shadow_message.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAmB7C,UAAU,uBAAwB,SAAQ,eAAe;IACvD,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,iBAAiB,EAAE,OAAO,CAAA;CAC3B;AAED,wBAAgB,kBAAkB,CAAC,EACjC,eAAe,EACf,aAAa,EACb,SAAS,EACT,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,uBAAuB,4BAczB"}
1
+ {"version":3,"file":"reply_shadow_message.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/reply_shadow_message.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAqB7C,UAAU,uBAAwB,SAAQ,eAAe;IACvD,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,iBAAiB,EAAE,OAAO,CAAA;CAC3B;AAED,wBAAgB,kBAAkB,CAAC,EACjC,eAAe,EACf,aAAa,EACb,SAAS,EACT,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,uBAAuB,4BAczB"}
@@ -8,6 +8,8 @@ import { TheirReplyConnector, MyReplyConnector } from './reply_connectors';
8
8
  import { assertKeysAreNumbers, pluralize } from '../../utils';
9
9
  import { useNavigation } from '@react-navigation/native';
10
10
  import { useConversationMessage } from '../../hooks/use_conversation_message';
11
+ import { useLiveRelativeTime } from '../../hooks/use_live_relative_time';
12
+ import { some } from 'lodash';
11
13
  export function ReplyShadowMessage({ conversation_id, inReplyScreen, messageId, isReplyShadowMessage, nextRendersAuthor, }) {
12
14
  const { message, isError, isLoading } = useConversationMessage({ conversation_id, messageId });
13
15
  if (inReplyScreen)
@@ -24,10 +26,11 @@ export function ReplyShadowMessage({ conversation_id, inReplyScreen, messageId,
24
26
  return <ShadowMessageContent conversation_id={conversation_id} {...enrichedMessage}/>;
25
27
  }
26
28
  function ShadowMessageContent({ conversation_id, ...message }) {
27
- const { text, deletedAt } = message;
29
+ const { text, deletedAt, author, attachments } = message;
28
30
  const styles = useStyles(message);
29
31
  const { colors } = useTheme();
30
32
  const navigation = useNavigation();
33
+ const timestamp = useLiveRelativeTime(message.createdAt);
31
34
  const [messageBubbleHeight, setMessageBubbleHeight] = React.useState(0);
32
35
  const { animatedBackgroundColor, handleMessagePressIn, handleMessagePressOut } = useAnimatedMessageBackgroundColor();
33
36
  const scalableNumberOfLines = useScalableNumberOfLines(2);
@@ -41,7 +44,9 @@ function ShadowMessageContent({ conversation_id, ...message }) {
41
44
  reply_root_author_name: message.author.name,
42
45
  });
43
46
  };
44
- return (<Pressable android_ripple={{ color: colors.androidRippleNeutral }} onPress={handleNavigateToReplies} onPressIn={handleMessagePressIn} onPressOut={handleMessagePressOut} accessibilityHint="Navigate to reply screen for this message" accessibilityRole="link">
47
+ const attachmentLabel = some(attachments) ? pluralize(attachments.length, 'attachment') : '';
48
+ const accessibilityLabel = `${author?.name || ''} Reply Preview ${attachmentLabel} ${messageText || ''} ${timestamp} ${replyCountText}`;
49
+ return (<Pressable android_ripple={{ color: colors.androidRippleNeutral }} onPress={handleNavigateToReplies} onPressIn={handleMessagePressIn} onPressOut={handleMessagePressOut} accessibilityLabel={accessibilityLabel} accessibilityHint="Navigate to reply screen for this message" accessibilityRole="link">
45
50
  <Animated.View style={[styles.message, animatedBackgroundColor]}>
46
51
  {!message.mine && (<View>
47
52
  <View style={[styles.avatarWrapper, !isDeleted && styles.avatarOpacity]}>
@@ -51,7 +56,7 @@ function ShadowMessageContent({ conversation_id, ...message }) {
51
56
  </View>)}
52
57
  <View style={styles.messageContent}>
53
58
  <View style={styles.messageBubble} onLayout={e => setMessageBubbleHeight(e.nativeEvent.layout.height)}>
54
- <MessageAttachmentImagery attachments={message.attachments}/>
59
+ <MessageAttachmentImagery attachments={attachments}/>
55
60
  {text && (<Text variant="footnote" style={styles.messageText} numberOfLines={scalableNumberOfLines}>
56
61
  {messageText}
57
62
  </Text>)}
@@ -1 +1 @@
1
- {"version":3,"file":"reply_shadow_message.js","sourceRoot":"","sources":["../../../src/components/conversation/reply_shadow_message.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/E,OAAO,EAAE,MAAM,EAAE,IAAI,EAAa,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjE,OAAO,EACL,iCAAiC,EACjC,YAAY,EACZ,wBAAwB,EACxB,QAAQ,GACT,MAAM,aAAa,CAAA;AAQpB,OAAO,EACL,4CAA4C,EAC5C,wBAAwB,EACxB,kCAAkC,EAClC,wBAAwB,GACzB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,QAAQ,MAAM,yBAAyB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1E,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAA;AAU7E,MAAM,UAAU,kBAAkB,CAAC,EACjC,eAAe,EACf,aAAa,EACb,SAAS,EACT,oBAAoB,EACpB,iBAAiB,GACO;IACxB,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,sBAAsB,CAAC,EAAE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I,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY;SACjD;QACD,cAAc,EAAE;YACd,KAAK,EAAE,MAAM,CAAC,WAAW;YACzB,UAAU,EAAE,wBAAwB;SACrC;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,EAAE,GAAG,SAAS;YACrB,WAAW,EAAE,UAAU,GAAG,WAAW;YACrC,OAAO,EAAE,GAAG;SACb;QACD,KAAK,EAAE;YACL,YAAY,EAAE,CAAC;SAChB;QACD,cAAc,EAAE;YACd,KAAK,EAAE,MAAM,CAAC,mBAAmB;YACjC,QAAQ,EAAE,EAAE;SACb;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Pressable, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { Avatar, Icon, IconProps, Image, Text } from '../display'\nimport {\n useAnimatedMessageBackgroundColor,\n useFontScale,\n useScalableNumberOfLines,\n useTheme,\n} from '../../hooks'\nimport { MessageResource } from '../../types'\nimport {\n DenormalizedAttachmentResource,\n DenormalizedGiphyAttachmentResource,\n DenormalizedExpandedLinkAttachmentResource,\n DenormalizedMessageAttachmentResource,\n} from '../../types/resources/denormalized_attachment_resource'\nimport {\n CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n MAX_FONT_SIZE_MULTIPLIER,\n MESSAGE_AUTHOR_AVATAR_COLUMN_WIDTH,\n platformFontWeightMedium,\n} from '../../utils/styles'\nimport Animated from 'react-native-reanimated'\nimport { TheirReplyConnector, MyReplyConnector } from './reply_connectors'\nimport { assertKeysAreNumbers, pluralize } from '../../utils'\nimport { useNavigation } from '@react-navigation/native'\nimport { useConversationMessage } from '../../hooks/use_conversation_message'\n\ninterface ReplyShadowMessageProps extends MessageResource {\n messageId: string\n conversation_id: number\n inReplyScreen?: boolean\n isReplyShadowMessage: boolean\n nextRendersAuthor: boolean\n}\n\nexport function ReplyShadowMessage({\n conversation_id,\n inReplyScreen,\n messageId,\n isReplyShadowMessage,\n nextRendersAuthor,\n}: ReplyShadowMessageProps) {\n const { message, isError, isLoading } = useConversationMessage({ conversation_id, messageId })\n\n if (inReplyScreen) return null\n if (isLoading) return <ShadowMessageFallback text=\"Loading...\" />\n if (isError || !message) return <ShadowMessageFallback text=\"Message deleted\" />\n\n const enrichedMessage = {\n ...message,\n isReplyShadowMessage,\n nextRendersAuthor,\n }\n\n return <ShadowMessageContent conversation_id={conversation_id} {...enrichedMessage} />\n}\n\ninterface ShadowMessageContentProps extends MessageResource {\n conversation_id: number\n}\n\nfunction ShadowMessageContent({ conversation_id, ...message }: ShadowMessageContentProps) {\n const { text, deletedAt } = message\n const styles = useStyles(message)\n const { colors } = useTheme()\n const navigation = useNavigation()\n\n const [messageBubbleHeight, setMessageBubbleHeight] = React.useState(0)\n const { animatedBackgroundColor, handleMessagePressIn, handleMessagePressOut } =\n useAnimatedMessageBackgroundColor()\n const scalableNumberOfLines = useScalableNumberOfLines(2)\n const replyCountText = pluralize(message.replyCount, 'reply')\n const isDeleted = !!deletedAt\n const messageText = isDeleted ? 'Message deleted' : text\n\n const handleNavigateToReplies = () => {\n navigation.navigate('ConversationReply', {\n conversation_id,\n reply_root_id: message.replyRootId,\n reply_root_author_name: message.author.name,\n })\n }\n\n return (\n <Pressable\n android_ripple={{ color: colors.androidRippleNeutral }}\n onPress={handleNavigateToReplies}\n onPressIn={handleMessagePressIn}\n onPressOut={handleMessagePressOut}\n accessibilityHint=\"Navigate to reply screen for this message\"\n accessibilityRole=\"link\"\n >\n <Animated.View style={[styles.message, animatedBackgroundColor]}>\n {!message.mine && (\n <View>\n <View style={[styles.avatarWrapper, !isDeleted && styles.avatarOpacity]}>\n <Avatar\n size=\"xs\"\n sourceUri={message.author.avatar}\n style={styles.avatar}\n maxFontSizeMultiplier={1}\n fallbackIconName={isDeleted ? 'publishing.trash' : 'general.person'}\n showFallback={isDeleted}\n />\n </View>\n <TheirReplyConnector message={message} messageBubbleHeight={messageBubbleHeight} />\n </View>\n )}\n <View style={styles.messageContent}>\n <View\n style={styles.messageBubble}\n onLayout={e => setMessageBubbleHeight(e.nativeEvent.layout.height)}\n >\n <MessageAttachmentImagery attachments={message.attachments} />\n {text && (\n <Text\n variant=\"footnote\"\n style={styles.messageText}\n numberOfLines={scalableNumberOfLines}\n >\n {messageText}\n </Text>\n )}\n </View>\n <View style={styles.messageMeta}>\n <Text variant=\"footnote\" style={styles.replyCountText}>\n {replyCountText}\n </Text>\n </View>\n </View>\n {message.mine && (\n <MyReplyConnector message={message} messageBubbleHeight={messageBubbleHeight} />\n )}\n </Animated.View>\n </Pressable>\n )\n}\n\nfunction MessageAttachmentImagery({\n attachments,\n}: {\n attachments: DenormalizedAttachmentResource[]\n}) {\n if (!attachments || attachments.length === 0) return null\n\n const attachment = attachments[0]\n\n if (attachment.type === 'giphy') {\n return <GiphyImage attachment={attachment} />\n }\n if (attachment.type === 'ExpandedLink') {\n return <ExpandedLinkImage attachment={attachment} />\n }\n if (attachment.type === 'MessageAttachment') {\n const contentType = attachment.attributes?.contentType\n const basicType = contentType?.split('/')[0]\n\n switch (basicType) {\n case 'image':\n return <MessageAttachmentImage attachment={attachment} />\n case 'video':\n return <MessageAttachmentIcon iconName=\"general.outlinedVideoFile\" />\n case 'audio':\n return <MessageAttachmentIcon iconName=\"general.outlinedMusicFile\" />\n case 'application':\n return <MessageAttachmentIcon iconName=\"general.outlinedGenericFile\" />\n default:\n return null\n }\n }\n\n return null\n}\n\nfunction GiphyImage({ attachment }: { attachment: DenormalizedGiphyAttachmentResource }) {\n const { title, giphy } = attachment\n const { url } = giphy.fixedWidth\n const { width, height } = assertKeysAreNumbers(giphy.fixedWidth)\n const styles = useStyles({ imageWidth: width, imageHeight: height })\n\n return (\n <Image\n source={{ uri: url }}\n wrapperStyle={styles.imageWrapper}\n style={styles.image}\n alt={title}\n loaderSize={16}\n />\n )\n}\n\nfunction ExpandedLinkImage({\n attachment,\n}: {\n attachment: DenormalizedExpandedLinkAttachmentResource\n}) {\n const { title = '', imageUrl, imageHeight, imageWidth } = attachment.attributes\n const styles = useStyles({ imageWidth, imageHeight })\n\n return (\n <Image\n source={{ uri: imageUrl }}\n wrapperStyle={styles.imageWrapper}\n style={styles.image}\n alt={title}\n loaderSize={16}\n />\n )\n}\n\nfunction MessageAttachmentImage({\n attachment,\n}: {\n attachment: DenormalizedMessageAttachmentResource\n}) {\n const { url, urlMedium, filename, metadata = {} } = attachment.attributes\n const styles = useStyles({ imageWidth: metadata.width, imageHeight: metadata.height })\n\n return (\n <Image\n source={{ uri: urlMedium || url }}\n style={styles.image}\n wrapperStyle={styles.imageWrapper}\n alt={filename}\n loaderSize={16}\n />\n )\n}\n\nfunction MessageAttachmentIcon({ iconName }: { iconName: IconProps['name'] }) {\n const styles = useStyles()\n return (\n <Icon\n name={iconName}\n style={styles.attachmentIcon}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n )\n}\n\n// TODO: The mine prop is not used yet, but in the future we will be adding a way to find the `mine` value for this fallback.\nfunction ShadowMessageFallback({ text, mine }: { text: string; mine?: boolean }) {\n const styles = useStyles({ mine })\n\n return (\n <View style={styles.message}>\n <View style={styles.messageContent}>\n <View style={styles.messageBubble}>\n <Text variant=\"footnote\" style={styles.messageText}>\n {text}\n </Text>\n </View>\n </View>\n </View>\n )\n}\n\ninterface StylesProps {\n imageWidth?: number\n imageHeight?: number\n mine?: boolean\n}\n\nconst useStyles = ({ mine, imageWidth = 32, imageHeight = 32 }: StylesProps = {}) => {\n const { colors } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER })\n const { width } = useWindowDimensions()\n const tabletWidth = width >= 744 // Smallest iPad Mini's width\n\n return StyleSheet.create({\n message: {\n gap: 8,\n flexDirection: mine ? 'row-reverse' : 'row',\n paddingHorizontal: CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n },\n messageContent: {\n flex: 1,\n gap: 4,\n marginBottom: 12,\n },\n avatarWrapper: {\n width: MESSAGE_AUTHOR_AVATAR_COLUMN_WIDTH,\n alignItems: 'center',\n },\n avatar: {\n marginBottom: 8,\n },\n avatarOpacity: {\n opacity: 0.5,\n },\n messageBubble: {\n flexDirection: 'row',\n alignSelf: mine ? 'flex-end' : 'flex-start',\n alignItems: 'center',\n gap: 8,\n borderColor: colors.borderColorDefaultBase,\n borderWidth: 1,\n borderRadius: 8,\n maxWidth: tabletWidth ? 360 : '80%',\n paddingVertical: 6,\n paddingHorizontal: 8,\n },\n messageText: {\n color: colors.textColorDefaultPlaceholder,\n flexShrink: 1,\n },\n messageMeta: {\n flexDirection: 'row',\n justifyContent: mine ? 'flex-end' : 'flex-start',\n },\n replyCountText: {\n color: colors.interaction,\n fontWeight: platformFontWeightMedium,\n },\n imageWrapper: {\n width: 32 * fontScale,\n aspectRatio: imageWidth / imageHeight,\n opacity: 0.5,\n },\n image: {\n borderRadius: 4,\n },\n attachmentIcon: {\n color: colors.iconColorDefaultDim,\n fontSize: 16,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"reply_shadow_message.js","sourceRoot":"","sources":["../../../src/components/conversation/reply_shadow_message.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/E,OAAO,EAAE,MAAM,EAAE,IAAI,EAAa,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjE,OAAO,EACL,iCAAiC,EACjC,YAAY,EACZ,wBAAwB,EACxB,QAAQ,GACT,MAAM,aAAa,CAAA;AAQpB,OAAO,EACL,4CAA4C,EAC5C,wBAAwB,EACxB,kCAAkC,EAClC,wBAAwB,GACzB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,QAAQ,MAAM,yBAAyB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1E,OAAO,EA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,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Pressable, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { Avatar, Icon, IconProps, Image, Text } from '../display'\nimport {\n useAnimatedMessageBackgroundColor,\n useFontScale,\n useScalableNumberOfLines,\n useTheme,\n} from '../../hooks'\nimport { MessageResource } from '../../types'\nimport {\n DenormalizedAttachmentResource,\n DenormalizedGiphyAttachmentResource,\n DenormalizedExpandedLinkAttachmentResource,\n DenormalizedMessageAttachmentResource,\n} from '../../types/resources/denormalized_attachment_resource'\nimport {\n CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n MAX_FONT_SIZE_MULTIPLIER,\n MESSAGE_AUTHOR_AVATAR_COLUMN_WIDTH,\n platformFontWeightMedium,\n} from '../../utils/styles'\nimport Animated from 'react-native-reanimated'\nimport { TheirReplyConnector, MyReplyConnector } from './reply_connectors'\nimport { assertKeysAreNumbers, pluralize } from '../../utils'\nimport { useNavigation } from '@react-navigation/native'\nimport { useConversationMessage } from '../../hooks/use_conversation_message'\nimport { useLiveRelativeTime } from '../../hooks/use_live_relative_time'\nimport { some } from 'lodash'\n\ninterface ReplyShadowMessageProps extends MessageResource {\n messageId: string\n conversation_id: number\n inReplyScreen?: boolean\n isReplyShadowMessage: boolean\n nextRendersAuthor: boolean\n}\n\nexport function ReplyShadowMessage({\n conversation_id,\n inReplyScreen,\n messageId,\n isReplyShadowMessage,\n nextRendersAuthor,\n}: ReplyShadowMessageProps) {\n const { message, isError, isLoading } = useConversationMessage({ conversation_id, messageId })\n\n if (inReplyScreen) return null\n if (isLoading) return <ShadowMessageFallback text=\"Loading...\" />\n if (isError || !message) return <ShadowMessageFallback text=\"Message deleted\" />\n\n const enrichedMessage = {\n ...message,\n isReplyShadowMessage,\n nextRendersAuthor,\n }\n\n return <ShadowMessageContent conversation_id={conversation_id} {...enrichedMessage} />\n}\n\ninterface ShadowMessageContentProps extends MessageResource {\n conversation_id: number\n}\n\nfunction ShadowMessageContent({ conversation_id, ...message }: ShadowMessageContentProps) {\n const { text, deletedAt, author, attachments } = message\n const styles = useStyles(message)\n const { colors } = useTheme()\n const navigation = useNavigation()\n const timestamp = useLiveRelativeTime(message.createdAt)\n\n const [messageBubbleHeight, setMessageBubbleHeight] = React.useState(0)\n const { animatedBackgroundColor, handleMessagePressIn, handleMessagePressOut } =\n useAnimatedMessageBackgroundColor()\n const scalableNumberOfLines = useScalableNumberOfLines(2)\n const replyCountText = pluralize(message.replyCount, 'reply')\n const isDeleted = !!deletedAt\n const messageText = isDeleted ? 'Message deleted' : text\n\n const handleNavigateToReplies = () => {\n navigation.navigate('ConversationReply', {\n conversation_id,\n reply_root_id: message.replyRootId,\n reply_root_author_name: message.author.name,\n })\n }\n\n const attachmentLabel = some(attachments) ? pluralize(attachments.length, 'attachment') : ''\n const accessibilityLabel = `${author?.name || ''} Reply Preview ${attachmentLabel} ${messageText || ''} ${timestamp} ${replyCountText}`\n\n return (\n <Pressable\n android_ripple={{ color: colors.androidRippleNeutral }}\n onPress={handleNavigateToReplies}\n onPressIn={handleMessagePressIn}\n onPressOut={handleMessagePressOut}\n accessibilityLabel={accessibilityLabel}\n accessibilityHint=\"Navigate to reply screen for this message\"\n accessibilityRole=\"link\"\n >\n <Animated.View style={[styles.message, animatedBackgroundColor]}>\n {!message.mine && (\n <View>\n <View style={[styles.avatarWrapper, !isDeleted && styles.avatarOpacity]}>\n <Avatar\n size=\"xs\"\n sourceUri={message.author.avatar}\n style={styles.avatar}\n maxFontSizeMultiplier={1}\n fallbackIconName={isDeleted ? 'publishing.trash' : 'general.person'}\n showFallback={isDeleted}\n />\n </View>\n <TheirReplyConnector message={message} messageBubbleHeight={messageBubbleHeight} />\n </View>\n )}\n <View style={styles.messageContent}>\n <View\n style={styles.messageBubble}\n onLayout={e => setMessageBubbleHeight(e.nativeEvent.layout.height)}\n >\n <MessageAttachmentImagery attachments={attachments} />\n {text && (\n <Text\n variant=\"footnote\"\n style={styles.messageText}\n numberOfLines={scalableNumberOfLines}\n >\n {messageText}\n </Text>\n )}\n </View>\n <View style={styles.messageMeta}>\n <Text variant=\"footnote\" style={styles.replyCountText}>\n {replyCountText}\n </Text>\n </View>\n </View>\n {message.mine && (\n <MyReplyConnector message={message} messageBubbleHeight={messageBubbleHeight} />\n )}\n </Animated.View>\n </Pressable>\n )\n}\n\nfunction MessageAttachmentImagery({\n attachments,\n}: {\n attachments: DenormalizedAttachmentResource[]\n}) {\n if (!attachments || attachments.length === 0) return null\n\n const attachment = attachments[0]\n\n if (attachment.type === 'giphy') {\n return <GiphyImage attachment={attachment} />\n }\n if (attachment.type === 'ExpandedLink') {\n return <ExpandedLinkImage attachment={attachment} />\n }\n if (attachment.type === 'MessageAttachment') {\n const contentType = attachment.attributes?.contentType\n const basicType = contentType?.split('/')[0]\n\n switch (basicType) {\n case 'image':\n return <MessageAttachmentImage attachment={attachment} />\n case 'video':\n return <MessageAttachmentIcon iconName=\"general.outlinedVideoFile\" />\n case 'audio':\n return <MessageAttachmentIcon iconName=\"general.outlinedMusicFile\" />\n case 'application':\n return <MessageAttachmentIcon iconName=\"general.outlinedGenericFile\" />\n default:\n return null\n }\n }\n\n return null\n}\n\nfunction GiphyImage({ attachment }: { attachment: DenormalizedGiphyAttachmentResource }) {\n const { title, giphy } = attachment\n const { url } = giphy.fixedWidth\n const { width, height } = assertKeysAreNumbers(giphy.fixedWidth)\n const styles = useStyles({ imageWidth: width, imageHeight: height })\n\n return (\n <Image\n source={{ uri: url }}\n wrapperStyle={styles.imageWrapper}\n style={styles.image}\n alt={title}\n loaderSize={16}\n />\n )\n}\n\nfunction ExpandedLinkImage({\n attachment,\n}: {\n attachment: DenormalizedExpandedLinkAttachmentResource\n}) {\n const { title = '', imageUrl, imageHeight, imageWidth } = attachment.attributes\n const styles = useStyles({ imageWidth, imageHeight })\n\n return (\n <Image\n source={{ uri: imageUrl }}\n wrapperStyle={styles.imageWrapper}\n style={styles.image}\n alt={title}\n loaderSize={16}\n />\n )\n}\n\nfunction MessageAttachmentImage({\n attachment,\n}: {\n attachment: DenormalizedMessageAttachmentResource\n}) {\n const { url, urlMedium, filename, metadata = {} } = attachment.attributes\n const styles = useStyles({ imageWidth: metadata.width, imageHeight: metadata.height })\n\n return (\n <Image\n source={{ uri: urlMedium || url }}\n style={styles.image}\n wrapperStyle={styles.imageWrapper}\n alt={filename}\n loaderSize={16}\n />\n )\n}\n\nfunction MessageAttachmentIcon({ iconName }: { iconName: IconProps['name'] }) {\n const styles = useStyles()\n return (\n <Icon\n name={iconName}\n style={styles.attachmentIcon}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n )\n}\n\n// TODO: The mine prop is not used yet, but in the future we will be adding a way to find the `mine` value for this fallback.\nfunction ShadowMessageFallback({ text, mine }: { text: string; mine?: boolean }) {\n const styles = useStyles({ mine })\n\n return (\n <View style={styles.message}>\n <View style={styles.messageContent}>\n <View style={styles.messageBubble}>\n <Text variant=\"footnote\" style={styles.messageText}>\n {text}\n </Text>\n </View>\n </View>\n </View>\n )\n}\n\ninterface StylesProps {\n imageWidth?: number\n imageHeight?: number\n mine?: boolean\n}\n\nconst useStyles = ({ mine, imageWidth = 32, imageHeight = 32 }: StylesProps = {}) => {\n const { colors } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER })\n const { width } = useWindowDimensions()\n const tabletWidth = width >= 744 // Smallest iPad Mini's width\n\n return StyleSheet.create({\n message: {\n gap: 8,\n flexDirection: mine ? 'row-reverse' : 'row',\n paddingHorizontal: CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n },\n messageContent: {\n flex: 1,\n gap: 4,\n marginBottom: 12,\n },\n avatarWrapper: {\n width: MESSAGE_AUTHOR_AVATAR_COLUMN_WIDTH,\n alignItems: 'center',\n },\n avatar: {\n marginBottom: 8,\n },\n avatarOpacity: {\n opacity: 0.5,\n },\n messageBubble: {\n flexDirection: 'row',\n alignSelf: mine ? 'flex-end' : 'flex-start',\n alignItems: 'center',\n gap: 8,\n borderColor: colors.borderColorDefaultBase,\n borderWidth: 1,\n borderRadius: 8,\n maxWidth: tabletWidth ? 360 : '80%',\n paddingVertical: 6,\n paddingHorizontal: 8,\n },\n messageText: {\n color: colors.textColorDefaultPlaceholder,\n flexShrink: 1,\n },\n messageMeta: {\n flexDirection: 'row',\n justifyContent: mine ? 'flex-end' : 'flex-start',\n },\n replyCountText: {\n color: colors.interaction,\n fontWeight: platformFontWeightMedium,\n },\n imageWrapper: {\n width: 32 * fontScale,\n aspectRatio: imageWidth / imageHeight,\n opacity: 0.5,\n },\n image: {\n borderRadius: 4,\n },\n attachmentIcon: {\n color: colors.iconColorDefaultDim,\n fontSize: 16,\n },\n })\n}\n"]}
@@ -25,7 +25,7 @@ export function AgeCheckRequiredScreen() {
25
25
  const { submitAgeCheck, isPending, isSuccess } = useSubmitAgeCheck();
26
26
  const styles = useStyles();
27
27
  const birthdateStamp = birthdate
28
- ? formatDate(birthdate, { style: 'standard', year: true })
28
+ ? formatDate(birthdate, { style: 'standard', year: true, timeZone: 'UTC' })
29
29
  : 'Missing';
30
30
  const age = birthdate ? calculateAge(birthdate) : null;
31
31
  const confirmationText = birthdate !== null
@@ -1 +1 @@
1
- {"version":3,"file":"age_check_required_screen.js","sourceRoot":"","sources":["../../../src/screens/age_check/age_check_required_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,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AAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;SACP;QACD,UAAU,EAAE;YACV,SAAS,EAAE,UAAU;SACtB;QACD,gBAAgB,EAAE;YAChB,IAAI,EAAE,CAAC;SACR;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React, { useState } from 'react'\nimport { date as formatDate } from '@planningcenter/datetime-fmt'\nimport { StyleSheet, View } from 'react-native'\nimport { Button } from '../../components/display/button'\nimport { Text } from '../../components/display/text'\nimport { Icon } from '../../components/display/icon'\nimport { Avatar } from '../../components/display/avatar'\nimport { Banner } from '../../components/display/banner'\nimport { useCurrentPerson, useTheme, useSubmitAgeCheck } from '../../hooks'\nimport { Heading } from '../../components'\nimport { platformFontWeightBold } from '../../utils/styles'\nimport { AgeCheckSelectBirthdateModal } from './components/age_check_select_birthdate_modal'\n\nfunction calculateAge(birthdate: Date) {\n const today = new Date()\n const age = today.getFullYear() - birthdate.getFullYear()\n const hasHadBirthdayThisYear =\n today.getMonth() > birthdate.getMonth() ||\n (today.getMonth() === birthdate.getMonth() && today.getDate() >= birthdate.getDate())\n return hasHadBirthdayThisYear ? age : age - 1\n}\n\nexport function AgeCheckRequiredScreen() {\n const person = useCurrentPerson()\n\n const [birthdate, setBirthdate] = useState<Date | null>(null)\n const [draftBirthdate, setDraftBirthdate] = useState<Date | null>(null)\n const [isBirthdateModalOpen, setBirthdateModalOpen] = useState(false)\n const { submitAgeCheck, isPending, isSuccess } = useSubmitAgeCheck()\n const styles = useStyles()\n\n const birthdateStamp = birthdate\n ? formatDate(birthdate, { style: 'standard', year: true })\n : 'Missing'\n\n const age = birthdate ? calculateAge(birthdate) : null\n\n const confirmationText =\n birthdate !== null\n ? `Your birthdate is ${birthdateStamp} and you are ${age} years old. Is that correct?`\n : ''\n\n const openBirthdateModal = () => {\n setDraftBirthdate(birthdate || new Date())\n setBirthdateModalOpen(true)\n }\n\n const closeBirthdateModal = () => {\n setBirthdateModalOpen(false)\n }\n\n const handleSubmitAgeConfirmation = () => {\n if (!birthdate) return\n submitAgeCheck(birthdate)\n }\n\n return (\n <View style={styles.container}>\n <View style={styles.header}>\n <View style={styles.heading}>\n <Icon name=\"general.exclamationTriangle\" size={20} style={styles.warningIcon} />\n <Heading variant=\"h2\">Your age is required to use chat</Heading>\n </View>\n <Text>To help protect those who may be underage, we need to verify your birthdate.</Text>\n </View>\n <View style={styles.cards}>\n <View style={styles.card}>\n <Heading variant=\"h3\">My profile</Heading>\n <View style={styles.profileContent}>\n <Avatar sourceUri={person.avatar || ''} size=\"lg\" showFallback={!person.avatar} />\n <View style={styles.personInfo}>\n <Text style={styles.name} numberOfLines={1}>\n {person.name}\n </Text>\n <View style={styles.birthdateInfo}>\n <Text variant=\"tertiary\" style={styles.birthdateLabel}>\n Birthdate:\n </Text>\n <Text variant=\"tertiary\">{birthdateStamp}</Text>\n </View>\n </View>\n {birthdate && (\n <Button\n title=\"Edit\"\n accessibilityHint=\"Choose a new birthdate for your profile\"\n size=\"sm\"\n variant=\"outline\"\n style={styles.editButton}\n onPress={openBirthdateModal}\n />\n )}\n </View>\n {!birthdate && (\n <Button\n title=\"Add birthdate\"\n accessibilityHint=\"Choose a birthdate for your profile\"\n size=\"lg\"\n style={styles.primaryButton}\n onPress={openBirthdateModal}\n />\n )}\n </View>\n {birthdate && (\n <View style={styles.card}>\n <Heading variant=\"h3\">Age confirmation</Heading>\n {age !== null && age < 13 ? (\n <Banner appearance=\"warning\" description={confirmationText} />\n ) : (\n <Text>{confirmationText}</Text>\n )}\n <Button\n title=\"Yes, update my profile\"\n size=\"lg\"\n style={styles.primaryButton}\n onPress={handleSubmitAgeConfirmation}\n disabled={isPending || isSuccess}\n />\n </View>\n )}\n </View>\n <Text variant=\"tertiary\">\n Your birthdate will be added to your profile, but it is only visible to church\n administrators. It will not be shared with other church members, unless you give permission.\n </Text>\n\n <AgeCheckSelectBirthdateModal\n onChange={setDraftBirthdate}\n onDismiss={closeBirthdateModal}\n onRequestClose={closeBirthdateModal}\n onSubmit={setBirthdate}\n value={draftBirthdate || new Date()}\n visible={isBirthdateModalOpen}\n />\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: colors.surfaceColor080,\n padding: 16,\n gap: 16,\n },\n header: {\n gap: 8,\n },\n heading: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 8,\n },\n warningIcon: {\n color: colors.statusErrorIcon,\n },\n card: {\n backgroundColor: colors.surfaceColor100,\n borderRadius: 8,\n padding: 16,\n gap: 8,\n },\n cards: {\n gap: 8,\n },\n profileContent: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 8,\n },\n personInfo: {\n flex: 1,\n },\n primaryButton: {\n alignSelf: 'center',\n marginTop: 8,\n },\n name: {\n fontWeight: platformFontWeightBold,\n },\n birthdateLabel: {\n fontWeight: platformFontWeightBold,\n },\n birthdateInfo: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n },\n editButton: {\n alignSelf: 'flex-end',\n },\n formSheetContent: {\n flex: 1,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"age_check_required_screen.js","sourceRoot":"","sources":["../../../src/screens/age_check/age_check_required_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxD,OAAO,E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QACD,UAAU,EAAE;YACV,SAAS,EAAE,UAAU;SACtB;QACD,gBAAgB,EAAE;YAChB,IAAI,EAAE,CAAC;SACR;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React, { useState } from 'react'\nimport { date as formatDate } from '@planningcenter/datetime-fmt'\nimport { StyleSheet, View } from 'react-native'\nimport { Button } from '../../components/display/button'\nimport { Text } from '../../components/display/text'\nimport { Icon } from '../../components/display/icon'\nimport { Avatar } from '../../components/display/avatar'\nimport { Banner } from '../../components/display/banner'\nimport { useCurrentPerson, useTheme, useSubmitAgeCheck } from '../../hooks'\nimport { Heading } from '../../components'\nimport { platformFontWeightBold } from '../../utils/styles'\nimport { AgeCheckSelectBirthdateModal } from './components/age_check_select_birthdate_modal'\n\nfunction calculateAge(birthdate: Date) {\n const today = new Date()\n const age = today.getFullYear() - birthdate.getFullYear()\n const hasHadBirthdayThisYear =\n today.getMonth() > birthdate.getMonth() ||\n (today.getMonth() === birthdate.getMonth() && today.getDate() >= birthdate.getDate())\n return hasHadBirthdayThisYear ? age : age - 1\n}\n\nexport function AgeCheckRequiredScreen() {\n const person = useCurrentPerson()\n\n const [birthdate, setBirthdate] = useState<Date | null>(null)\n const [draftBirthdate, setDraftBirthdate] = useState<Date | null>(null)\n const [isBirthdateModalOpen, setBirthdateModalOpen] = useState(false)\n const { submitAgeCheck, isPending, isSuccess } = useSubmitAgeCheck()\n const styles = useStyles()\n\n const birthdateStamp = birthdate\n ? formatDate(birthdate, { style: 'standard', year: true, timeZone: 'UTC' })\n : 'Missing'\n\n const age = birthdate ? calculateAge(birthdate) : null\n\n const confirmationText =\n birthdate !== null\n ? `Your birthdate is ${birthdateStamp} and you are ${age} years old. Is that correct?`\n : ''\n\n const openBirthdateModal = () => {\n setDraftBirthdate(birthdate || new Date())\n setBirthdateModalOpen(true)\n }\n\n const closeBirthdateModal = () => {\n setBirthdateModalOpen(false)\n }\n\n const handleSubmitAgeConfirmation = () => {\n if (!birthdate) return\n submitAgeCheck(birthdate)\n }\n\n return (\n <View style={styles.container}>\n <View style={styles.header}>\n <View style={styles.heading}>\n <Icon name=\"general.exclamationTriangle\" size={20} style={styles.warningIcon} />\n <Heading variant=\"h2\">Your age is required to use chat</Heading>\n </View>\n <Text>To help protect those who may be underage, we need to verify your birthdate.</Text>\n </View>\n <View style={styles.cards}>\n <View style={styles.card}>\n <Heading variant=\"h3\">My profile</Heading>\n <View style={styles.profileContent}>\n <Avatar sourceUri={person.avatar || ''} size=\"lg\" showFallback={!person.avatar} />\n <View style={styles.personInfo}>\n <Text style={styles.name} numberOfLines={1}>\n {person.name}\n </Text>\n <View style={styles.birthdateInfo}>\n <Text variant=\"tertiary\" style={styles.birthdateLabel}>\n Birthdate:\n </Text>\n <Text variant=\"tertiary\">{birthdateStamp}</Text>\n </View>\n </View>\n {birthdate && (\n <Button\n title=\"Edit\"\n accessibilityHint=\"Choose a new birthdate for your profile\"\n size=\"sm\"\n variant=\"outline\"\n style={styles.editButton}\n onPress={openBirthdateModal}\n />\n )}\n </View>\n {!birthdate && (\n <Button\n title=\"Add birthdate\"\n accessibilityHint=\"Choose a birthdate for your profile\"\n size=\"lg\"\n style={styles.primaryButton}\n onPress={openBirthdateModal}\n />\n )}\n </View>\n {birthdate && (\n <View style={styles.card}>\n <Heading variant=\"h3\">Age confirmation</Heading>\n {age !== null && age < 13 ? (\n <Banner appearance=\"warning\" description={confirmationText} />\n ) : (\n <Text>{confirmationText}</Text>\n )}\n <Button\n title=\"Yes, update my profile\"\n size=\"lg\"\n style={styles.primaryButton}\n onPress={handleSubmitAgeConfirmation}\n disabled={isPending || isSuccess}\n />\n </View>\n )}\n </View>\n <Text variant=\"tertiary\">\n Your birthdate will be added to your profile, but it is only visible to church\n administrators. It will not be shared with other church members, unless you give permission.\n </Text>\n\n <AgeCheckSelectBirthdateModal\n onChange={setDraftBirthdate}\n onDismiss={closeBirthdateModal}\n onRequestClose={closeBirthdateModal}\n onSubmit={setBirthdate}\n value={draftBirthdate || new Date()}\n visible={isBirthdateModalOpen}\n />\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: colors.surfaceColor080,\n padding: 16,\n gap: 16,\n },\n header: {\n gap: 8,\n },\n heading: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 8,\n },\n warningIcon: {\n color: colors.statusErrorIcon,\n },\n card: {\n backgroundColor: colors.surfaceColor100,\n borderRadius: 8,\n padding: 16,\n gap: 8,\n },\n cards: {\n gap: 8,\n },\n profileContent: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 8,\n },\n personInfo: {\n flex: 1,\n },\n primaryButton: {\n alignSelf: 'center',\n marginTop: 8,\n },\n name: {\n fontWeight: platformFontWeightBold,\n },\n birthdateLabel: {\n fontWeight: platformFontWeightBold,\n },\n birthdateInfo: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n },\n editButton: {\n alignSelf: 'flex-end',\n },\n formSheetContent: {\n flex: 1,\n },\n })\n}\n"]}
@@ -38,7 +38,7 @@ function IOSBirthdateModal({ onChange, onDismiss, onRequestClose, onSubmit, valu
38
38
  Birthdate
39
39
  </Text>
40
40
  <View style={styles.pickerContainer}>
41
- <DateTimePicker accessibilityLabelledBy="birthdateLabel" testID="age-check-date-picker" mode="date" display="spinner" value={selected} maximumDate={today} onChange={handleChange}/>
41
+ <DateTimePicker timeZoneName="UTC" accessibilityLabelledBy="birthdateLabel" testID="age-check-date-picker" mode="date" display="spinner" value={selected} maximumDate={today} onChange={handleChange}/>
42
42
  </View>
43
43
  </View>
44
44
  </View>
@@ -56,7 +56,7 @@ function AndroidBirthdatePicker({ onRequestClose, onSubmit, value, visible, }) {
56
56
  }
57
57
  onRequestClose();
58
58
  };
59
- return (<DateTimePicker testID="age-check-date-picker-android" mode="date" display="spinner" value={selected} maximumDate={today} onChange={handleAndroidDateChange}/>);
59
+ return (<DateTimePicker timeZoneName="UTC" testID="age-check-date-picker-android" mode="date" display="spinner" value={selected} maximumDate={today} onChange={handleAndroidDateChange}/>);
60
60
  }
61
61
  const useStyles = () => {
62
62
  const { colors } = useTheme();
@@ -1 +1 @@
1
- {"version":3,"file":"age_check_select_birthdate_modal.js","sourceRoot":"","sources":["../../../../src/screens/age_check/components/age_check_select_birthdate_modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,cAAuC,MAAM,wCAAwC,CAAA;AAC5F,OAAO,SAAS,MAAM,0CAA0C,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAWzC,MAAM,UAAU,4BAA4B,CAAC,KAAmC;IAC9E,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK;QAAE,OAAO,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAA;IAClE,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS;QAAE,OAAO,CAAC,sBAAsB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAA;IAE3E,OAAO,CAAC,IAAI,CAAC,sDAAsD,EAAE,IAAI,CAAC,CAAA;AAC5E,CAAC;AAED,SAAS,iBAAiB,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,cAAc,EACd,QAAQ,EACR,KAAK,EACL,OAAO,GACsB;IAC7B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC,CAAA;IACjD,MAAM,QAAQ,GAAG,KAAK,IAAI,KAAK,CAAA;IAE/B,MAAM,YAAY,GAAG,CAAC,MAA2B,EAAE,IAAW,EAAE,EAAE;QAChE,IAAI,IAAI;YA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C7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,eAAe,EAAE,MAAM,CAAC,eAAe;SACxC;QACD,gBAAgB,EAAE;YAChB,IAAI,EAAE,CAAC;SACR;QACD,OAAO,EAAE;YACP,IAAI,EAAE,CAAC;YACP,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,OAAO,EAAE,EAAE;YACX,cAAc,EAAE,YAAY;SAC7B;QACD,IAAI,EAAE;YACJ,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,YAAY,EAAE,CAAC;YACf,OAAO,EAAE,EAAE;SACZ;QACD,KAAK,EAAE;YACL,YAAY,EAAE,CAAC;YACf,aAAa,EAAE,WAAW;SAC3B;QACD,eAAe,EAAE;YACf,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,YAAY,EAAE,CAAC;SAChB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Modal, Platform, StyleSheet, View } from 'react-native'\nimport DateTimePicker, { DateTimePickerEvent } from '@react-native-community/datetimepicker'\nimport FormSheet from '../../../components/primitive/form_sheet'\nimport { Text } from '../../../components/display/text'\nimport { useTheme } from '../../../hooks'\n\nexport type AgeCheckSelectBirthdateProps = {\n onChange: (date: Date) => void\n onDismiss?: () => void\n onRequestClose: () => void\n onSubmit: (date: Date) => void\n value?: Date | null\n visible?: boolean\n}\n\nexport function AgeCheckSelectBirthdateModal(props: AgeCheckSelectBirthdateProps) {\n if (Platform.OS === 'ios') return <IOSBirthdateModal {...props} />\n if (Platform.OS === 'android') return <AndroidBirthdatePicker {...props} />\n\n return <Text>Birthdate selection is not supported on this platform.</Text>\n}\n\nfunction IOSBirthdateModal({\n onChange,\n onDismiss,\n onRequestClose,\n onSubmit,\n value,\n visible,\n}: AgeCheckSelectBirthdateProps) {\n const styles = useStyles()\n const today = React.useMemo(() => new Date(), [])\n const selected = value || today\n\n const handleChange = (_event: DateTimePickerEvent, date?: Date) => {\n if (date) onChange(date)\n }\n\n const handleSave = () => {\n onSubmit(selected)\n onRequestClose()\n }\n\n return (\n <Modal\n visible={visible}\n animationType=\"slide\"\n presentationStyle=\"pageSheet\"\n onRequestClose={onRequestClose}\n onDismiss={onDismiss}\n >\n <FormSheet.Root style={styles.formSheet} contentStyle={styles.formSheetContent}>\n <FormSheet.Header>\n <FormSheet.HeaderTitle>Your birthdate</FormSheet.HeaderTitle>\n <FormSheet.HeaderActions>\n <FormSheet.HeaderTextButton onPress={onRequestClose}>Cancel</FormSheet.HeaderTextButton>\n <FormSheet.HeaderButton title=\"Save\" onPress={handleSave} />\n </FormSheet.HeaderActions>\n </FormSheet.Header>\n <View style={styles.content}>\n <View style={styles.card}>\n <Text nativeID=\"birthdateLabel\" variant=\"tertiary\" style={styles.label}>\n Birthdate\n </Text>\n <View style={styles.pickerContainer}>\n <DateTimePicker\n accessibilityLabelledBy=\"birthdateLabel\"\n testID=\"age-check-date-picker\"\n mode=\"date\"\n display=\"spinner\"\n value={selected}\n maximumDate={today}\n onChange={handleChange}\n />\n </View>\n </View>\n </View>\n </FormSheet.Root>\n </Modal>\n )\n}\n\nfunction AndroidBirthdatePicker({\n onRequestClose,\n onSubmit,\n value,\n visible,\n}: AgeCheckSelectBirthdateProps) {\n if (!visible) return null\n\n const today = new Date()\n const selected = value || today\n\n const handleAndroidDateChange = (event: DateTimePickerEvent, selectedDate?: Date) => {\n if (event.type === 'set' && selectedDate) {\n onSubmit(selectedDate)\n }\n onRequestClose()\n }\n\n return (\n <DateTimePicker\n testID=\"age-check-date-picker-android\"\n mode=\"date\"\n display=\"spinner\"\n value={selected}\n maximumDate={today}\n onChange={handleAndroidDateChange}\n />\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n formSheet: {\n backgroundColor: colors.surfaceColor080,\n },\n formSheetContent: {\n flex: 1,\n },\n content: {\n flex: 1,\n backgroundColor: colors.surfaceColor080,\n padding: 16,\n justifyContent: 'flex-start',\n },\n card: {\n backgroundColor: colors.surfaceColor100,\n borderRadius: 8,\n padding: 16,\n },\n label: {\n marginBottom: 8,\n textTransform: 'uppercase',\n },\n pickerContainer: {\n backgroundColor: colors.surfaceColor100,\n borderRadius: 8,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"age_check_select_birthdate_modal.js","sourceRoot":"","sources":["../../../../src/screens/age_check/components/age_check_select_birthdate_modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,cAAuC,MAAM,wCAAwC,CAAA;AAC5F,OAAO,SAAS,MAAM,0CAA0C,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAWzC,MAAM,UAAU,4BAA4B,CAAC,KAAmC;IAC9E,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK;QAAE,OAAO,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAA;IAClE,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS;QAAE,OAAO,CAAC,sBAAsB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAA;IAE3E,OAAO,CAAC,IAAI,CAAC,sDAAsD,EAAE,IAAI,CAAC,CAAA;AAC5E,CAAC;AAED,SAAS,iBAAiB,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,cAAc,EACd,QAAQ,EACR,KAAK,EACL,OAAO,GACsB;IAC7B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC,CAAA;IACjD,MAAM,QAAQ,GAAG,KAAK,IAAI,KAAK,CAAA;IAE/B,MAAM,YAAY,GAAG,CAAC,MAA2B,E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AED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,eAAe,EAAE,MAAM,CAAC,eAAe;SACxC;QACD,gBAAgB,EAAE;YAChB,IAAI,EAAE,CAAC;SACR;QACD,OAAO,EAAE;YACP,IAAI,EAAE,CAAC;YACP,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,OAAO,EAAE,EAAE;YACX,cAAc,EAAE,YAAY;SAC7B;QACD,IAAI,EAAE;YACJ,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,YAAY,EAAE,CAAC;YACf,OAAO,EAAE,EAAE;SACZ;QACD,KAAK,EAAE;YACL,YAAY,EAAE,CAAC;YACf,aAAa,EAAE,WAAW;SAC3B;QACD,eAAe,EAAE;YACf,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,YAAY,EAAE,CAAC;SAChB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Modal, Platform, StyleSheet, View } from 'react-native'\nimport DateTimePicker, { DateTimePickerEvent } from '@react-native-community/datetimepicker'\nimport FormSheet from '../../../components/primitive/form_sheet'\nimport { Text } from '../../../components/display/text'\nimport { useTheme } from '../../../hooks'\n\nexport type AgeCheckSelectBirthdateProps = {\n onChange: (date: Date) => void\n onDismiss?: () => void\n onRequestClose: () => void\n onSubmit: (date: Date) => void\n value?: Date | null\n visible?: boolean\n}\n\nexport function AgeCheckSelectBirthdateModal(props: AgeCheckSelectBirthdateProps) {\n if (Platform.OS === 'ios') return <IOSBirthdateModal {...props} />\n if (Platform.OS === 'android') return <AndroidBirthdatePicker {...props} />\n\n return <Text>Birthdate selection is not supported on this platform.</Text>\n}\n\nfunction IOSBirthdateModal({\n onChange,\n onDismiss,\n onRequestClose,\n onSubmit,\n value,\n visible,\n}: AgeCheckSelectBirthdateProps) {\n const styles = useStyles()\n const today = React.useMemo(() => new Date(), [])\n const selected = value || today\n\n const handleChange = (_event: DateTimePickerEvent, date?: Date) => {\n if (date) onChange(date)\n }\n\n const handleSave = () => {\n onSubmit(selected)\n onRequestClose()\n }\n\n return (\n <Modal\n visible={visible}\n animationType=\"slide\"\n presentationStyle=\"pageSheet\"\n onRequestClose={onRequestClose}\n onDismiss={onDismiss}\n >\n <FormSheet.Root style={styles.formSheet} contentStyle={styles.formSheetContent}>\n <FormSheet.Header>\n <FormSheet.HeaderTitle>Your birthdate</FormSheet.HeaderTitle>\n <FormSheet.HeaderActions>\n <FormSheet.HeaderTextButton onPress={onRequestClose}>Cancel</FormSheet.HeaderTextButton>\n <FormSheet.HeaderButton title=\"Save\" onPress={handleSave} />\n </FormSheet.HeaderActions>\n </FormSheet.Header>\n <View style={styles.content}>\n <View style={styles.card}>\n <Text nativeID=\"birthdateLabel\" variant=\"tertiary\" style={styles.label}>\n Birthdate\n </Text>\n <View style={styles.pickerContainer}>\n <DateTimePicker\n timeZoneName=\"UTC\"\n accessibilityLabelledBy=\"birthdateLabel\"\n testID=\"age-check-date-picker\"\n mode=\"date\"\n display=\"spinner\"\n value={selected}\n maximumDate={today}\n onChange={handleChange}\n />\n </View>\n </View>\n </View>\n </FormSheet.Root>\n </Modal>\n )\n}\n\nfunction AndroidBirthdatePicker({\n onRequestClose,\n onSubmit,\n value,\n visible,\n}: AgeCheckSelectBirthdateProps) {\n if (!visible) return null\n\n const today = new Date()\n const selected = value || today\n\n const handleAndroidDateChange = (event: DateTimePickerEvent, selectedDate?: Date) => {\n if (event.type === 'set' && selectedDate) {\n onSubmit(selectedDate)\n }\n onRequestClose()\n }\n\n return (\n <DateTimePicker\n timeZoneName=\"UTC\"\n testID=\"age-check-date-picker-android\"\n mode=\"date\"\n display=\"spinner\"\n value={selected}\n maximumDate={today}\n onChange={handleAndroidDateChange}\n />\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n formSheet: {\n backgroundColor: colors.surfaceColor080,\n },\n formSheetContent: {\n flex: 1,\n },\n content: {\n flex: 1,\n backgroundColor: colors.surfaceColor080,\n padding: 16,\n justifyContent: 'flex-start',\n },\n card: {\n backgroundColor: colors.surfaceColor100,\n borderRadius: 8,\n padding: 16,\n },\n label: {\n marginBottom: 8,\n textTransform: 'uppercase',\n },\n pickerContainer: {\n backgroundColor: colors.surfaceColor100,\n borderRadius: 8,\n },\n })\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/chat-react-native",
3
- "version": "3.18.0-rc.10",
3
+ "version": "3.18.0-rc.12",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -58,5 +58,5 @@
58
58
  "react-native-url-polyfill": "^2.0.0",
59
59
  "typescript": "<5.6.0"
60
60
  },
61
- "gitHead": "20b1107e3efd3b9e108ccaada901e34ab49546fa"
61
+ "gitHead": "4a378046ad880d9952ef80d504857e989f155d0f"
62
62
  }
@@ -1,6 +1,12 @@
1
1
  import { useNavigation } from '@react-navigation/native'
2
2
  import React, { useEffect } from 'react'
3
- import { Pressable, StyleSheet, useWindowDimensions, View } from 'react-native'
3
+ import {
4
+ AccessibilityActionEvent,
5
+ Pressable,
6
+ StyleSheet,
7
+ useWindowDimensions,
8
+ View,
9
+ } from 'react-native'
4
10
  import { MessageReaction } from '../../components/conversation/message_reaction'
5
11
  import { Avatar, Icon, Spinner, Text, TextButton, TextInlineButton } from '../../components/display'
6
12
  import {
@@ -27,6 +33,7 @@ import { Haptic } from '../../utils/native_adapters'
27
33
  import { TheirReplyConnector, MyReplyConnector, AVATAR_CONNECTOR_SPACING } from './reply_connectors'
28
34
  import { pluralize } from '../../utils'
29
35
  import { useConversationMessage } from '../../hooks/use_conversation_message'
36
+ import { some } from 'lodash'
30
37
  import { isNewMessage } from '../../utils/cache/messages_cache'
31
38
 
32
39
  /** Message
@@ -48,7 +55,7 @@ export function Message({
48
55
  repliesEnabled,
49
56
  ...message
50
57
  }: MessageProps) {
51
- const { text, reactionCounts, pending, error } = message
58
+ const { text, reactionCounts, pending, error, attachments, author } = message
52
59
  const styles = useMessageStyles(message)
53
60
  const navigation = useNavigation()
54
61
  const { colors } = useTheme()
@@ -70,7 +77,7 @@ export function Message({
70
77
  })
71
78
 
72
79
  const metaProps = {
73
- authorName: message.author.name,
80
+ authorName: author.name,
74
81
  createdAt: message.createdAt,
75
82
  }
76
83
 
@@ -79,12 +86,12 @@ export function Message({
79
86
  !inReplyScreen && message.replyRootId === message.id && repliesEnabled
80
87
  const isReplyRootMessage = message.replyRootId === message.id
81
88
  const isDeletedReplyRootMessage = isReplyRootMessage && !!message.deletedAt
89
+ const replyToReplyRootMessage = repliesEnabled && !isReplyRootMessage && !!message.replyRootId
82
90
 
83
91
  const replyCountText = pluralize(message.replyCount, 'reply')
84
92
  const messagePendingLabel = isPersisted ? 'Saving' : 'Sending'
85
- const replyRootAuthorName = message.replyRootId
86
- ? replyRootMessage?.author.name
87
- : message.author.name
93
+ const replyRootAuthorName = message.replyRootId ? replyRootMessage?.author.name : author.name
94
+ const messageText = isDeletedReplyRootMessage ? 'Message deleted' : text
88
95
 
89
96
  const messageBottomMargin =
90
97
  message.lastInGroup || message.nextIsReplyShadowMessage
@@ -93,6 +100,11 @@ export function Message({
93
100
  ? 8
94
101
  : 4
95
102
 
103
+ const messageIsReplyLabel = replyToReplyRootMessage ? 'Reply' : ''
104
+ const attachmentLabel = some(attachments) ? pluralize(attachments.length, 'attachment') : ''
105
+ const replyCountLabel = isReplyRootMessage ? replyCountText : ''
106
+ const accessibilityLabel = `${author?.name || ''} ${messageIsReplyLabel} ${attachmentLabel} ${messageText || ''} ${timestamp} ${replyCountLabel}`
107
+
96
108
  useEffect(() => {
97
109
  if (pending) {
98
110
  const timer = setTimeout(() => {
@@ -159,10 +171,23 @@ export function Message({
159
171
  navigation.navigate('ConversationReply', {
160
172
  conversation_id,
161
173
  reply_root_id: message.id,
162
- reply_root_author_name: message.author.name,
174
+ reply_root_author_name: author.name,
163
175
  })
164
176
  }
165
177
 
178
+ const accessibilityActions = [
179
+ {
180
+ name: 'navigateToReplies',
181
+ label: 'Navigate to replies',
182
+ },
183
+ ]
184
+
185
+ const handleAccessibilityAction = (event: AccessibilityActionEvent) => {
186
+ if (event.nativeEvent.actionName === 'navigateToReplies') {
187
+ handleNavigateToReplyPress()
188
+ }
189
+ }
190
+
166
191
  return (
167
192
  <Pressable
168
193
  onLongPress={handleMessageLongPress}
@@ -170,7 +195,11 @@ export function Message({
170
195
  onPressIn={handleMessagePressIn}
171
196
  onPressOut={handleMessagePressOut}
172
197
  android_ripple={{ color: colors.androidRippleNeutral, borderless: false, foreground: true }}
198
+ accessibilityRole="button"
199
+ accessibilityLabel={accessibilityLabel}
173
200
  accessibilityHint="Long press to view message actions like reacting and copying."
201
+ accessibilityActions={isReplyRootMessage ? accessibilityActions : undefined}
202
+ onAccessibilityAction={isReplyRootMessage ? handleAccessibilityAction : undefined}
174
203
  disabled={isDeletedReplyRootMessage}
175
204
  >
176
205
  <Animated.View style={[styles.message, animatedBackgroundColor]}>
@@ -179,7 +208,7 @@ export function Message({
179
208
  {renderAuthor ? (
180
209
  <Avatar
181
210
  size={'md'}
182
- sourceUri={message.author.avatar}
211
+ sourceUri={author.avatar}
183
212
  style={styles.avatar}
184
213
  maxFontSizeMultiplier={1}
185
214
  minFontSizeMultiplier={1}
@@ -197,7 +226,7 @@ export function Message({
197
226
  <View style={[styles.messageContent, { marginBottom: messageBottomMargin }]}>
198
227
  {renderAuthor && !isDeletedReplyRootMessage && (
199
228
  <Text variant="footnote" style={styles.authorName}>
200
- {message.author.name}
229
+ {author.name}
201
230
  </Text>
202
231
  )}
203
232
  <View
@@ -206,13 +235,13 @@ export function Message({
206
235
  >
207
236
  {isDeletedReplyRootMessage ? (
208
237
  <View style={styles.messageText}>
209
- <Text style={styles.replyRootDeletedText}>Message deleted</Text>
238
+ <Text style={styles.replyRootDeletedText}>{messageText}</Text>
210
239
  </View>
211
240
  ) : (
212
241
  <>
213
242
  <ErrorBoundary>
214
243
  <MessageAttachments
215
- attachments={message.attachments}
244
+ attachments={attachments}
216
245
  metaProps={metaProps}
217
246
  onMessageAttachmentLongPress={handleMessageAttachmentLongPress}
218
247
  onMessageLongPress={handleMessageLongPress}
@@ -25,6 +25,8 @@ import { TheirReplyConnector, MyReplyConnector } from './reply_connectors'
25
25
  import { assertKeysAreNumbers, pluralize } from '../../utils'
26
26
  import { useNavigation } from '@react-navigation/native'
27
27
  import { useConversationMessage } from '../../hooks/use_conversation_message'
28
+ import { useLiveRelativeTime } from '../../hooks/use_live_relative_time'
29
+ import { some } from 'lodash'
28
30
 
29
31
  interface ReplyShadowMessageProps extends MessageResource {
30
32
  messageId: string
@@ -61,10 +63,11 @@ interface ShadowMessageContentProps extends MessageResource {
61
63
  }
62
64
 
63
65
  function ShadowMessageContent({ conversation_id, ...message }: ShadowMessageContentProps) {
64
- const { text, deletedAt } = message
66
+ const { text, deletedAt, author, attachments } = message
65
67
  const styles = useStyles(message)
66
68
  const { colors } = useTheme()
67
69
  const navigation = useNavigation()
70
+ const timestamp = useLiveRelativeTime(message.createdAt)
68
71
 
69
72
  const [messageBubbleHeight, setMessageBubbleHeight] = React.useState(0)
70
73
  const { animatedBackgroundColor, handleMessagePressIn, handleMessagePressOut } =
@@ -82,12 +85,16 @@ function ShadowMessageContent({ conversation_id, ...message }: ShadowMessageCont
82
85
  })
83
86
  }
84
87
 
88
+ const attachmentLabel = some(attachments) ? pluralize(attachments.length, 'attachment') : ''
89
+ const accessibilityLabel = `${author?.name || ''} Reply Preview ${attachmentLabel} ${messageText || ''} ${timestamp} ${replyCountText}`
90
+
85
91
  return (
86
92
  <Pressable
87
93
  android_ripple={{ color: colors.androidRippleNeutral }}
88
94
  onPress={handleNavigateToReplies}
89
95
  onPressIn={handleMessagePressIn}
90
96
  onPressOut={handleMessagePressOut}
97
+ accessibilityLabel={accessibilityLabel}
91
98
  accessibilityHint="Navigate to reply screen for this message"
92
99
  accessibilityRole="link"
93
100
  >
@@ -112,7 +119,7 @@ function ShadowMessageContent({ conversation_id, ...message }: ShadowMessageCont
112
119
  style={styles.messageBubble}
113
120
  onLayout={e => setMessageBubbleHeight(e.nativeEvent.layout.height)}
114
121
  >
115
- <MessageAttachmentImagery attachments={message.attachments} />
122
+ <MessageAttachmentImagery attachments={attachments} />
116
123
  {text && (
117
124
  <Text
118
125
  variant="footnote"
@@ -30,7 +30,7 @@ export function AgeCheckRequiredScreen() {
30
30
  const styles = useStyles()
31
31
 
32
32
  const birthdateStamp = birthdate
33
- ? formatDate(birthdate, { style: 'standard', year: true })
33
+ ? formatDate(birthdate, { style: 'standard', year: true, timeZone: 'UTC' })
34
34
  : 'Missing'
35
35
 
36
36
  const age = birthdate ? calculateAge(birthdate) : null
@@ -65,6 +65,7 @@ function IOSBirthdateModal({
65
65
  </Text>
66
66
  <View style={styles.pickerContainer}>
67
67
  <DateTimePicker
68
+ timeZoneName="UTC"
68
69
  accessibilityLabelledBy="birthdateLabel"
69
70
  testID="age-check-date-picker"
70
71
  mode="date"
@@ -101,6 +102,7 @@ function AndroidBirthdatePicker({
101
102
 
102
103
  return (
103
104
  <DateTimePicker
105
+ timeZoneName="UTC"
104
106
  testID="age-check-date-picker-android"
105
107
  mode="date"
106
108
  display="spinner"