@openpeepshq/rn-components 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/components/conversations/ConversationPreviewCard.tsx +37 -20
- package/src/components/conversations/MessageInThread.test.tsx +169 -0
- package/src/components/conversations/MessageInThread.tsx +51 -47
- package/src/components/custom/navigation/side-menu.tsx +20 -2
- package/src/pages/auth/Success.tsx +7 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpeepshq/rn-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "React Native community screens and shared UI (extracted from the Black Ambition app) for the OpenPeeps stack.",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -142,8 +142,8 @@
|
|
|
142
142
|
"timezones-list": "^3.1.0",
|
|
143
143
|
"validator": "^13.15.23",
|
|
144
144
|
"zustand": "^5.0.3",
|
|
145
|
-
"@openpeepshq/
|
|
146
|
-
"@openpeepshq/
|
|
145
|
+
"@openpeepshq/common": "^0.6.0",
|
|
146
|
+
"@openpeepshq/react": "^0.10.0"
|
|
147
147
|
},
|
|
148
148
|
"devDependencies": {
|
|
149
149
|
"@babel/core": "^7.26.7",
|
|
@@ -4,6 +4,8 @@ import { UpdatingDate } from '../custom/date/updating-date';
|
|
|
4
4
|
import { OpenpeepsMarkdown } from '../markdown/OpenpeepsMarkdown';
|
|
5
5
|
import {
|
|
6
6
|
formatBadgeCount,
|
|
7
|
+
isConversationLeavePost,
|
|
8
|
+
profileName,
|
|
7
9
|
truncateText,
|
|
8
10
|
type PublicPost,
|
|
9
11
|
} from '@openpeepshq/common';
|
|
@@ -45,6 +47,9 @@ export const ConversationPreviewCard = ({
|
|
|
45
47
|
|
|
46
48
|
const lastMessage = conversation?.slice(-1)[0];
|
|
47
49
|
const participants = lastMessage?.audience || [];
|
|
50
|
+
// A leave post (isConversationLeavePost) leaves its author out of the
|
|
51
|
+
// audience; show an "X left" preview instead of an empty message.
|
|
52
|
+
const isLeave = lastMessage ? isConversationLeavePost(lastMessage) : false;
|
|
48
53
|
|
|
49
54
|
const otherParticipants = participants.filter(
|
|
50
55
|
(p) => p.id !== currentProfile?.id
|
|
@@ -102,27 +107,39 @@ export const ConversationPreviewCard = ({
|
|
|
102
107
|
/>
|
|
103
108
|
|
|
104
109
|
<View className="mt-2 flex flex-row items-start gap-x-2">
|
|
105
|
-
|
|
106
|
-
<Text
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
@{truncateText(lastMessage.profile.handle, 8)}
|
|
112
|
-
</Text>
|
|
113
|
-
)}
|
|
114
|
-
<Text className="mx-1">:</Text>
|
|
115
|
-
</View>
|
|
116
|
-
{lastMessage.data?.type === 'event' ? (
|
|
117
|
-
<View className="flex flex-row items-center gap-1">
|
|
118
|
-
<CalendarIcon size={16} className="text-muted-foreground" />
|
|
119
|
-
<Text>{(lastMessage.data as { name?: string }).name}</Text>
|
|
120
|
-
</View>
|
|
110
|
+
{isLeave ? (
|
|
111
|
+
<Text className="text-muted-foreground">
|
|
112
|
+
{t('conversations.messageInThread.left', {
|
|
113
|
+
name: profileName(lastMessage.profile),
|
|
114
|
+
})}
|
|
115
|
+
</Text>
|
|
121
116
|
) : (
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
117
|
+
<>
|
|
118
|
+
<View className="flex flex-row items-center">
|
|
119
|
+
<Text>~</Text>
|
|
120
|
+
{currentProfile?.id === lastMessage.profile.id ? (
|
|
121
|
+
<Text className="ml-1">
|
|
122
|
+
{t('common.you', { defaultValue: 'You' })}
|
|
123
|
+
</Text>
|
|
124
|
+
) : (
|
|
125
|
+
<Text className="ml-1">
|
|
126
|
+
@{truncateText(lastMessage.profile.handle, 8)}
|
|
127
|
+
</Text>
|
|
128
|
+
)}
|
|
129
|
+
<Text className="mx-1">:</Text>
|
|
130
|
+
</View>
|
|
131
|
+
{lastMessage.data?.type === 'event' ? (
|
|
132
|
+
<View className="flex flex-row items-center gap-1">
|
|
133
|
+
<CalendarIcon size={16} className="text-muted-foreground" />
|
|
134
|
+
<Text>{(lastMessage.data as { name?: string }).name}</Text>
|
|
135
|
+
</View>
|
|
136
|
+
) : (
|
|
137
|
+
<OpenpeepsMarkdown
|
|
138
|
+
source={lastMessage.data?.content || ''}
|
|
139
|
+
linkPreviewMode="none"
|
|
140
|
+
/>
|
|
141
|
+
)}
|
|
142
|
+
</>
|
|
126
143
|
)}
|
|
127
144
|
</View>
|
|
128
145
|
</View>
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Leave rendering for MessageInThread: a leave (a reply that leaves its
|
|
3
|
+
* author out of the audience) renders only the "left" label, with the
|
|
4
|
+
* post-view ref wired to the label so the post still counts as seen.
|
|
5
|
+
*
|
|
6
|
+
* The View mock records the ref it is handed instead of asserting on
|
|
7
|
+
* ref.current: in this node jest environment (react 19.2.6 +
|
|
8
|
+
* react-test-renderer 19.2.3) host-element refs are never attached, even
|
|
9
|
+
* for plain host elements, while class refs work — an environment
|
|
10
|
+
* quirk, so the ref wiring is asserted directly.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const React = require('react');
|
|
14
|
+
const ReactTestRenderer = require('react-test-renderer');
|
|
15
|
+
|
|
16
|
+
const mockViewRefs: unknown[] = [];
|
|
17
|
+
|
|
18
|
+
jest.mock('react-native', () => ({
|
|
19
|
+
View: React.forwardRef((props: { children?: unknown }, ref: unknown) => {
|
|
20
|
+
if (ref) mockViewRefs.push(ref);
|
|
21
|
+
return React.createElement('View', null, props.children);
|
|
22
|
+
}),
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
jest.mock('react-i18next', () => {
|
|
26
|
+
const translations: Record<string, string> = {
|
|
27
|
+
'conversations.messageInThread.startedBy': 'Started by {{name}}',
|
|
28
|
+
'conversations.messageInThread.addedBy': 'Added by {{name}}',
|
|
29
|
+
'conversations.messageInThread.left': '{{name}} left',
|
|
30
|
+
'conversations.messageInThread.removedBy': 'Removed by {{name}}',
|
|
31
|
+
};
|
|
32
|
+
return {
|
|
33
|
+
useTranslation: () => ({
|
|
34
|
+
t: (key: string, opts?: Record<string, string>) =>
|
|
35
|
+
(translations[key] ?? key).replace(
|
|
36
|
+
/\{\{(\w+)\}\}/g,
|
|
37
|
+
(_match: string, name: string) => opts?.[name] ?? ''
|
|
38
|
+
),
|
|
39
|
+
}),
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
jest.mock('@openpeepshq/common', () => {
|
|
44
|
+
// Mirrored from platform/common/src/lib/postHelpers.ts — the built
|
|
45
|
+
// package ships ESM which Jest's node transform doesn't cover.
|
|
46
|
+
const isConversationLeavePost = (post: {
|
|
47
|
+
inReplyToId?: string | null;
|
|
48
|
+
audience?: { id: string }[] | null;
|
|
49
|
+
profile: { id: string };
|
|
50
|
+
}): boolean => {
|
|
51
|
+
const authorId = post.profile?.id;
|
|
52
|
+
if (!post.inReplyToId || !authorId) return false;
|
|
53
|
+
return !post.audience?.some((p) => p.id === authorId);
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
profileName: (profile?: { displayName?: string; handle?: string }) =>
|
|
57
|
+
profile?.displayName || profile?.handle,
|
|
58
|
+
isConversationLeavePost,
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
jest.mock('@openpeepshq/react', () => ({
|
|
63
|
+
useCurrentProfile: () => undefined,
|
|
64
|
+
isUnreadPostForViewer: () => false,
|
|
65
|
+
}));
|
|
66
|
+
|
|
67
|
+
const mockPostViewRef = { current: null as unknown };
|
|
68
|
+
|
|
69
|
+
jest.mock('../../hooks/use-post-view-ref', () => ({
|
|
70
|
+
usePostViewRef: () => mockPostViewRef,
|
|
71
|
+
}));
|
|
72
|
+
|
|
73
|
+
jest.mock('./ConversationMessageBubble', () => ({
|
|
74
|
+
ConversationMessageBubble: () =>
|
|
75
|
+
React.createElement('Text', { testID: 'message-bubble' }, 'message bubble'),
|
|
76
|
+
}));
|
|
77
|
+
|
|
78
|
+
jest.mock('../profile/Avatar', () => ({
|
|
79
|
+
ProfileAvatar: () => null,
|
|
80
|
+
}));
|
|
81
|
+
|
|
82
|
+
jest.mock('../custom/date/updating-date', () => ({
|
|
83
|
+
UpdatingDate: () => null,
|
|
84
|
+
}));
|
|
85
|
+
|
|
86
|
+
jest.mock('../ui/themed-text', () => ({
|
|
87
|
+
ThemedText: ({ children }: { children?: unknown }) =>
|
|
88
|
+
React.createElement('Text', null, children),
|
|
89
|
+
}));
|
|
90
|
+
|
|
91
|
+
import type { PublicPost } from '@openpeepshq/common/types';
|
|
92
|
+
import { MessageInThread } from './MessageInThread';
|
|
93
|
+
|
|
94
|
+
const bob = { id: 'bob', displayName: 'Bob', handle: 'bob' };
|
|
95
|
+
const alice = { id: 'alice', displayName: 'Alice', handle: 'alice' };
|
|
96
|
+
|
|
97
|
+
const makePost = (over: Partial<PublicPost> = {}): PublicPost =>
|
|
98
|
+
({
|
|
99
|
+
id: 'post-1',
|
|
100
|
+
profile: bob,
|
|
101
|
+
audience: [alice, bob],
|
|
102
|
+
createdAt: '2026-01-01T00:00:00.000Z',
|
|
103
|
+
data: { type: 'note', content: 'hello' },
|
|
104
|
+
...over,
|
|
105
|
+
}) as never;
|
|
106
|
+
|
|
107
|
+
const render = (element: React.ReactElement) => {
|
|
108
|
+
mockViewRefs.length = 0;
|
|
109
|
+
let tree!: ReactTestRenderer.ReactTestRenderer;
|
|
110
|
+
ReactTestRenderer.act(() => {
|
|
111
|
+
tree = ReactTestRenderer.create(element);
|
|
112
|
+
});
|
|
113
|
+
return tree;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
test('renders only the left label for a leave post and wires the view ref to it', () => {
|
|
117
|
+
const tree = render(
|
|
118
|
+
<MessageInThread
|
|
119
|
+
previous={makePost({ id: 'prev-1' })}
|
|
120
|
+
message={makePost({ inReplyToId: 'prev-1', audience: [alice] })}
|
|
121
|
+
/>
|
|
122
|
+
);
|
|
123
|
+
const json = JSON.stringify(tree.toJSON());
|
|
124
|
+
expect(json).toContain('Bob left');
|
|
125
|
+
expect(json).not.toContain('message bubble');
|
|
126
|
+
// The leave label is the only rendered View that carries the post-view
|
|
127
|
+
// ref, so the ref must have been wired to it.
|
|
128
|
+
expect(mockViewRefs).toEqual([mockPostViewRef]);
|
|
129
|
+
tree.unmount();
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
test('renders a leave post as left even when it is the first loaded post', () => {
|
|
133
|
+
const tree = render(
|
|
134
|
+
<MessageInThread
|
|
135
|
+
previous={undefined}
|
|
136
|
+
message={makePost({ inReplyToId: 'prev-1', audience: [alice] })}
|
|
137
|
+
/>
|
|
138
|
+
);
|
|
139
|
+
const json = JSON.stringify(tree.toJSON());
|
|
140
|
+
expect(json).toContain('Bob left');
|
|
141
|
+
expect(json).not.toContain('Added by');
|
|
142
|
+
tree.unmount();
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test('renders a root post outside its own audience as a message, not a leave', () => {
|
|
146
|
+
const tree = render(
|
|
147
|
+
<MessageInThread
|
|
148
|
+
previous={undefined}
|
|
149
|
+
message={makePost({ audience: [alice] })}
|
|
150
|
+
/>
|
|
151
|
+
);
|
|
152
|
+
const json = JSON.stringify(tree.toJSON());
|
|
153
|
+
expect(json).toContain('message bubble');
|
|
154
|
+
expect(json).not.toContain('left');
|
|
155
|
+
tree.unmount();
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
test('renders a reply the author takes part in as a message', () => {
|
|
159
|
+
const tree = render(
|
|
160
|
+
<MessageInThread
|
|
161
|
+
previous={makePost({ id: 'prev-1' })}
|
|
162
|
+
message={makePost({ inReplyToId: 'prev-1' })}
|
|
163
|
+
/>
|
|
164
|
+
);
|
|
165
|
+
const json = JSON.stringify(tree.toJSON());
|
|
166
|
+
expect(json).toContain('message bubble');
|
|
167
|
+
expect(json).not.toContain('Bob left');
|
|
168
|
+
tree.unmount();
|
|
169
|
+
});
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import type { PublicPost, PublicProfile } from '@openpeepshq/common/types';
|
|
5
|
-
import { profileName } from '@openpeepshq/common';
|
|
5
|
+
import { isConversationLeavePost, profileName } from '@openpeepshq/common';
|
|
6
6
|
import { isUnreadPostForViewer, useCurrentProfile } from '@openpeepshq/react';
|
|
7
7
|
import { UpdatingDate } from '../custom/date/updating-date';
|
|
8
8
|
import { ProfileAvatar } from '../profile/Avatar';
|
|
@@ -10,9 +10,6 @@ import { ThemedText } from '../ui/themed-text';
|
|
|
10
10
|
import { usePostViewRef } from '../../hooks/use-post-view-ref';
|
|
11
11
|
import { ConversationMessageBubble } from './ConversationMessageBubble';
|
|
12
12
|
|
|
13
|
-
const inAudience = (post: PublicPost, profile: PublicProfile) =>
|
|
14
|
-
!!post.audience?.some((p) => p.id === profile.id);
|
|
15
|
-
|
|
16
13
|
const audienceDiff = (
|
|
17
14
|
previous: PublicPost | undefined,
|
|
18
15
|
message: PublicPost
|
|
@@ -59,12 +56,17 @@ export const MessageInThread = ({
|
|
|
59
56
|
// The author leaving their own conversation is shown via the "left" label
|
|
60
57
|
// below, so exclude them from the "removedBy" avatars to avoid redundancy.
|
|
61
58
|
const removedOthers = removed.filter((p) => p.id !== message.profile.id);
|
|
59
|
+
// A leave post (isConversationLeavePost) renders only the "left" label
|
|
60
|
+
// (no message bubble); the view-ref moves to that label so the post is
|
|
61
|
+
// still marked seen. It holds even when the leave is the first loaded
|
|
62
|
+
// post, so no comparison against the previous post is needed.
|
|
63
|
+
const isLeave = isConversationLeavePost(message);
|
|
62
64
|
const name = profileName(message.profile);
|
|
63
65
|
const isMe = message.profile.id === me?.id;
|
|
64
66
|
|
|
65
67
|
return (
|
|
66
68
|
<View className={highlighted ? 'bg-muted rounded-md' : undefined}>
|
|
67
|
-
{!previous ? (
|
|
69
|
+
{!previous && !isLeave ? (
|
|
68
70
|
<ThemedText className="mt-2 w-full text-center text-sm">
|
|
69
71
|
{message.inReplyToId
|
|
70
72
|
? t('conversations.messageInThread.addedBy', { name })
|
|
@@ -72,10 +74,8 @@ export const MessageInThread = ({
|
|
|
72
74
|
</ThemedText>
|
|
73
75
|
) : null}
|
|
74
76
|
|
|
75
|
-
{
|
|
76
|
-
|
|
77
|
-
!inAudience(message, message.profile) ? (
|
|
78
|
-
<View className="flex-row items-center gap-2">
|
|
77
|
+
{isLeave ? (
|
|
78
|
+
<View ref={postViewRef} className="flex-row items-center gap-2">
|
|
79
79
|
<ProfileAvatar
|
|
80
80
|
profile={message.profile}
|
|
81
81
|
className="size-10 border-0"
|
|
@@ -86,48 +86,52 @@ export const MessageInThread = ({
|
|
|
86
86
|
</View>
|
|
87
87
|
) : null}
|
|
88
88
|
|
|
89
|
-
{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
89
|
+
{!isLeave ? (
|
|
90
|
+
<>
|
|
91
|
+
{previous && added.length > 0 ? (
|
|
92
|
+
<View className="flex-row items-center gap-2">
|
|
93
|
+
<AvatarRow profiles={added} />
|
|
94
|
+
<ThemedText>
|
|
95
|
+
{t('conversations.messageInThread.addedBy', { name })}
|
|
96
|
+
</ThemedText>
|
|
97
|
+
</View>
|
|
98
|
+
) : null}
|
|
97
99
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
{removedOthers.length > 0 ? (
|
|
101
|
+
<View className="flex-row items-center gap-2">
|
|
102
|
+
<AvatarRow profiles={removedOthers} />
|
|
103
|
+
<ThemedText>
|
|
104
|
+
{t('conversations.messageInThread.removedBy', { name })}
|
|
105
|
+
</ThemedText>
|
|
106
|
+
</View>
|
|
107
|
+
) : null}
|
|
106
108
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
<View ref={postViewRef} className="flex-row">
|
|
110
|
+
{!isMe && multipleParticipants ? (
|
|
111
|
+
<View className="mr-2 mt-6">
|
|
112
|
+
<ProfileAvatar
|
|
113
|
+
profile={message.profile}
|
|
114
|
+
className="size-10 border-0"
|
|
115
|
+
/>
|
|
116
|
+
</View>
|
|
117
|
+
) : null}
|
|
118
|
+
<View className="min-w-0 flex-1">
|
|
119
|
+
<ConversationMessageBubble message={message} unread={isUnread} />
|
|
120
|
+
</View>
|
|
114
121
|
</View>
|
|
115
|
-
) : null}
|
|
116
|
-
<View className="min-w-0 flex-1">
|
|
117
|
-
<ConversationMessageBubble message={message} unread={isUnread} />
|
|
118
|
-
</View>
|
|
119
|
-
</View>
|
|
120
122
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
123
|
+
<View
|
|
124
|
+
className={`mt-2 w-full flex-row text-sm ${
|
|
125
|
+
isMe ? 'justify-end' : 'justify-start'
|
|
126
|
+
}`}
|
|
127
|
+
>
|
|
128
|
+
{multipleParticipants && !isMe ? (
|
|
129
|
+
<ThemedText className="text-sm">{name} · </ThemedText>
|
|
130
|
+
) : null}
|
|
131
|
+
<UpdatingDate date={message.createdAt} />
|
|
132
|
+
</View>
|
|
133
|
+
</>
|
|
134
|
+
) : null}
|
|
131
135
|
</View>
|
|
132
136
|
);
|
|
133
137
|
};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Linking,
|
|
4
|
+
Platform,
|
|
5
|
+
Pressable,
|
|
6
|
+
ScrollView,
|
|
7
|
+
useColorScheme,
|
|
8
|
+
} from 'react-native';
|
|
3
9
|
import { Separator } from '../../ui/separator';
|
|
4
10
|
import { TouchableOpacity, View } from 'react-native';
|
|
5
11
|
import { Button } from '../../ui/button';
|
|
@@ -145,6 +151,8 @@ export const SideMenu = ({
|
|
|
145
151
|
showAdmin: false,
|
|
146
152
|
});
|
|
147
153
|
|
|
154
|
+
const bugReportUrl = serverInfo?.communityConfig?.info?.bugReportUrl;
|
|
155
|
+
|
|
148
156
|
const { t } = useTranslation();
|
|
149
157
|
|
|
150
158
|
const [currentRoute, setCurrentRoute] = React.useState<string | undefined>(
|
|
@@ -259,7 +267,17 @@ export const SideMenu = ({
|
|
|
259
267
|
</View>
|
|
260
268
|
|
|
261
269
|
<Separator />
|
|
262
|
-
<View className="pl-6 pr-4 pt-4 pb-12">
|
|
270
|
+
<View className="gap-1 pl-6 pr-4 pt-4 pb-12">
|
|
271
|
+
{bugReportUrl && /^https?:\/\//i.test(bugReportUrl) ? (
|
|
272
|
+
<Pressable
|
|
273
|
+
accessibilityRole="link"
|
|
274
|
+
onPress={() => void Linking.openURL(bugReportUrl)}
|
|
275
|
+
>
|
|
276
|
+
<ThemedText className="text-foreground text-base tracking-wider">
|
|
277
|
+
{t('navigation.reportBug')}
|
|
278
|
+
</ThemedText>
|
|
279
|
+
</Pressable>
|
|
280
|
+
) : null}
|
|
263
281
|
<ThemedText className="text-muted-foreground text-base tracking-wider">
|
|
264
282
|
{t('navigation.poweredBy')}
|
|
265
283
|
</ThemedText>
|
|
@@ -11,6 +11,7 @@ import { Button } from '../../components/ui/button';
|
|
|
11
11
|
import { ThemedText } from '../../components/ui/themed-text';
|
|
12
12
|
import { Image } from 'react-native';
|
|
13
13
|
import { View } from 'react-native';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
14
15
|
import { CompositeScreenProps } from '@react-navigation/native';
|
|
15
16
|
|
|
16
17
|
type SuccessScreenProps = CompositeScreenProps<
|
|
@@ -23,6 +24,7 @@ export const Success: React.FC<SuccessScreenProps> = ({
|
|
|
23
24
|
route,
|
|
24
25
|
}) => {
|
|
25
26
|
const { type } = route.params;
|
|
27
|
+
const { t } = useTranslation();
|
|
26
28
|
|
|
27
29
|
const renderContent = () => {
|
|
28
30
|
switch (type) {
|
|
@@ -37,19 +39,11 @@ export const Success: React.FC<SuccessScreenProps> = ({
|
|
|
37
39
|
resizeMode="cover"
|
|
38
40
|
/>
|
|
39
41
|
<ThemedText className="text-xl text-center text-muted-foreground my-10">
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
{t('auth.register.success')}{' '}
|
|
43
|
+
{t('auth.register.verificationReminder')}
|
|
42
44
|
</ThemedText>
|
|
43
45
|
</View>
|
|
44
46
|
<View className="w-full gap-7 flex items-center">
|
|
45
|
-
{/* TODO uncomment if email verification is implemented */}
|
|
46
|
-
{/* <Button
|
|
47
|
-
onPress={() => navigate(ROOT_ROUTES.MAIN)}
|
|
48
|
-
className="w-full py-4 rounded-lg">
|
|
49
|
-
<ThemedText className="font-medium text-base">
|
|
50
|
-
Open email app
|
|
51
|
-
</ThemedText>
|
|
52
|
-
</Button> */}
|
|
53
47
|
<Button
|
|
54
48
|
variant={'secondary'}
|
|
55
49
|
onPress={() => {
|
|
@@ -63,7 +57,7 @@ export const Success: React.FC<SuccessScreenProps> = ({
|
|
|
63
57
|
className="w-full py-4 rounded-lg"
|
|
64
58
|
>
|
|
65
59
|
<ThemedText className="font-medium text-base">
|
|
66
|
-
|
|
60
|
+
{t('auth.register.welcome')}
|
|
67
61
|
</ThemedText>
|
|
68
62
|
</Button>
|
|
69
63
|
</View>
|
|
@@ -81,7 +75,7 @@ export const Success: React.FC<SuccessScreenProps> = ({
|
|
|
81
75
|
resizeMode="cover"
|
|
82
76
|
/>
|
|
83
77
|
<ThemedText className="text-xl text-center my-10">
|
|
84
|
-
|
|
78
|
+
{t('auth.resetPassword.done')}
|
|
85
79
|
</ThemedText>
|
|
86
80
|
</View>
|
|
87
81
|
<View className="w-full gap-7 flex items-center">
|
|
@@ -90,7 +84,7 @@ export const Success: React.FC<SuccessScreenProps> = ({
|
|
|
90
84
|
className="w-full py-4 rounded-lg"
|
|
91
85
|
>
|
|
92
86
|
<ThemedText className="font-medium text-base">
|
|
93
|
-
|
|
87
|
+
{t('auth.resetPassword.goToLogin')}
|
|
94
88
|
</ThemedText>
|
|
95
89
|
</Button>
|
|
96
90
|
</View>
|