@openpeepshq/rn-components 0.12.0 → 0.12.2
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpeepshq/rn-components",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
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",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"clsx": "^2.1.1",
|
|
99
99
|
"date-fns": "^4.1.0",
|
|
100
100
|
"i18next": "^24.2.3",
|
|
101
|
-
"i18next-http-backend": "^
|
|
101
|
+
"i18next-http-backend": "^4.0.10",
|
|
102
102
|
"js-base64": "^3.7.7",
|
|
103
103
|
"livekit-client": "2.19.2",
|
|
104
104
|
"lucide-react-native": "^0.474.0",
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression tests for the ProfileCard layout guards (issue #2111).
|
|
3
|
+
*
|
|
4
|
+
* The RN card dropped the web card's flexbox overflow guards
|
|
5
|
+
* (`min-w-0 flex-1` on the content wrapper, line clamps on the texts), so a
|
|
6
|
+
* long bio pushed the Follow/Unfollow button past the right edge where it
|
|
7
|
+
* was clipped. The row and text column must stay flexible and the texts
|
|
8
|
+
* must keep their line caps, mirroring
|
|
9
|
+
* platform/react/src/components/profile/ProfileCard.tsx.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const React = require('react');
|
|
13
|
+
const ReactTestRenderer = require('react-test-renderer');
|
|
14
|
+
|
|
15
|
+
jest.mock('react-native', () => ({
|
|
16
|
+
View: (props: { children?: unknown }) =>
|
|
17
|
+
React.createElement('View', null, props.children),
|
|
18
|
+
Pressable: (props: {
|
|
19
|
+
children?: unknown;
|
|
20
|
+
onPress?: () => void;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
}) =>
|
|
23
|
+
React.createElement(
|
|
24
|
+
'Pressable',
|
|
25
|
+
{ onPress: props.onPress, disabled: props.disabled },
|
|
26
|
+
props.children
|
|
27
|
+
),
|
|
28
|
+
TouchableWithoutFeedback: (props: { children?: unknown }) =>
|
|
29
|
+
React.createElement('TouchableWithoutFeedback', null, props.children),
|
|
30
|
+
}));
|
|
31
|
+
|
|
32
|
+
jest.mock('react-i18next', () => ({
|
|
33
|
+
useTranslation: () => ({ t: (key: string) => key }),
|
|
34
|
+
}));
|
|
35
|
+
|
|
36
|
+
jest.mock('@react-navigation/native', () => ({
|
|
37
|
+
useNavigation: () => ({ navigate: jest.fn() }),
|
|
38
|
+
}));
|
|
39
|
+
|
|
40
|
+
jest.mock('@openpeepshq/common', () => ({}));
|
|
41
|
+
|
|
42
|
+
jest.mock('@openpeepshq/common/lib', () => ({
|
|
43
|
+
// Mirrored from platform/common/src/lib — the built package ships ESM
|
|
44
|
+
// which Jest's node transform doesn't cover.
|
|
45
|
+
markdownPlainText: (text?: string) => text ?? '',
|
|
46
|
+
}));
|
|
47
|
+
|
|
48
|
+
jest.mock('../icons/index', () => ({
|
|
49
|
+
XIcon: () => React.createElement('XIcon'),
|
|
50
|
+
}));
|
|
51
|
+
|
|
52
|
+
jest.mock('../ui/themed-text', () => ({
|
|
53
|
+
ThemedText: (props: Record<string, unknown>) =>
|
|
54
|
+
React.createElement('ThemedText', props, props.children),
|
|
55
|
+
}));
|
|
56
|
+
|
|
57
|
+
jest.mock('./Avatar', () => ({
|
|
58
|
+
ProfileAvatar: (props: Record<string, unknown>) =>
|
|
59
|
+
React.createElement('ProfileAvatar', props),
|
|
60
|
+
}));
|
|
61
|
+
|
|
62
|
+
jest.mock('./FollowUnfollowButton', () => ({
|
|
63
|
+
FollowUnfollowButton: (props: Record<string, unknown>) =>
|
|
64
|
+
React.createElement('FollowUnfollowButton', props),
|
|
65
|
+
}));
|
|
66
|
+
|
|
67
|
+
jest.mock('../../lib/utils', () => ({
|
|
68
|
+
truncateText: (text: string, max: number) =>
|
|
69
|
+
text && text.length > max ? `${text.slice(0, max)}…` : text,
|
|
70
|
+
}));
|
|
71
|
+
|
|
72
|
+
import type { ProfileCardProps } from './ProfileCard';
|
|
73
|
+
import { ProfileCard } from './ProfileCard';
|
|
74
|
+
|
|
75
|
+
const longBio =
|
|
76
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. '.repeat(6) +
|
|
77
|
+
'Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.';
|
|
78
|
+
|
|
79
|
+
const profile = {
|
|
80
|
+
did: 'did:plc:test',
|
|
81
|
+
handle: 'lovelace.example',
|
|
82
|
+
displayName: 'Ada Lovelace',
|
|
83
|
+
bio: longBio,
|
|
84
|
+
} as unknown as ProfileCardProps['profile'];
|
|
85
|
+
|
|
86
|
+
const renderCard = () => {
|
|
87
|
+
let tree: ReturnType<typeof ReactTestRenderer.create>;
|
|
88
|
+
ReactTestRenderer.act(() => {
|
|
89
|
+
tree = ReactTestRenderer.create(
|
|
90
|
+
React.createElement(ProfileCard, {
|
|
91
|
+
profile,
|
|
92
|
+
actionType: 'link' as const,
|
|
93
|
+
})
|
|
94
|
+
);
|
|
95
|
+
});
|
|
96
|
+
return tree;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
describe('ProfileCard layout guards (issue #2111)', () => {
|
|
100
|
+
it('clamps the bio to two lines so a long bio cannot push the action out', () => {
|
|
101
|
+
const tree = renderCard();
|
|
102
|
+
const bioText = tree.root
|
|
103
|
+
.findAllByType('ThemedText')
|
|
104
|
+
.find((node: { props: { children?: unknown } }) =>
|
|
105
|
+
String(node.props.children).startsWith('Lorem ipsum')
|
|
106
|
+
);
|
|
107
|
+
expect(bioText).toBeDefined();
|
|
108
|
+
expect(bioText.props.numberOfLines).toBe(2);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('clamps the display name and handle to one line', () => {
|
|
112
|
+
const tree = renderCard();
|
|
113
|
+
const texts = tree.root.findAllByType('ThemedText');
|
|
114
|
+
const name = texts.find(
|
|
115
|
+
(node: { props: { children?: unknown } }) =>
|
|
116
|
+
node.props.children === 'Ada Lovelace'
|
|
117
|
+
);
|
|
118
|
+
const handle = texts.find(
|
|
119
|
+
(node: { props: { children?: unknown } }) =>
|
|
120
|
+
String(node.props.children) === '@lovelace.example' ||
|
|
121
|
+
(Array.isArray(node.props.children) &&
|
|
122
|
+
node.props.children.join('') === '@lovelace.example')
|
|
123
|
+
);
|
|
124
|
+
expect(name).toBeDefined();
|
|
125
|
+
expect(handle).toBeDefined();
|
|
126
|
+
expect(name.props.numberOfLines).toBe(1);
|
|
127
|
+
expect(handle.props.numberOfLines).toBe(1);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it('keeps the profile content inside a flexible row with the action pinned', () => {
|
|
131
|
+
const tree = renderCard();
|
|
132
|
+
const contentRow = tree.root.findByProps({
|
|
133
|
+
className: 'flex flex-row items-center gap-x-2 min-w-0 flex-1',
|
|
134
|
+
});
|
|
135
|
+
const textColumn = tree.root.findByProps({
|
|
136
|
+
className: 'min-w-0 flex-1',
|
|
137
|
+
});
|
|
138
|
+
expect(contentRow).toBeDefined();
|
|
139
|
+
expect(textColumn).toBeDefined();
|
|
140
|
+
// Follow/Unfollow action is rendered and not clipped away.
|
|
141
|
+
expect(tree.root.findByType('FollowUnfollowButton')).toBeDefined();
|
|
142
|
+
});
|
|
143
|
+
});
|
|
@@ -64,18 +64,26 @@ export const ProfileCard = ({
|
|
|
64
64
|
}`}
|
|
65
65
|
>
|
|
66
66
|
<TouchableWithoutFeedback onPress={onPress}>
|
|
67
|
-
<View className="flex flex-row items-center gap-x-2">
|
|
67
|
+
<View className="flex flex-row items-center gap-x-2 min-w-0 flex-1">
|
|
68
68
|
<ProfileAvatar
|
|
69
69
|
profile={profile}
|
|
70
70
|
className={actionType === 'select' ? 'size-10' : 'size-16'}
|
|
71
71
|
/>
|
|
72
|
-
<View className="">
|
|
73
|
-
<ThemedText
|
|
72
|
+
<View className="min-w-0 flex-1">
|
|
73
|
+
<ThemedText
|
|
74
|
+
className="text-lg font-semibold truncate"
|
|
75
|
+
numberOfLines={1}
|
|
76
|
+
>
|
|
74
77
|
{truncateText(profile.displayName, 18) || profile.handle}
|
|
75
78
|
</ThemedText>
|
|
76
|
-
<ThemedText className=""
|
|
79
|
+
<ThemedText className="truncate" numberOfLines={1}>
|
|
80
|
+
@{profile.handle}
|
|
81
|
+
</ThemedText>
|
|
77
82
|
{bio ? (
|
|
78
|
-
<ThemedText
|
|
83
|
+
<ThemedText
|
|
84
|
+
className="text-muted-foreground mt-1 text-sm"
|
|
85
|
+
numberOfLines={2}
|
|
86
|
+
>
|
|
79
87
|
{truncateText(bio, 100)}
|
|
80
88
|
</ThemedText>
|
|
81
89
|
) : null}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression tests for the ResourceCard download action (list layout).
|
|
3
|
+
*
|
|
4
|
+
* The action used to be enabled with `actionLabel === 'Download'`,
|
|
5
|
+
* comparing the *translated* label against the English copy. In any
|
|
6
|
+
* non-English locale the comparison fails and the download action
|
|
7
|
+
* silently degrades to inert text — resources could no longer be
|
|
8
|
+
* opened/downloaded (issue #1820). The gate must use the stable
|
|
9
|
+
* `resource.resourceKind === 'file'` property, mirroring the web card.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const React = require('react');
|
|
13
|
+
const ReactTestRenderer = require('react-test-renderer');
|
|
14
|
+
|
|
15
|
+
let mockTranslations: Record<string, string> = {};
|
|
16
|
+
|
|
17
|
+
jest.mock('react-native', () => ({
|
|
18
|
+
View: (props: { children?: unknown }) =>
|
|
19
|
+
React.createElement('View', null, props.children),
|
|
20
|
+
Pressable: (props: {
|
|
21
|
+
children?: unknown;
|
|
22
|
+
onPress?: () => void;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
}) =>
|
|
25
|
+
React.createElement(
|
|
26
|
+
'Pressable',
|
|
27
|
+
{ onPress: props.onPress, disabled: props.disabled },
|
|
28
|
+
props.children
|
|
29
|
+
),
|
|
30
|
+
Linking: { openURL: jest.fn() },
|
|
31
|
+
}));
|
|
32
|
+
|
|
33
|
+
jest.mock('react-i18next', () => ({
|
|
34
|
+
useTranslation: () => ({
|
|
35
|
+
t: (key: string) => mockTranslations[key] ?? key,
|
|
36
|
+
}),
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
jest.mock('@react-navigation/native', () => ({
|
|
40
|
+
useNavigation: () => ({ navigate: jest.fn() }),
|
|
41
|
+
}));
|
|
42
|
+
|
|
43
|
+
jest.mock('@openpeepshq/common/lib', () => {
|
|
44
|
+
// Mirrored from platform/common/src/lib/resources.ts — the built
|
|
45
|
+
// package ships ESM which Jest's node transform doesn't cover.
|
|
46
|
+
const attachmentMediaKind = (att: {
|
|
47
|
+
type?: string;
|
|
48
|
+
meta?: { mimetype?: string };
|
|
49
|
+
}): string => {
|
|
50
|
+
const mime = att.meta?.mimetype ?? '';
|
|
51
|
+
const type = att.type ?? '';
|
|
52
|
+
if (type === 'image' || mime.startsWith('image/')) return 'image';
|
|
53
|
+
if (type === 'video' || mime.startsWith('video/')) return 'video';
|
|
54
|
+
if (type === 'audio' || mime.startsWith('audio/')) return 'audio';
|
|
55
|
+
return 'file';
|
|
56
|
+
};
|
|
57
|
+
const formatSize = (bytes: number): string => `${bytes} B`;
|
|
58
|
+
const normalizeResourceTags = (
|
|
59
|
+
tags: readonly string[] | undefined
|
|
60
|
+
): string[] => {
|
|
61
|
+
const seen = new Set<string>();
|
|
62
|
+
const out: string[] = [];
|
|
63
|
+
for (const raw of tags ?? []) {
|
|
64
|
+
const tag = raw.replace(/^#/, '').trim().toLowerCase();
|
|
65
|
+
if (!tag || seen.has(tag)) continue;
|
|
66
|
+
seen.add(tag);
|
|
67
|
+
out.push(tag);
|
|
68
|
+
}
|
|
69
|
+
return out;
|
|
70
|
+
};
|
|
71
|
+
return {
|
|
72
|
+
attachmentMediaKind,
|
|
73
|
+
formatSize,
|
|
74
|
+
groupName: (group: { name?: string } | null) => group?.name,
|
|
75
|
+
normalizeResourceTags,
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
jest.mock('@openpeepshq/react', () => ({
|
|
80
|
+
useOpenpeeps: () => ({
|
|
81
|
+
openpeepsApi: {
|
|
82
|
+
useCurrentProfile: () => ({ data: null }),
|
|
83
|
+
useCurrentProfileBookmarkedIds: () => ({ data: undefined }),
|
|
84
|
+
bookmarkPostAction: () => () => {},
|
|
85
|
+
unbookmarkPostAction: () => () => {},
|
|
86
|
+
},
|
|
87
|
+
}),
|
|
88
|
+
}));
|
|
89
|
+
|
|
90
|
+
jest.mock('../navigation/helpers', () => ({
|
|
91
|
+
buildGoto: () => jest.fn(),
|
|
92
|
+
}));
|
|
93
|
+
|
|
94
|
+
jest.mock('../custom/common', () => ({
|
|
95
|
+
CachedImage: () => null,
|
|
96
|
+
}));
|
|
97
|
+
|
|
98
|
+
jest.mock('../ui/themed-text', () => ({
|
|
99
|
+
ThemedText: (props: { children?: unknown }) =>
|
|
100
|
+
React.createElement('ThemedText', null, props.children),
|
|
101
|
+
}));
|
|
102
|
+
|
|
103
|
+
jest.mock('../post/VideoPlayOverlay', () => ({
|
|
104
|
+
VideoPlayOverlay: () => null,
|
|
105
|
+
}));
|
|
106
|
+
|
|
107
|
+
jest.mock('../post/TruncatedMarkdown', () => ({
|
|
108
|
+
TruncatedMarkdown: () => null,
|
|
109
|
+
}));
|
|
110
|
+
|
|
111
|
+
jest.mock('../icons', () => ({
|
|
112
|
+
BookmarkPlusIcon: () => React.createElement('BookmarkPlusIcon'),
|
|
113
|
+
BookmarkMinusIcon: () => React.createElement('BookmarkMinusIcon'),
|
|
114
|
+
LinkIcon: () => React.createElement('LinkIcon'),
|
|
115
|
+
ImageOffIcon: () => React.createElement('ImageOffIcon'),
|
|
116
|
+
AudioLinesIcon: () => React.createElement('AudioLinesIcon'),
|
|
117
|
+
}));
|
|
118
|
+
|
|
119
|
+
import type { ResourceCardProps } from './ResourceCard';
|
|
120
|
+
import { ResourceCard } from './ResourceCard';
|
|
121
|
+
|
|
122
|
+
const Linking = require('react-native').Linking;
|
|
123
|
+
|
|
124
|
+
const EN = {
|
|
125
|
+
'resources.actions.download': 'Download',
|
|
126
|
+
'resources.actions.watch': 'Watch',
|
|
127
|
+
'resources.kinds.file': 'File',
|
|
128
|
+
'resources.kinds.video': 'Video',
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
// German stand-in: the translated label never equals the English copy.
|
|
132
|
+
const DE = {
|
|
133
|
+
'resources.actions.download': 'Herunterladen',
|
|
134
|
+
'resources.actions.watch': 'Ansehen',
|
|
135
|
+
'resources.kinds.file': 'Datei',
|
|
136
|
+
'resources.kinds.video': 'Video',
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const resourcePost = (
|
|
140
|
+
data: Record<string, unknown>
|
|
141
|
+
): ResourceCardProps['post'] =>
|
|
142
|
+
({
|
|
143
|
+
id: 'post-1',
|
|
144
|
+
group: null,
|
|
145
|
+
data: { type: 'resource', ...data },
|
|
146
|
+
}) as unknown as ResourceCardProps['post'];
|
|
147
|
+
|
|
148
|
+
const filePost = resourcePost({
|
|
149
|
+
title: 'Spec PDF',
|
|
150
|
+
resourceKind: 'file',
|
|
151
|
+
attachments: [
|
|
152
|
+
{
|
|
153
|
+
url: 'https://example.com/spec.pdf',
|
|
154
|
+
type: 'file',
|
|
155
|
+
filename: 'spec.pdf',
|
|
156
|
+
meta: { mimetype: 'application/pdf', size: 1234 },
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
const videoPost = resourcePost({
|
|
162
|
+
title: 'Talk',
|
|
163
|
+
resourceKind: 'video',
|
|
164
|
+
attachments: [
|
|
165
|
+
{
|
|
166
|
+
url: 'https://example.com/talk.mp4',
|
|
167
|
+
type: 'video',
|
|
168
|
+
meta: { mimetype: 'video/mp4', size: 99 },
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
const linkPost = resourcePost({
|
|
174
|
+
title: 'Docs',
|
|
175
|
+
resourceKind: 'link',
|
|
176
|
+
url: 'https://example.com/docs',
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
const renderCard = (post: ResourceCardProps['post']) => {
|
|
180
|
+
let tree: ReturnType<typeof ReactTestRenderer.create>;
|
|
181
|
+
ReactTestRenderer.act(() => {
|
|
182
|
+
tree = ReactTestRenderer.create(
|
|
183
|
+
React.createElement(ResourceCard, {
|
|
184
|
+
post,
|
|
185
|
+
layout: 'list' as const,
|
|
186
|
+
})
|
|
187
|
+
);
|
|
188
|
+
});
|
|
189
|
+
return tree;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
// The bookmark button is also a Pressable; it renders disabled for the
|
|
193
|
+
// anonymous profile the mock returns, so enabled Pressables are the
|
|
194
|
+
// card's actions only.
|
|
195
|
+
const enabledPressables = (tree: ReturnType<typeof ReactTestRenderer.create>) =>
|
|
196
|
+
tree.root
|
|
197
|
+
.findAllByType('Pressable')
|
|
198
|
+
.filter((node: { props: { disabled?: boolean } }) => !node.props.disabled);
|
|
199
|
+
|
|
200
|
+
const actionTexts = (tree: ReturnType<typeof ReactTestRenderer.create>) =>
|
|
201
|
+
tree.root
|
|
202
|
+
.findAllByType('ThemedText')
|
|
203
|
+
.map((node: { props: { children?: unknown } }) => node.props.children);
|
|
204
|
+
|
|
205
|
+
describe('ResourceCard list-layout actions', () => {
|
|
206
|
+
beforeEach(() => {
|
|
207
|
+
mockTranslations = EN;
|
|
208
|
+
Linking.openURL.mockClear();
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it('enables the download action for a file resource (en locale)', () => {
|
|
212
|
+
const tree = renderCard(filePost);
|
|
213
|
+
const [action] = enabledPressables(tree);
|
|
214
|
+
expect(action).toBeDefined();
|
|
215
|
+
expect(actionTexts(tree)).toContain('Download');
|
|
216
|
+
ReactTestRenderer.act(() => {
|
|
217
|
+
action.props.onPress();
|
|
218
|
+
});
|
|
219
|
+
expect(Linking.openURL).toHaveBeenCalledWith(
|
|
220
|
+
'https://example.com/spec.pdf'
|
|
221
|
+
);
|
|
222
|
+
tree.unmount();
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it('keeps the download action enabled in non-English locales', () => {
|
|
226
|
+
mockTranslations = DE;
|
|
227
|
+
const tree = renderCard(filePost);
|
|
228
|
+
const [action] = enabledPressables(tree);
|
|
229
|
+
expect(action).toBeDefined();
|
|
230
|
+
expect(actionTexts(tree)).toContain('Herunterladen');
|
|
231
|
+
ReactTestRenderer.act(() => {
|
|
232
|
+
action.props.onPress();
|
|
233
|
+
});
|
|
234
|
+
expect(Linking.openURL).toHaveBeenCalledWith(
|
|
235
|
+
'https://example.com/spec.pdf'
|
|
236
|
+
);
|
|
237
|
+
tree.unmount();
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
it('renders an inert label for a file resource without an attachment', () => {
|
|
241
|
+
const tree = renderCard(
|
|
242
|
+
resourcePost({ title: 'Empty', resourceKind: 'file' })
|
|
243
|
+
);
|
|
244
|
+
expect(enabledPressables(tree)).toHaveLength(0);
|
|
245
|
+
expect(actionTexts(tree)).toContain('Download');
|
|
246
|
+
tree.unmount();
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
it('does not make the watch label pressable for a video resource', () => {
|
|
250
|
+
const tree = renderCard(videoPost);
|
|
251
|
+
expect(enabledPressables(tree)).toHaveLength(0);
|
|
252
|
+
expect(actionTexts(tree)).toContain('Watch');
|
|
253
|
+
tree.unmount();
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
it('renders no action for a link resource', () => {
|
|
257
|
+
const tree = renderCard(linkPost);
|
|
258
|
+
expect(enabledPressables(tree)).toHaveLength(0);
|
|
259
|
+
expect(actionTexts(tree)).not.toContain('Download');
|
|
260
|
+
tree.unmount();
|
|
261
|
+
});
|
|
262
|
+
});
|
|
@@ -231,7 +231,10 @@ export const ResourceCard = ({
|
|
|
231
231
|
</View>
|
|
232
232
|
<View className="flex-row items-center gap-2">
|
|
233
233
|
{resource.resourceKind !== 'link' && actionLabel ? (
|
|
234
|
-
|
|
234
|
+
// Gate on the stable resource kind, not the translated label:
|
|
235
|
+
// in non-English locales the label differs and the download
|
|
236
|
+
// action would silently stop working (web gates the same way).
|
|
237
|
+
resource.resourceKind === 'file' && downloadUrl ? (
|
|
235
238
|
<Pressable onPress={() => Linking.openURL(downloadUrl)}>
|
|
236
239
|
<ThemedText className="text-primary text-xs font-medium">
|
|
237
240
|
{actionLabel}
|