@bbearai/react-native 0.1.6 → 0.1.7
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/dist/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +417 -2
- package/dist/index.mjs +417 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { BugBearConfig, BugBearClient, TesterInfo, TestAssignment, DeviceInfo, TesterThread, TesterMessage, AppContext } from '@bbearai/core';
|
|
2
|
+
import { BugBearConfig, BugBearClient, TesterInfo, TestAssignment, DeviceInfo, TesterThread, TesterMessage, TesterProfileUpdate, AppContext } from '@bbearai/core';
|
|
3
3
|
export { AppContext, BugBearConfig, BugBearReport, DeviceInfo, MessageSenderType, ReportType, Severity, TestAssignment, TesterInfo, TesterMessage, TesterThread, ThreadPriority, ThreadType } from '@bbearai/core';
|
|
4
4
|
|
|
5
5
|
interface BugBearContextValue {
|
|
@@ -38,6 +38,13 @@ interface BugBearContextValue {
|
|
|
38
38
|
}>;
|
|
39
39
|
/** Re-check tester status (call after auth state changes) */
|
|
40
40
|
refreshTesterStatus: () => Promise<void>;
|
|
41
|
+
/** Update tester profile */
|
|
42
|
+
updateTesterProfile: (updates: TesterProfileUpdate) => Promise<{
|
|
43
|
+
success: boolean;
|
|
44
|
+
error?: string;
|
|
45
|
+
}>;
|
|
46
|
+
/** Refresh tester info from server */
|
|
47
|
+
refreshTesterInfo: () => Promise<void>;
|
|
41
48
|
}
|
|
42
49
|
declare function useBugBear(): BugBearContextValue;
|
|
43
50
|
interface BugBearProviderProps {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { BugBearConfig, BugBearClient, TesterInfo, TestAssignment, DeviceInfo, TesterThread, TesterMessage, AppContext } from '@bbearai/core';
|
|
2
|
+
import { BugBearConfig, BugBearClient, TesterInfo, TestAssignment, DeviceInfo, TesterThread, TesterMessage, TesterProfileUpdate, AppContext } from '@bbearai/core';
|
|
3
3
|
export { AppContext, BugBearConfig, BugBearReport, DeviceInfo, MessageSenderType, ReportType, Severity, TestAssignment, TesterInfo, TesterMessage, TesterThread, ThreadPriority, ThreadType } from '@bbearai/core';
|
|
4
4
|
|
|
5
5
|
interface BugBearContextValue {
|
|
@@ -38,6 +38,13 @@ interface BugBearContextValue {
|
|
|
38
38
|
}>;
|
|
39
39
|
/** Re-check tester status (call after auth state changes) */
|
|
40
40
|
refreshTesterStatus: () => Promise<void>;
|
|
41
|
+
/** Update tester profile */
|
|
42
|
+
updateTesterProfile: (updates: TesterProfileUpdate) => Promise<{
|
|
43
|
+
success: boolean;
|
|
44
|
+
error?: string;
|
|
45
|
+
}>;
|
|
46
|
+
/** Refresh tester info from server */
|
|
47
|
+
refreshTesterInfo: () => Promise<void>;
|
|
41
48
|
}
|
|
42
49
|
declare function useBugBear(): BugBearContextValue;
|
|
43
50
|
interface BugBearProviderProps {
|
package/dist/index.js
CHANGED
|
@@ -11566,6 +11566,9 @@ var BugBearClient = class {
|
|
|
11566
11566
|
id: data.id,
|
|
11567
11567
|
name: data.name,
|
|
11568
11568
|
email: data.email,
|
|
11569
|
+
additionalEmails: data.additional_emails || [],
|
|
11570
|
+
avatarUrl: data.avatar_url || void 0,
|
|
11571
|
+
platforms: data.platforms || [],
|
|
11569
11572
|
assignedTests: data.assigned_count || 0,
|
|
11570
11573
|
completedTests: data.completed_count || 0
|
|
11571
11574
|
};
|
|
@@ -11574,6 +11577,32 @@ var BugBearClient = class {
|
|
|
11574
11577
|
return null;
|
|
11575
11578
|
}
|
|
11576
11579
|
}
|
|
11580
|
+
/**
|
|
11581
|
+
* Update tester profile
|
|
11582
|
+
* Allows testers to update their name, additional emails, avatar, and platforms
|
|
11583
|
+
*/
|
|
11584
|
+
async updateTesterProfile(updates) {
|
|
11585
|
+
try {
|
|
11586
|
+
const userInfo = await this.getCurrentUserInfo();
|
|
11587
|
+
if (!userInfo) {
|
|
11588
|
+
return { success: false, error: "Not authenticated" };
|
|
11589
|
+
}
|
|
11590
|
+
const updateData = {};
|
|
11591
|
+
if (updates.name !== void 0) updateData.name = updates.name;
|
|
11592
|
+
if (updates.additionalEmails !== void 0) updateData.additional_emails = updates.additionalEmails;
|
|
11593
|
+
if (updates.avatarUrl !== void 0) updateData.avatar_url = updates.avatarUrl;
|
|
11594
|
+
if (updates.platforms !== void 0) updateData.platforms = updates.platforms;
|
|
11595
|
+
const { error } = await this.supabase.from("testers").update(updateData).eq("project_id", this.config.projectId).eq("email", userInfo.email);
|
|
11596
|
+
if (error) {
|
|
11597
|
+
console.error("BugBear: updateTesterProfile error", error);
|
|
11598
|
+
return { success: false, error: error.message };
|
|
11599
|
+
}
|
|
11600
|
+
return { success: true };
|
|
11601
|
+
} catch (err) {
|
|
11602
|
+
console.error("BugBear: updateTesterProfile error", err);
|
|
11603
|
+
return { success: false, error: "Failed to update profile" };
|
|
11604
|
+
}
|
|
11605
|
+
}
|
|
11577
11606
|
/**
|
|
11578
11607
|
* Check if current user is a tester for this project
|
|
11579
11608
|
*/
|
|
@@ -12120,6 +12149,9 @@ var BugBearContext = (0, import_react.createContext)({
|
|
|
12120
12149
|
},
|
|
12121
12150
|
createThread: async () => ({ success: false }),
|
|
12122
12151
|
refreshTesterStatus: async () => {
|
|
12152
|
+
},
|
|
12153
|
+
updateTesterProfile: async () => ({ success: false }),
|
|
12154
|
+
refreshTesterInfo: async () => {
|
|
12123
12155
|
}
|
|
12124
12156
|
});
|
|
12125
12157
|
function useBugBear() {
|
|
@@ -12181,6 +12213,20 @@ function BugBearProvider({ config, children, appVersion, enabled = true }) {
|
|
|
12181
12213
|
}
|
|
12182
12214
|
return result;
|
|
12183
12215
|
}, [client, refreshThreads]);
|
|
12216
|
+
const updateTesterProfile = (0, import_react.useCallback)(async (updates) => {
|
|
12217
|
+
if (!client) return { success: false, error: "Client not initialized" };
|
|
12218
|
+
const result = await client.updateTesterProfile(updates);
|
|
12219
|
+
if (result.success) {
|
|
12220
|
+
const info = await client.getTesterInfo();
|
|
12221
|
+
setTesterInfo(info);
|
|
12222
|
+
}
|
|
12223
|
+
return result;
|
|
12224
|
+
}, [client]);
|
|
12225
|
+
const refreshTesterInfo = (0, import_react.useCallback)(async () => {
|
|
12226
|
+
if (!client) return;
|
|
12227
|
+
const info = await client.getTesterInfo();
|
|
12228
|
+
setTesterInfo(info);
|
|
12229
|
+
}, [client]);
|
|
12184
12230
|
const initializeBugBear = (0, import_react.useCallback)(async (bugBearClient) => {
|
|
12185
12231
|
setIsLoading(true);
|
|
12186
12232
|
try {
|
|
@@ -12247,7 +12293,9 @@ function BugBearProvider({ config, children, appVersion, enabled = true }) {
|
|
|
12247
12293
|
sendMessage,
|
|
12248
12294
|
markAsRead,
|
|
12249
12295
|
createThread,
|
|
12250
|
-
refreshTesterStatus
|
|
12296
|
+
refreshTesterStatus,
|
|
12297
|
+
updateTesterProfile,
|
|
12298
|
+
refreshTesterInfo
|
|
12251
12299
|
}
|
|
12252
12300
|
},
|
|
12253
12301
|
children
|
|
@@ -12290,7 +12338,9 @@ function BugBearButton({
|
|
|
12290
12338
|
getThreadMessages,
|
|
12291
12339
|
sendMessage,
|
|
12292
12340
|
markAsRead,
|
|
12293
|
-
createThread
|
|
12341
|
+
createThread,
|
|
12342
|
+
updateTesterProfile,
|
|
12343
|
+
refreshTesterInfo
|
|
12294
12344
|
} = useBugBear();
|
|
12295
12345
|
const [modalVisible, setModalVisible] = (0, import_react2.useState)(false);
|
|
12296
12346
|
const [activeTab, setActiveTab] = (0, import_react2.useState)("tests");
|
|
@@ -12304,6 +12354,13 @@ function BugBearButton({
|
|
|
12304
12354
|
const [composeSubject, setComposeSubject] = (0, import_react2.useState)("");
|
|
12305
12355
|
const [composeMessage, setComposeMessage] = (0, import_react2.useState)("");
|
|
12306
12356
|
const [sendingNewMessage, setSendingNewMessage] = (0, import_react2.useState)(false);
|
|
12357
|
+
const [profileEditing, setProfileEditing] = (0, import_react2.useState)(false);
|
|
12358
|
+
const [profileName, setProfileName] = (0, import_react2.useState)("");
|
|
12359
|
+
const [profileAdditionalEmails, setProfileAdditionalEmails] = (0, import_react2.useState)([]);
|
|
12360
|
+
const [newEmailInput, setNewEmailInput] = (0, import_react2.useState)("");
|
|
12361
|
+
const [profilePlatforms, setProfilePlatforms] = (0, import_react2.useState)([]);
|
|
12362
|
+
const [savingProfile, setSavingProfile] = (0, import_react2.useState)(false);
|
|
12363
|
+
const [profileSaved, setProfileSaved] = (0, import_react2.useState)(false);
|
|
12307
12364
|
const getInitialPosition = () => {
|
|
12308
12365
|
const buttonSize = 56;
|
|
12309
12366
|
const margin = 16;
|
|
@@ -12488,6 +12545,50 @@ function BugBearButton({
|
|
|
12488
12545
|
}
|
|
12489
12546
|
setSendingNewMessage(false);
|
|
12490
12547
|
};
|
|
12548
|
+
const handleStartEditProfile = () => {
|
|
12549
|
+
if (testerInfo) {
|
|
12550
|
+
setProfileName(testerInfo.name);
|
|
12551
|
+
setProfileAdditionalEmails(testerInfo.additionalEmails || []);
|
|
12552
|
+
setProfilePlatforms(testerInfo.platforms || []);
|
|
12553
|
+
}
|
|
12554
|
+
setProfileEditing(true);
|
|
12555
|
+
};
|
|
12556
|
+
const handleCancelEditProfile = () => {
|
|
12557
|
+
setProfileEditing(false);
|
|
12558
|
+
setNewEmailInput("");
|
|
12559
|
+
};
|
|
12560
|
+
const handleAddEmail = () => {
|
|
12561
|
+
const email = newEmailInput.trim().toLowerCase();
|
|
12562
|
+
if (email && email.includes("@") && !profileAdditionalEmails.includes(email)) {
|
|
12563
|
+
setProfileAdditionalEmails([...profileAdditionalEmails, email]);
|
|
12564
|
+
setNewEmailInput("");
|
|
12565
|
+
}
|
|
12566
|
+
};
|
|
12567
|
+
const handleRemoveEmail = (email) => {
|
|
12568
|
+
setProfileAdditionalEmails(profileAdditionalEmails.filter((e) => e !== email));
|
|
12569
|
+
};
|
|
12570
|
+
const handleTogglePlatform = (platform) => {
|
|
12571
|
+
if (profilePlatforms.includes(platform)) {
|
|
12572
|
+
setProfilePlatforms(profilePlatforms.filter((p) => p !== platform));
|
|
12573
|
+
} else {
|
|
12574
|
+
setProfilePlatforms([...profilePlatforms, platform]);
|
|
12575
|
+
}
|
|
12576
|
+
};
|
|
12577
|
+
const handleSaveProfile = async () => {
|
|
12578
|
+
setSavingProfile(true);
|
|
12579
|
+
const updates = {
|
|
12580
|
+
name: profileName.trim(),
|
|
12581
|
+
additionalEmails: profileAdditionalEmails,
|
|
12582
|
+
platforms: profilePlatforms
|
|
12583
|
+
};
|
|
12584
|
+
const result = await updateTesterProfile(updates);
|
|
12585
|
+
if (result.success) {
|
|
12586
|
+
setProfileEditing(false);
|
|
12587
|
+
setProfileSaved(true);
|
|
12588
|
+
setTimeout(() => setProfileSaved(false), 2e3);
|
|
12589
|
+
}
|
|
12590
|
+
setSavingProfile(false);
|
|
12591
|
+
};
|
|
12491
12592
|
const formatRelativeTime = (dateString) => {
|
|
12492
12593
|
const date = new Date(dateString);
|
|
12493
12594
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -12671,6 +12772,13 @@ function BugBearButton({
|
|
|
12671
12772
|
onPress: () => setActiveTab("messages")
|
|
12672
12773
|
},
|
|
12673
12774
|
/* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.tabWithBadge }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: [styles.tabText, activeTab === "messages" && styles.activeTabText] }, "Messages"), unreadCount > 0 && /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.tabBadge }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.tabBadgeText }, unreadCount)))
|
|
12775
|
+
), /* @__PURE__ */ import_react2.default.createElement(
|
|
12776
|
+
import_react_native2.TouchableOpacity,
|
|
12777
|
+
{
|
|
12778
|
+
style: [styles.tab, activeTab === "profile" && styles.activeTab],
|
|
12779
|
+
onPress: () => setActiveTab("profile")
|
|
12780
|
+
},
|
|
12781
|
+
/* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: [styles.tabText, activeTab === "profile" && styles.activeTabText] }, "Profile")
|
|
12674
12782
|
), /* @__PURE__ */ import_react2.default.createElement(
|
|
12675
12783
|
import_react_native2.TouchableOpacity,
|
|
12676
12784
|
{
|
|
@@ -12822,6 +12930,73 @@ function BugBearButton({
|
|
|
12822
12930
|
message.senderType === "tester" && styles.messageTimeTester
|
|
12823
12931
|
] }, formatMessageTime(message.createdAt))
|
|
12824
12932
|
))))
|
|
12933
|
+
)), activeTab === "profile" && /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, null, profileSaved ? /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.emptyState }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.emptyEmoji }, "\u2705"), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.emptyTitle }, "Profile saved!")) : profileEditing ? (
|
|
12934
|
+
/* Edit Profile Form */
|
|
12935
|
+
/* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, null, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.profileEditHeader }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.profileEditTitle }, "Edit Profile"), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.TouchableOpacity, { onPress: handleCancelEditProfile }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.cancelText }, "Cancel"))), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.profileSection }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.label }, "Name"), /* @__PURE__ */ import_react2.default.createElement(
|
|
12936
|
+
import_react_native2.TextInput,
|
|
12937
|
+
{
|
|
12938
|
+
style: styles.profileInput,
|
|
12939
|
+
value: profileName,
|
|
12940
|
+
onChangeText: setProfileName,
|
|
12941
|
+
placeholder: "Your name",
|
|
12942
|
+
placeholderTextColor: "#9CA3AF"
|
|
12943
|
+
}
|
|
12944
|
+
)), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.profileSection }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.label }, "Primary Email"), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.profileReadOnly }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.profileReadOnlyText }, testerInfo?.email), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.profileReadOnlyHint }, "Main communication email"))), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.profileSection }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.label }, "Additional Testing Emails"), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.profileHint }, "Add other emails you use to test on different accounts"), profileAdditionalEmails.map((email) => /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { key: email, style: styles.emailChip }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.emailChipText }, email), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.TouchableOpacity, { onPress: () => handleRemoveEmail(email) }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.emailChipRemove }, "\u2715")))), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.addEmailRow }, /* @__PURE__ */ import_react2.default.createElement(
|
|
12945
|
+
import_react_native2.TextInput,
|
|
12946
|
+
{
|
|
12947
|
+
style: styles.addEmailInput,
|
|
12948
|
+
value: newEmailInput,
|
|
12949
|
+
onChangeText: setNewEmailInput,
|
|
12950
|
+
placeholder: "email@example.com",
|
|
12951
|
+
placeholderTextColor: "#9CA3AF",
|
|
12952
|
+
keyboardType: "email-address",
|
|
12953
|
+
autoCapitalize: "none"
|
|
12954
|
+
}
|
|
12955
|
+
), /* @__PURE__ */ import_react2.default.createElement(
|
|
12956
|
+
import_react_native2.TouchableOpacity,
|
|
12957
|
+
{
|
|
12958
|
+
style: [styles.addEmailButton, !newEmailInput.trim() && styles.addEmailButtonDisabled],
|
|
12959
|
+
onPress: handleAddEmail,
|
|
12960
|
+
disabled: !newEmailInput.trim()
|
|
12961
|
+
},
|
|
12962
|
+
/* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.addEmailButtonText }, "Add")
|
|
12963
|
+
))), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.profileSection }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.label }, "Testing Platforms"), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.profileHint }, "Select the platforms you can test on"), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.platformButtons }, [
|
|
12964
|
+
{ key: "ios", label: "\u{1F4F1} iOS" },
|
|
12965
|
+
{ key: "android", label: "\u{1F916} Android" },
|
|
12966
|
+
{ key: "web", label: "\u{1F310} Web" }
|
|
12967
|
+
].map(({ key, label }) => /* @__PURE__ */ import_react2.default.createElement(
|
|
12968
|
+
import_react_native2.TouchableOpacity,
|
|
12969
|
+
{
|
|
12970
|
+
key,
|
|
12971
|
+
style: [
|
|
12972
|
+
styles.platformButton,
|
|
12973
|
+
profilePlatforms.includes(key) && styles.platformButtonActive
|
|
12974
|
+
],
|
|
12975
|
+
onPress: () => handleTogglePlatform(key)
|
|
12976
|
+
},
|
|
12977
|
+
/* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: [
|
|
12978
|
+
styles.platformButtonText,
|
|
12979
|
+
profilePlatforms.includes(key) && styles.platformButtonTextActive
|
|
12980
|
+
] }, label)
|
|
12981
|
+
)))), /* @__PURE__ */ import_react2.default.createElement(
|
|
12982
|
+
import_react_native2.TouchableOpacity,
|
|
12983
|
+
{
|
|
12984
|
+
style: [styles.saveProfileButton, savingProfile && styles.saveProfileButtonDisabled],
|
|
12985
|
+
onPress: handleSaveProfile,
|
|
12986
|
+
disabled: savingProfile
|
|
12987
|
+
},
|
|
12988
|
+
/* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.saveProfileButtonText }, savingProfile ? "Saving..." : "Save Profile")
|
|
12989
|
+
))
|
|
12990
|
+
) : (
|
|
12991
|
+
/* Profile View */
|
|
12992
|
+
/* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, null, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.profileCard }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.avatarCircle }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.avatarText }, testerInfo?.name?.charAt(0)?.toUpperCase() || "?")), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.profileName }, testerInfo?.name), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.profileEmail }, testerInfo?.email), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.profileStats }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.profileStat }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.profileStatValue }, testerInfo?.assignedTests || 0), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.profileStatLabel }, "Assigned")), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.profileStatDivider }), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.profileStat }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.profileStatValue }, testerInfo?.completedTests || 0), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.profileStatLabel }, "Completed")))), (testerInfo?.additionalEmails?.length || 0) > 0 && /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.profileInfoSection }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.profileInfoLabel }, "Additional Emails"), testerInfo?.additionalEmails?.map((email) => /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { key: email, style: styles.profileInfoValue }, email))), (testerInfo?.platforms?.length || 0) > 0 && /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.profileInfoSection }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.profileInfoLabel }, "Testing Platforms"), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.platformTags }, testerInfo?.platforms?.map((platform) => /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { key: platform, style: styles.platformTag }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.platformTagText }, platform === "ios" ? "\u{1F4F1} iOS" : platform === "android" ? "\u{1F916} Android" : "\u{1F310} Web"))))), /* @__PURE__ */ import_react2.default.createElement(
|
|
12993
|
+
import_react_native2.TouchableOpacity,
|
|
12994
|
+
{
|
|
12995
|
+
style: styles.editProfileButton,
|
|
12996
|
+
onPress: handleStartEditProfile
|
|
12997
|
+
},
|
|
12998
|
+
/* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.editProfileButtonText }, "Edit Profile")
|
|
12999
|
+
))
|
|
12825
13000
|
)), activeTab === "report" && /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, null, submitted ? /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.emptyState }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.emptyEmoji }, "\u{1F389}"), /* @__PURE__ */ import_react2.default.createElement(import_react_native2.Text, { style: styles.emptyTitle }, "Report submitted!")) : /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles.reportTypes }, [
|
|
12826
13001
|
{ type: "bug", label: "\u{1F41B} Bug" },
|
|
12827
13002
|
{ type: "feedback", label: "\u{1F4A1} Feedback" },
|
|
@@ -13882,6 +14057,246 @@ var styles = import_react_native2.StyleSheet.create({
|
|
|
13882
14057
|
fontSize: 16,
|
|
13883
14058
|
fontWeight: "600",
|
|
13884
14059
|
color: "#fff"
|
|
14060
|
+
},
|
|
14061
|
+
// Profile styles
|
|
14062
|
+
profileCard: {
|
|
14063
|
+
backgroundColor: "#F9FAFB",
|
|
14064
|
+
borderRadius: 16,
|
|
14065
|
+
padding: 24,
|
|
14066
|
+
alignItems: "center",
|
|
14067
|
+
marginBottom: 16
|
|
14068
|
+
},
|
|
14069
|
+
avatarCircle: {
|
|
14070
|
+
width: 72,
|
|
14071
|
+
height: 72,
|
|
14072
|
+
borderRadius: 36,
|
|
14073
|
+
backgroundColor: "#7C3AED",
|
|
14074
|
+
justifyContent: "center",
|
|
14075
|
+
alignItems: "center",
|
|
14076
|
+
marginBottom: 12
|
|
14077
|
+
},
|
|
14078
|
+
avatarText: {
|
|
14079
|
+
fontSize: 28,
|
|
14080
|
+
fontWeight: "600",
|
|
14081
|
+
color: "#fff"
|
|
14082
|
+
},
|
|
14083
|
+
profileName: {
|
|
14084
|
+
fontSize: 20,
|
|
14085
|
+
fontWeight: "600",
|
|
14086
|
+
color: "#111827",
|
|
14087
|
+
marginBottom: 4
|
|
14088
|
+
},
|
|
14089
|
+
profileEmail: {
|
|
14090
|
+
fontSize: 14,
|
|
14091
|
+
color: "#6B7280",
|
|
14092
|
+
marginBottom: 16
|
|
14093
|
+
},
|
|
14094
|
+
profileStats: {
|
|
14095
|
+
flexDirection: "row",
|
|
14096
|
+
alignItems: "center"
|
|
14097
|
+
},
|
|
14098
|
+
profileStat: {
|
|
14099
|
+
alignItems: "center",
|
|
14100
|
+
paddingHorizontal: 20
|
|
14101
|
+
},
|
|
14102
|
+
profileStatValue: {
|
|
14103
|
+
fontSize: 24,
|
|
14104
|
+
fontWeight: "700",
|
|
14105
|
+
color: "#7C3AED"
|
|
14106
|
+
},
|
|
14107
|
+
profileStatLabel: {
|
|
14108
|
+
fontSize: 12,
|
|
14109
|
+
color: "#6B7280",
|
|
14110
|
+
marginTop: 2
|
|
14111
|
+
},
|
|
14112
|
+
profileStatDivider: {
|
|
14113
|
+
width: 1,
|
|
14114
|
+
height: 32,
|
|
14115
|
+
backgroundColor: "#E5E7EB"
|
|
14116
|
+
},
|
|
14117
|
+
profileInfoSection: {
|
|
14118
|
+
backgroundColor: "#F9FAFB",
|
|
14119
|
+
borderRadius: 12,
|
|
14120
|
+
padding: 16,
|
|
14121
|
+
marginBottom: 12
|
|
14122
|
+
},
|
|
14123
|
+
profileInfoLabel: {
|
|
14124
|
+
fontSize: 12,
|
|
14125
|
+
fontWeight: "600",
|
|
14126
|
+
color: "#6B7280",
|
|
14127
|
+
marginBottom: 8,
|
|
14128
|
+
textTransform: "uppercase",
|
|
14129
|
+
letterSpacing: 0.5
|
|
14130
|
+
},
|
|
14131
|
+
profileInfoValue: {
|
|
14132
|
+
fontSize: 14,
|
|
14133
|
+
color: "#374151",
|
|
14134
|
+
marginBottom: 4
|
|
14135
|
+
},
|
|
14136
|
+
platformTags: {
|
|
14137
|
+
flexDirection: "row",
|
|
14138
|
+
flexWrap: "wrap",
|
|
14139
|
+
gap: 8
|
|
14140
|
+
},
|
|
14141
|
+
platformTag: {
|
|
14142
|
+
backgroundColor: "#EDE9FE",
|
|
14143
|
+
paddingHorizontal: 12,
|
|
14144
|
+
paddingVertical: 6,
|
|
14145
|
+
borderRadius: 16
|
|
14146
|
+
},
|
|
14147
|
+
platformTagText: {
|
|
14148
|
+
fontSize: 13,
|
|
14149
|
+
color: "#7C3AED",
|
|
14150
|
+
fontWeight: "500"
|
|
14151
|
+
},
|
|
14152
|
+
editProfileButton: {
|
|
14153
|
+
backgroundColor: "#7C3AED",
|
|
14154
|
+
paddingVertical: 14,
|
|
14155
|
+
borderRadius: 12,
|
|
14156
|
+
alignItems: "center",
|
|
14157
|
+
marginTop: 8
|
|
14158
|
+
},
|
|
14159
|
+
editProfileButtonText: {
|
|
14160
|
+
fontSize: 16,
|
|
14161
|
+
fontWeight: "600",
|
|
14162
|
+
color: "#fff"
|
|
14163
|
+
},
|
|
14164
|
+
// Profile edit styles
|
|
14165
|
+
profileEditHeader: {
|
|
14166
|
+
flexDirection: "row",
|
|
14167
|
+
justifyContent: "space-between",
|
|
14168
|
+
alignItems: "center",
|
|
14169
|
+
marginBottom: 20
|
|
14170
|
+
},
|
|
14171
|
+
profileEditTitle: {
|
|
14172
|
+
fontSize: 20,
|
|
14173
|
+
fontWeight: "600",
|
|
14174
|
+
color: "#111827"
|
|
14175
|
+
},
|
|
14176
|
+
cancelText: {
|
|
14177
|
+
fontSize: 14,
|
|
14178
|
+
color: "#6B7280"
|
|
14179
|
+
},
|
|
14180
|
+
profileSection: {
|
|
14181
|
+
marginBottom: 20
|
|
14182
|
+
},
|
|
14183
|
+
profileInput: {
|
|
14184
|
+
backgroundColor: "#F9FAFB",
|
|
14185
|
+
borderWidth: 1,
|
|
14186
|
+
borderColor: "#E5E7EB",
|
|
14187
|
+
borderRadius: 10,
|
|
14188
|
+
paddingHorizontal: 14,
|
|
14189
|
+
paddingVertical: 12,
|
|
14190
|
+
fontSize: 15,
|
|
14191
|
+
color: "#111827"
|
|
14192
|
+
},
|
|
14193
|
+
profileReadOnly: {
|
|
14194
|
+
backgroundColor: "#F3F4F6",
|
|
14195
|
+
borderRadius: 10,
|
|
14196
|
+
padding: 14
|
|
14197
|
+
},
|
|
14198
|
+
profileReadOnlyText: {
|
|
14199
|
+
fontSize: 15,
|
|
14200
|
+
color: "#374151"
|
|
14201
|
+
},
|
|
14202
|
+
profileReadOnlyHint: {
|
|
14203
|
+
fontSize: 12,
|
|
14204
|
+
color: "#9CA3AF",
|
|
14205
|
+
marginTop: 4
|
|
14206
|
+
},
|
|
14207
|
+
profileHint: {
|
|
14208
|
+
fontSize: 13,
|
|
14209
|
+
color: "#6B7280",
|
|
14210
|
+
marginBottom: 12
|
|
14211
|
+
},
|
|
14212
|
+
emailChip: {
|
|
14213
|
+
flexDirection: "row",
|
|
14214
|
+
alignItems: "center",
|
|
14215
|
+
backgroundColor: "#EDE9FE",
|
|
14216
|
+
paddingHorizontal: 12,
|
|
14217
|
+
paddingVertical: 8,
|
|
14218
|
+
borderRadius: 20,
|
|
14219
|
+
marginBottom: 8
|
|
14220
|
+
},
|
|
14221
|
+
emailChipText: {
|
|
14222
|
+
flex: 1,
|
|
14223
|
+
fontSize: 14,
|
|
14224
|
+
color: "#5B21B6"
|
|
14225
|
+
},
|
|
14226
|
+
emailChipRemove: {
|
|
14227
|
+
fontSize: 14,
|
|
14228
|
+
color: "#8B5CF6",
|
|
14229
|
+
fontWeight: "600",
|
|
14230
|
+
marginLeft: 8
|
|
14231
|
+
},
|
|
14232
|
+
addEmailRow: {
|
|
14233
|
+
flexDirection: "row",
|
|
14234
|
+
gap: 8
|
|
14235
|
+
},
|
|
14236
|
+
addEmailInput: {
|
|
14237
|
+
flex: 1,
|
|
14238
|
+
backgroundColor: "#F9FAFB",
|
|
14239
|
+
borderWidth: 1,
|
|
14240
|
+
borderColor: "#E5E7EB",
|
|
14241
|
+
borderRadius: 10,
|
|
14242
|
+
paddingHorizontal: 14,
|
|
14243
|
+
paddingVertical: 10,
|
|
14244
|
+
fontSize: 14,
|
|
14245
|
+
color: "#111827"
|
|
14246
|
+
},
|
|
14247
|
+
addEmailButton: {
|
|
14248
|
+
backgroundColor: "#7C3AED",
|
|
14249
|
+
paddingHorizontal: 16,
|
|
14250
|
+
borderRadius: 10,
|
|
14251
|
+
justifyContent: "center"
|
|
14252
|
+
},
|
|
14253
|
+
addEmailButtonDisabled: {
|
|
14254
|
+
backgroundColor: "#C4B5FD"
|
|
14255
|
+
},
|
|
14256
|
+
addEmailButtonText: {
|
|
14257
|
+
fontSize: 14,
|
|
14258
|
+
fontWeight: "600",
|
|
14259
|
+
color: "#fff"
|
|
14260
|
+
},
|
|
14261
|
+
platformButtons: {
|
|
14262
|
+
flexDirection: "row",
|
|
14263
|
+
gap: 8
|
|
14264
|
+
},
|
|
14265
|
+
platformButton: {
|
|
14266
|
+
flex: 1,
|
|
14267
|
+
backgroundColor: "#F3F4F6",
|
|
14268
|
+
paddingVertical: 12,
|
|
14269
|
+
borderRadius: 10,
|
|
14270
|
+
alignItems: "center",
|
|
14271
|
+
borderWidth: 2,
|
|
14272
|
+
borderColor: "transparent"
|
|
14273
|
+
},
|
|
14274
|
+
platformButtonActive: {
|
|
14275
|
+
backgroundColor: "#EDE9FE",
|
|
14276
|
+
borderColor: "#7C3AED"
|
|
14277
|
+
},
|
|
14278
|
+
platformButtonText: {
|
|
14279
|
+
fontSize: 13,
|
|
14280
|
+
color: "#6B7280",
|
|
14281
|
+
fontWeight: "500"
|
|
14282
|
+
},
|
|
14283
|
+
platformButtonTextActive: {
|
|
14284
|
+
color: "#7C3AED"
|
|
14285
|
+
},
|
|
14286
|
+
saveProfileButton: {
|
|
14287
|
+
backgroundColor: "#16A34A",
|
|
14288
|
+
paddingVertical: 14,
|
|
14289
|
+
borderRadius: 12,
|
|
14290
|
+
alignItems: "center",
|
|
14291
|
+
marginTop: 8
|
|
14292
|
+
},
|
|
14293
|
+
saveProfileButtonDisabled: {
|
|
14294
|
+
opacity: 0.6
|
|
14295
|
+
},
|
|
14296
|
+
saveProfileButtonText: {
|
|
14297
|
+
fontSize: 16,
|
|
14298
|
+
fontWeight: "600",
|
|
14299
|
+
color: "#fff"
|
|
13885
14300
|
}
|
|
13886
14301
|
});
|
|
13887
14302
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -11528,6 +11528,9 @@ var BugBearClient = class {
|
|
|
11528
11528
|
id: data.id,
|
|
11529
11529
|
name: data.name,
|
|
11530
11530
|
email: data.email,
|
|
11531
|
+
additionalEmails: data.additional_emails || [],
|
|
11532
|
+
avatarUrl: data.avatar_url || void 0,
|
|
11533
|
+
platforms: data.platforms || [],
|
|
11531
11534
|
assignedTests: data.assigned_count || 0,
|
|
11532
11535
|
completedTests: data.completed_count || 0
|
|
11533
11536
|
};
|
|
@@ -11536,6 +11539,32 @@ var BugBearClient = class {
|
|
|
11536
11539
|
return null;
|
|
11537
11540
|
}
|
|
11538
11541
|
}
|
|
11542
|
+
/**
|
|
11543
|
+
* Update tester profile
|
|
11544
|
+
* Allows testers to update their name, additional emails, avatar, and platforms
|
|
11545
|
+
*/
|
|
11546
|
+
async updateTesterProfile(updates) {
|
|
11547
|
+
try {
|
|
11548
|
+
const userInfo = await this.getCurrentUserInfo();
|
|
11549
|
+
if (!userInfo) {
|
|
11550
|
+
return { success: false, error: "Not authenticated" };
|
|
11551
|
+
}
|
|
11552
|
+
const updateData = {};
|
|
11553
|
+
if (updates.name !== void 0) updateData.name = updates.name;
|
|
11554
|
+
if (updates.additionalEmails !== void 0) updateData.additional_emails = updates.additionalEmails;
|
|
11555
|
+
if (updates.avatarUrl !== void 0) updateData.avatar_url = updates.avatarUrl;
|
|
11556
|
+
if (updates.platforms !== void 0) updateData.platforms = updates.platforms;
|
|
11557
|
+
const { error } = await this.supabase.from("testers").update(updateData).eq("project_id", this.config.projectId).eq("email", userInfo.email);
|
|
11558
|
+
if (error) {
|
|
11559
|
+
console.error("BugBear: updateTesterProfile error", error);
|
|
11560
|
+
return { success: false, error: error.message };
|
|
11561
|
+
}
|
|
11562
|
+
return { success: true };
|
|
11563
|
+
} catch (err) {
|
|
11564
|
+
console.error("BugBear: updateTesterProfile error", err);
|
|
11565
|
+
return { success: false, error: "Failed to update profile" };
|
|
11566
|
+
}
|
|
11567
|
+
}
|
|
11539
11568
|
/**
|
|
11540
11569
|
* Check if current user is a tester for this project
|
|
11541
11570
|
*/
|
|
@@ -12082,6 +12111,9 @@ var BugBearContext = createContext({
|
|
|
12082
12111
|
},
|
|
12083
12112
|
createThread: async () => ({ success: false }),
|
|
12084
12113
|
refreshTesterStatus: async () => {
|
|
12114
|
+
},
|
|
12115
|
+
updateTesterProfile: async () => ({ success: false }),
|
|
12116
|
+
refreshTesterInfo: async () => {
|
|
12085
12117
|
}
|
|
12086
12118
|
});
|
|
12087
12119
|
function useBugBear() {
|
|
@@ -12143,6 +12175,20 @@ function BugBearProvider({ config, children, appVersion, enabled = true }) {
|
|
|
12143
12175
|
}
|
|
12144
12176
|
return result;
|
|
12145
12177
|
}, [client, refreshThreads]);
|
|
12178
|
+
const updateTesterProfile = useCallback(async (updates) => {
|
|
12179
|
+
if (!client) return { success: false, error: "Client not initialized" };
|
|
12180
|
+
const result = await client.updateTesterProfile(updates);
|
|
12181
|
+
if (result.success) {
|
|
12182
|
+
const info = await client.getTesterInfo();
|
|
12183
|
+
setTesterInfo(info);
|
|
12184
|
+
}
|
|
12185
|
+
return result;
|
|
12186
|
+
}, [client]);
|
|
12187
|
+
const refreshTesterInfo = useCallback(async () => {
|
|
12188
|
+
if (!client) return;
|
|
12189
|
+
const info = await client.getTesterInfo();
|
|
12190
|
+
setTesterInfo(info);
|
|
12191
|
+
}, [client]);
|
|
12146
12192
|
const initializeBugBear = useCallback(async (bugBearClient) => {
|
|
12147
12193
|
setIsLoading(true);
|
|
12148
12194
|
try {
|
|
@@ -12209,7 +12255,9 @@ function BugBearProvider({ config, children, appVersion, enabled = true }) {
|
|
|
12209
12255
|
sendMessage,
|
|
12210
12256
|
markAsRead,
|
|
12211
12257
|
createThread,
|
|
12212
|
-
refreshTesterStatus
|
|
12258
|
+
refreshTesterStatus,
|
|
12259
|
+
updateTesterProfile,
|
|
12260
|
+
refreshTesterInfo
|
|
12213
12261
|
}
|
|
12214
12262
|
},
|
|
12215
12263
|
children
|
|
@@ -12265,7 +12313,9 @@ function BugBearButton({
|
|
|
12265
12313
|
getThreadMessages,
|
|
12266
12314
|
sendMessage,
|
|
12267
12315
|
markAsRead,
|
|
12268
|
-
createThread
|
|
12316
|
+
createThread,
|
|
12317
|
+
updateTesterProfile,
|
|
12318
|
+
refreshTesterInfo
|
|
12269
12319
|
} = useBugBear();
|
|
12270
12320
|
const [modalVisible, setModalVisible] = useState2(false);
|
|
12271
12321
|
const [activeTab, setActiveTab] = useState2("tests");
|
|
@@ -12279,6 +12329,13 @@ function BugBearButton({
|
|
|
12279
12329
|
const [composeSubject, setComposeSubject] = useState2("");
|
|
12280
12330
|
const [composeMessage, setComposeMessage] = useState2("");
|
|
12281
12331
|
const [sendingNewMessage, setSendingNewMessage] = useState2(false);
|
|
12332
|
+
const [profileEditing, setProfileEditing] = useState2(false);
|
|
12333
|
+
const [profileName, setProfileName] = useState2("");
|
|
12334
|
+
const [profileAdditionalEmails, setProfileAdditionalEmails] = useState2([]);
|
|
12335
|
+
const [newEmailInput, setNewEmailInput] = useState2("");
|
|
12336
|
+
const [profilePlatforms, setProfilePlatforms] = useState2([]);
|
|
12337
|
+
const [savingProfile, setSavingProfile] = useState2(false);
|
|
12338
|
+
const [profileSaved, setProfileSaved] = useState2(false);
|
|
12282
12339
|
const getInitialPosition = () => {
|
|
12283
12340
|
const buttonSize = 56;
|
|
12284
12341
|
const margin = 16;
|
|
@@ -12463,6 +12520,50 @@ function BugBearButton({
|
|
|
12463
12520
|
}
|
|
12464
12521
|
setSendingNewMessage(false);
|
|
12465
12522
|
};
|
|
12523
|
+
const handleStartEditProfile = () => {
|
|
12524
|
+
if (testerInfo) {
|
|
12525
|
+
setProfileName(testerInfo.name);
|
|
12526
|
+
setProfileAdditionalEmails(testerInfo.additionalEmails || []);
|
|
12527
|
+
setProfilePlatforms(testerInfo.platforms || []);
|
|
12528
|
+
}
|
|
12529
|
+
setProfileEditing(true);
|
|
12530
|
+
};
|
|
12531
|
+
const handleCancelEditProfile = () => {
|
|
12532
|
+
setProfileEditing(false);
|
|
12533
|
+
setNewEmailInput("");
|
|
12534
|
+
};
|
|
12535
|
+
const handleAddEmail = () => {
|
|
12536
|
+
const email = newEmailInput.trim().toLowerCase();
|
|
12537
|
+
if (email && email.includes("@") && !profileAdditionalEmails.includes(email)) {
|
|
12538
|
+
setProfileAdditionalEmails([...profileAdditionalEmails, email]);
|
|
12539
|
+
setNewEmailInput("");
|
|
12540
|
+
}
|
|
12541
|
+
};
|
|
12542
|
+
const handleRemoveEmail = (email) => {
|
|
12543
|
+
setProfileAdditionalEmails(profileAdditionalEmails.filter((e) => e !== email));
|
|
12544
|
+
};
|
|
12545
|
+
const handleTogglePlatform = (platform) => {
|
|
12546
|
+
if (profilePlatforms.includes(platform)) {
|
|
12547
|
+
setProfilePlatforms(profilePlatforms.filter((p) => p !== platform));
|
|
12548
|
+
} else {
|
|
12549
|
+
setProfilePlatforms([...profilePlatforms, platform]);
|
|
12550
|
+
}
|
|
12551
|
+
};
|
|
12552
|
+
const handleSaveProfile = async () => {
|
|
12553
|
+
setSavingProfile(true);
|
|
12554
|
+
const updates = {
|
|
12555
|
+
name: profileName.trim(),
|
|
12556
|
+
additionalEmails: profileAdditionalEmails,
|
|
12557
|
+
platforms: profilePlatforms
|
|
12558
|
+
};
|
|
12559
|
+
const result = await updateTesterProfile(updates);
|
|
12560
|
+
if (result.success) {
|
|
12561
|
+
setProfileEditing(false);
|
|
12562
|
+
setProfileSaved(true);
|
|
12563
|
+
setTimeout(() => setProfileSaved(false), 2e3);
|
|
12564
|
+
}
|
|
12565
|
+
setSavingProfile(false);
|
|
12566
|
+
};
|
|
12466
12567
|
const formatRelativeTime = (dateString) => {
|
|
12467
12568
|
const date = new Date(dateString);
|
|
12468
12569
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -12646,6 +12747,13 @@ function BugBearButton({
|
|
|
12646
12747
|
onPress: () => setActiveTab("messages")
|
|
12647
12748
|
},
|
|
12648
12749
|
/* @__PURE__ */ React2.createElement(View, { style: styles.tabWithBadge }, /* @__PURE__ */ React2.createElement(Text, { style: [styles.tabText, activeTab === "messages" && styles.activeTabText] }, "Messages"), unreadCount > 0 && /* @__PURE__ */ React2.createElement(View, { style: styles.tabBadge }, /* @__PURE__ */ React2.createElement(Text, { style: styles.tabBadgeText }, unreadCount)))
|
|
12750
|
+
), /* @__PURE__ */ React2.createElement(
|
|
12751
|
+
TouchableOpacity,
|
|
12752
|
+
{
|
|
12753
|
+
style: [styles.tab, activeTab === "profile" && styles.activeTab],
|
|
12754
|
+
onPress: () => setActiveTab("profile")
|
|
12755
|
+
},
|
|
12756
|
+
/* @__PURE__ */ React2.createElement(Text, { style: [styles.tabText, activeTab === "profile" && styles.activeTabText] }, "Profile")
|
|
12649
12757
|
), /* @__PURE__ */ React2.createElement(
|
|
12650
12758
|
TouchableOpacity,
|
|
12651
12759
|
{
|
|
@@ -12797,6 +12905,73 @@ function BugBearButton({
|
|
|
12797
12905
|
message.senderType === "tester" && styles.messageTimeTester
|
|
12798
12906
|
] }, formatMessageTime(message.createdAt))
|
|
12799
12907
|
))))
|
|
12908
|
+
)), activeTab === "profile" && /* @__PURE__ */ React2.createElement(View, null, profileSaved ? /* @__PURE__ */ React2.createElement(View, { style: styles.emptyState }, /* @__PURE__ */ React2.createElement(Text, { style: styles.emptyEmoji }, "\u2705"), /* @__PURE__ */ React2.createElement(Text, { style: styles.emptyTitle }, "Profile saved!")) : profileEditing ? (
|
|
12909
|
+
/* Edit Profile Form */
|
|
12910
|
+
/* @__PURE__ */ React2.createElement(View, null, /* @__PURE__ */ React2.createElement(View, { style: styles.profileEditHeader }, /* @__PURE__ */ React2.createElement(Text, { style: styles.profileEditTitle }, "Edit Profile"), /* @__PURE__ */ React2.createElement(TouchableOpacity, { onPress: handleCancelEditProfile }, /* @__PURE__ */ React2.createElement(Text, { style: styles.cancelText }, "Cancel"))), /* @__PURE__ */ React2.createElement(View, { style: styles.profileSection }, /* @__PURE__ */ React2.createElement(Text, { style: styles.label }, "Name"), /* @__PURE__ */ React2.createElement(
|
|
12911
|
+
TextInput,
|
|
12912
|
+
{
|
|
12913
|
+
style: styles.profileInput,
|
|
12914
|
+
value: profileName,
|
|
12915
|
+
onChangeText: setProfileName,
|
|
12916
|
+
placeholder: "Your name",
|
|
12917
|
+
placeholderTextColor: "#9CA3AF"
|
|
12918
|
+
}
|
|
12919
|
+
)), /* @__PURE__ */ React2.createElement(View, { style: styles.profileSection }, /* @__PURE__ */ React2.createElement(Text, { style: styles.label }, "Primary Email"), /* @__PURE__ */ React2.createElement(View, { style: styles.profileReadOnly }, /* @__PURE__ */ React2.createElement(Text, { style: styles.profileReadOnlyText }, testerInfo?.email), /* @__PURE__ */ React2.createElement(Text, { style: styles.profileReadOnlyHint }, "Main communication email"))), /* @__PURE__ */ React2.createElement(View, { style: styles.profileSection }, /* @__PURE__ */ React2.createElement(Text, { style: styles.label }, "Additional Testing Emails"), /* @__PURE__ */ React2.createElement(Text, { style: styles.profileHint }, "Add other emails you use to test on different accounts"), profileAdditionalEmails.map((email) => /* @__PURE__ */ React2.createElement(View, { key: email, style: styles.emailChip }, /* @__PURE__ */ React2.createElement(Text, { style: styles.emailChipText }, email), /* @__PURE__ */ React2.createElement(TouchableOpacity, { onPress: () => handleRemoveEmail(email) }, /* @__PURE__ */ React2.createElement(Text, { style: styles.emailChipRemove }, "\u2715")))), /* @__PURE__ */ React2.createElement(View, { style: styles.addEmailRow }, /* @__PURE__ */ React2.createElement(
|
|
12920
|
+
TextInput,
|
|
12921
|
+
{
|
|
12922
|
+
style: styles.addEmailInput,
|
|
12923
|
+
value: newEmailInput,
|
|
12924
|
+
onChangeText: setNewEmailInput,
|
|
12925
|
+
placeholder: "email@example.com",
|
|
12926
|
+
placeholderTextColor: "#9CA3AF",
|
|
12927
|
+
keyboardType: "email-address",
|
|
12928
|
+
autoCapitalize: "none"
|
|
12929
|
+
}
|
|
12930
|
+
), /* @__PURE__ */ React2.createElement(
|
|
12931
|
+
TouchableOpacity,
|
|
12932
|
+
{
|
|
12933
|
+
style: [styles.addEmailButton, !newEmailInput.trim() && styles.addEmailButtonDisabled],
|
|
12934
|
+
onPress: handleAddEmail,
|
|
12935
|
+
disabled: !newEmailInput.trim()
|
|
12936
|
+
},
|
|
12937
|
+
/* @__PURE__ */ React2.createElement(Text, { style: styles.addEmailButtonText }, "Add")
|
|
12938
|
+
))), /* @__PURE__ */ React2.createElement(View, { style: styles.profileSection }, /* @__PURE__ */ React2.createElement(Text, { style: styles.label }, "Testing Platforms"), /* @__PURE__ */ React2.createElement(Text, { style: styles.profileHint }, "Select the platforms you can test on"), /* @__PURE__ */ React2.createElement(View, { style: styles.platformButtons }, [
|
|
12939
|
+
{ key: "ios", label: "\u{1F4F1} iOS" },
|
|
12940
|
+
{ key: "android", label: "\u{1F916} Android" },
|
|
12941
|
+
{ key: "web", label: "\u{1F310} Web" }
|
|
12942
|
+
].map(({ key, label }) => /* @__PURE__ */ React2.createElement(
|
|
12943
|
+
TouchableOpacity,
|
|
12944
|
+
{
|
|
12945
|
+
key,
|
|
12946
|
+
style: [
|
|
12947
|
+
styles.platformButton,
|
|
12948
|
+
profilePlatforms.includes(key) && styles.platformButtonActive
|
|
12949
|
+
],
|
|
12950
|
+
onPress: () => handleTogglePlatform(key)
|
|
12951
|
+
},
|
|
12952
|
+
/* @__PURE__ */ React2.createElement(Text, { style: [
|
|
12953
|
+
styles.platformButtonText,
|
|
12954
|
+
profilePlatforms.includes(key) && styles.platformButtonTextActive
|
|
12955
|
+
] }, label)
|
|
12956
|
+
)))), /* @__PURE__ */ React2.createElement(
|
|
12957
|
+
TouchableOpacity,
|
|
12958
|
+
{
|
|
12959
|
+
style: [styles.saveProfileButton, savingProfile && styles.saveProfileButtonDisabled],
|
|
12960
|
+
onPress: handleSaveProfile,
|
|
12961
|
+
disabled: savingProfile
|
|
12962
|
+
},
|
|
12963
|
+
/* @__PURE__ */ React2.createElement(Text, { style: styles.saveProfileButtonText }, savingProfile ? "Saving..." : "Save Profile")
|
|
12964
|
+
))
|
|
12965
|
+
) : (
|
|
12966
|
+
/* Profile View */
|
|
12967
|
+
/* @__PURE__ */ React2.createElement(View, null, /* @__PURE__ */ React2.createElement(View, { style: styles.profileCard }, /* @__PURE__ */ React2.createElement(View, { style: styles.avatarCircle }, /* @__PURE__ */ React2.createElement(Text, { style: styles.avatarText }, testerInfo?.name?.charAt(0)?.toUpperCase() || "?")), /* @__PURE__ */ React2.createElement(Text, { style: styles.profileName }, testerInfo?.name), /* @__PURE__ */ React2.createElement(Text, { style: styles.profileEmail }, testerInfo?.email), /* @__PURE__ */ React2.createElement(View, { style: styles.profileStats }, /* @__PURE__ */ React2.createElement(View, { style: styles.profileStat }, /* @__PURE__ */ React2.createElement(Text, { style: styles.profileStatValue }, testerInfo?.assignedTests || 0), /* @__PURE__ */ React2.createElement(Text, { style: styles.profileStatLabel }, "Assigned")), /* @__PURE__ */ React2.createElement(View, { style: styles.profileStatDivider }), /* @__PURE__ */ React2.createElement(View, { style: styles.profileStat }, /* @__PURE__ */ React2.createElement(Text, { style: styles.profileStatValue }, testerInfo?.completedTests || 0), /* @__PURE__ */ React2.createElement(Text, { style: styles.profileStatLabel }, "Completed")))), (testerInfo?.additionalEmails?.length || 0) > 0 && /* @__PURE__ */ React2.createElement(View, { style: styles.profileInfoSection }, /* @__PURE__ */ React2.createElement(Text, { style: styles.profileInfoLabel }, "Additional Emails"), testerInfo?.additionalEmails?.map((email) => /* @__PURE__ */ React2.createElement(Text, { key: email, style: styles.profileInfoValue }, email))), (testerInfo?.platforms?.length || 0) > 0 && /* @__PURE__ */ React2.createElement(View, { style: styles.profileInfoSection }, /* @__PURE__ */ React2.createElement(Text, { style: styles.profileInfoLabel }, "Testing Platforms"), /* @__PURE__ */ React2.createElement(View, { style: styles.platformTags }, testerInfo?.platforms?.map((platform) => /* @__PURE__ */ React2.createElement(View, { key: platform, style: styles.platformTag }, /* @__PURE__ */ React2.createElement(Text, { style: styles.platformTagText }, platform === "ios" ? "\u{1F4F1} iOS" : platform === "android" ? "\u{1F916} Android" : "\u{1F310} Web"))))), /* @__PURE__ */ React2.createElement(
|
|
12968
|
+
TouchableOpacity,
|
|
12969
|
+
{
|
|
12970
|
+
style: styles.editProfileButton,
|
|
12971
|
+
onPress: handleStartEditProfile
|
|
12972
|
+
},
|
|
12973
|
+
/* @__PURE__ */ React2.createElement(Text, { style: styles.editProfileButtonText }, "Edit Profile")
|
|
12974
|
+
))
|
|
12800
12975
|
)), activeTab === "report" && /* @__PURE__ */ React2.createElement(View, null, submitted ? /* @__PURE__ */ React2.createElement(View, { style: styles.emptyState }, /* @__PURE__ */ React2.createElement(Text, { style: styles.emptyEmoji }, "\u{1F389}"), /* @__PURE__ */ React2.createElement(Text, { style: styles.emptyTitle }, "Report submitted!")) : /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(View, { style: styles.reportTypes }, [
|
|
12801
12976
|
{ type: "bug", label: "\u{1F41B} Bug" },
|
|
12802
12977
|
{ type: "feedback", label: "\u{1F4A1} Feedback" },
|
|
@@ -13857,6 +14032,246 @@ var styles = StyleSheet.create({
|
|
|
13857
14032
|
fontSize: 16,
|
|
13858
14033
|
fontWeight: "600",
|
|
13859
14034
|
color: "#fff"
|
|
14035
|
+
},
|
|
14036
|
+
// Profile styles
|
|
14037
|
+
profileCard: {
|
|
14038
|
+
backgroundColor: "#F9FAFB",
|
|
14039
|
+
borderRadius: 16,
|
|
14040
|
+
padding: 24,
|
|
14041
|
+
alignItems: "center",
|
|
14042
|
+
marginBottom: 16
|
|
14043
|
+
},
|
|
14044
|
+
avatarCircle: {
|
|
14045
|
+
width: 72,
|
|
14046
|
+
height: 72,
|
|
14047
|
+
borderRadius: 36,
|
|
14048
|
+
backgroundColor: "#7C3AED",
|
|
14049
|
+
justifyContent: "center",
|
|
14050
|
+
alignItems: "center",
|
|
14051
|
+
marginBottom: 12
|
|
14052
|
+
},
|
|
14053
|
+
avatarText: {
|
|
14054
|
+
fontSize: 28,
|
|
14055
|
+
fontWeight: "600",
|
|
14056
|
+
color: "#fff"
|
|
14057
|
+
},
|
|
14058
|
+
profileName: {
|
|
14059
|
+
fontSize: 20,
|
|
14060
|
+
fontWeight: "600",
|
|
14061
|
+
color: "#111827",
|
|
14062
|
+
marginBottom: 4
|
|
14063
|
+
},
|
|
14064
|
+
profileEmail: {
|
|
14065
|
+
fontSize: 14,
|
|
14066
|
+
color: "#6B7280",
|
|
14067
|
+
marginBottom: 16
|
|
14068
|
+
},
|
|
14069
|
+
profileStats: {
|
|
14070
|
+
flexDirection: "row",
|
|
14071
|
+
alignItems: "center"
|
|
14072
|
+
},
|
|
14073
|
+
profileStat: {
|
|
14074
|
+
alignItems: "center",
|
|
14075
|
+
paddingHorizontal: 20
|
|
14076
|
+
},
|
|
14077
|
+
profileStatValue: {
|
|
14078
|
+
fontSize: 24,
|
|
14079
|
+
fontWeight: "700",
|
|
14080
|
+
color: "#7C3AED"
|
|
14081
|
+
},
|
|
14082
|
+
profileStatLabel: {
|
|
14083
|
+
fontSize: 12,
|
|
14084
|
+
color: "#6B7280",
|
|
14085
|
+
marginTop: 2
|
|
14086
|
+
},
|
|
14087
|
+
profileStatDivider: {
|
|
14088
|
+
width: 1,
|
|
14089
|
+
height: 32,
|
|
14090
|
+
backgroundColor: "#E5E7EB"
|
|
14091
|
+
},
|
|
14092
|
+
profileInfoSection: {
|
|
14093
|
+
backgroundColor: "#F9FAFB",
|
|
14094
|
+
borderRadius: 12,
|
|
14095
|
+
padding: 16,
|
|
14096
|
+
marginBottom: 12
|
|
14097
|
+
},
|
|
14098
|
+
profileInfoLabel: {
|
|
14099
|
+
fontSize: 12,
|
|
14100
|
+
fontWeight: "600",
|
|
14101
|
+
color: "#6B7280",
|
|
14102
|
+
marginBottom: 8,
|
|
14103
|
+
textTransform: "uppercase",
|
|
14104
|
+
letterSpacing: 0.5
|
|
14105
|
+
},
|
|
14106
|
+
profileInfoValue: {
|
|
14107
|
+
fontSize: 14,
|
|
14108
|
+
color: "#374151",
|
|
14109
|
+
marginBottom: 4
|
|
14110
|
+
},
|
|
14111
|
+
platformTags: {
|
|
14112
|
+
flexDirection: "row",
|
|
14113
|
+
flexWrap: "wrap",
|
|
14114
|
+
gap: 8
|
|
14115
|
+
},
|
|
14116
|
+
platformTag: {
|
|
14117
|
+
backgroundColor: "#EDE9FE",
|
|
14118
|
+
paddingHorizontal: 12,
|
|
14119
|
+
paddingVertical: 6,
|
|
14120
|
+
borderRadius: 16
|
|
14121
|
+
},
|
|
14122
|
+
platformTagText: {
|
|
14123
|
+
fontSize: 13,
|
|
14124
|
+
color: "#7C3AED",
|
|
14125
|
+
fontWeight: "500"
|
|
14126
|
+
},
|
|
14127
|
+
editProfileButton: {
|
|
14128
|
+
backgroundColor: "#7C3AED",
|
|
14129
|
+
paddingVertical: 14,
|
|
14130
|
+
borderRadius: 12,
|
|
14131
|
+
alignItems: "center",
|
|
14132
|
+
marginTop: 8
|
|
14133
|
+
},
|
|
14134
|
+
editProfileButtonText: {
|
|
14135
|
+
fontSize: 16,
|
|
14136
|
+
fontWeight: "600",
|
|
14137
|
+
color: "#fff"
|
|
14138
|
+
},
|
|
14139
|
+
// Profile edit styles
|
|
14140
|
+
profileEditHeader: {
|
|
14141
|
+
flexDirection: "row",
|
|
14142
|
+
justifyContent: "space-between",
|
|
14143
|
+
alignItems: "center",
|
|
14144
|
+
marginBottom: 20
|
|
14145
|
+
},
|
|
14146
|
+
profileEditTitle: {
|
|
14147
|
+
fontSize: 20,
|
|
14148
|
+
fontWeight: "600",
|
|
14149
|
+
color: "#111827"
|
|
14150
|
+
},
|
|
14151
|
+
cancelText: {
|
|
14152
|
+
fontSize: 14,
|
|
14153
|
+
color: "#6B7280"
|
|
14154
|
+
},
|
|
14155
|
+
profileSection: {
|
|
14156
|
+
marginBottom: 20
|
|
14157
|
+
},
|
|
14158
|
+
profileInput: {
|
|
14159
|
+
backgroundColor: "#F9FAFB",
|
|
14160
|
+
borderWidth: 1,
|
|
14161
|
+
borderColor: "#E5E7EB",
|
|
14162
|
+
borderRadius: 10,
|
|
14163
|
+
paddingHorizontal: 14,
|
|
14164
|
+
paddingVertical: 12,
|
|
14165
|
+
fontSize: 15,
|
|
14166
|
+
color: "#111827"
|
|
14167
|
+
},
|
|
14168
|
+
profileReadOnly: {
|
|
14169
|
+
backgroundColor: "#F3F4F6",
|
|
14170
|
+
borderRadius: 10,
|
|
14171
|
+
padding: 14
|
|
14172
|
+
},
|
|
14173
|
+
profileReadOnlyText: {
|
|
14174
|
+
fontSize: 15,
|
|
14175
|
+
color: "#374151"
|
|
14176
|
+
},
|
|
14177
|
+
profileReadOnlyHint: {
|
|
14178
|
+
fontSize: 12,
|
|
14179
|
+
color: "#9CA3AF",
|
|
14180
|
+
marginTop: 4
|
|
14181
|
+
},
|
|
14182
|
+
profileHint: {
|
|
14183
|
+
fontSize: 13,
|
|
14184
|
+
color: "#6B7280",
|
|
14185
|
+
marginBottom: 12
|
|
14186
|
+
},
|
|
14187
|
+
emailChip: {
|
|
14188
|
+
flexDirection: "row",
|
|
14189
|
+
alignItems: "center",
|
|
14190
|
+
backgroundColor: "#EDE9FE",
|
|
14191
|
+
paddingHorizontal: 12,
|
|
14192
|
+
paddingVertical: 8,
|
|
14193
|
+
borderRadius: 20,
|
|
14194
|
+
marginBottom: 8
|
|
14195
|
+
},
|
|
14196
|
+
emailChipText: {
|
|
14197
|
+
flex: 1,
|
|
14198
|
+
fontSize: 14,
|
|
14199
|
+
color: "#5B21B6"
|
|
14200
|
+
},
|
|
14201
|
+
emailChipRemove: {
|
|
14202
|
+
fontSize: 14,
|
|
14203
|
+
color: "#8B5CF6",
|
|
14204
|
+
fontWeight: "600",
|
|
14205
|
+
marginLeft: 8
|
|
14206
|
+
},
|
|
14207
|
+
addEmailRow: {
|
|
14208
|
+
flexDirection: "row",
|
|
14209
|
+
gap: 8
|
|
14210
|
+
},
|
|
14211
|
+
addEmailInput: {
|
|
14212
|
+
flex: 1,
|
|
14213
|
+
backgroundColor: "#F9FAFB",
|
|
14214
|
+
borderWidth: 1,
|
|
14215
|
+
borderColor: "#E5E7EB",
|
|
14216
|
+
borderRadius: 10,
|
|
14217
|
+
paddingHorizontal: 14,
|
|
14218
|
+
paddingVertical: 10,
|
|
14219
|
+
fontSize: 14,
|
|
14220
|
+
color: "#111827"
|
|
14221
|
+
},
|
|
14222
|
+
addEmailButton: {
|
|
14223
|
+
backgroundColor: "#7C3AED",
|
|
14224
|
+
paddingHorizontal: 16,
|
|
14225
|
+
borderRadius: 10,
|
|
14226
|
+
justifyContent: "center"
|
|
14227
|
+
},
|
|
14228
|
+
addEmailButtonDisabled: {
|
|
14229
|
+
backgroundColor: "#C4B5FD"
|
|
14230
|
+
},
|
|
14231
|
+
addEmailButtonText: {
|
|
14232
|
+
fontSize: 14,
|
|
14233
|
+
fontWeight: "600",
|
|
14234
|
+
color: "#fff"
|
|
14235
|
+
},
|
|
14236
|
+
platformButtons: {
|
|
14237
|
+
flexDirection: "row",
|
|
14238
|
+
gap: 8
|
|
14239
|
+
},
|
|
14240
|
+
platformButton: {
|
|
14241
|
+
flex: 1,
|
|
14242
|
+
backgroundColor: "#F3F4F6",
|
|
14243
|
+
paddingVertical: 12,
|
|
14244
|
+
borderRadius: 10,
|
|
14245
|
+
alignItems: "center",
|
|
14246
|
+
borderWidth: 2,
|
|
14247
|
+
borderColor: "transparent"
|
|
14248
|
+
},
|
|
14249
|
+
platformButtonActive: {
|
|
14250
|
+
backgroundColor: "#EDE9FE",
|
|
14251
|
+
borderColor: "#7C3AED"
|
|
14252
|
+
},
|
|
14253
|
+
platformButtonText: {
|
|
14254
|
+
fontSize: 13,
|
|
14255
|
+
color: "#6B7280",
|
|
14256
|
+
fontWeight: "500"
|
|
14257
|
+
},
|
|
14258
|
+
platformButtonTextActive: {
|
|
14259
|
+
color: "#7C3AED"
|
|
14260
|
+
},
|
|
14261
|
+
saveProfileButton: {
|
|
14262
|
+
backgroundColor: "#16A34A",
|
|
14263
|
+
paddingVertical: 14,
|
|
14264
|
+
borderRadius: 12,
|
|
14265
|
+
alignItems: "center",
|
|
14266
|
+
marginTop: 8
|
|
14267
|
+
},
|
|
14268
|
+
saveProfileButtonDisabled: {
|
|
14269
|
+
opacity: 0.6
|
|
14270
|
+
},
|
|
14271
|
+
saveProfileButtonText: {
|
|
14272
|
+
fontSize: 16,
|
|
14273
|
+
fontWeight: "600",
|
|
14274
|
+
color: "#fff"
|
|
13860
14275
|
}
|
|
13861
14276
|
});
|
|
13862
14277
|
export {
|