@upstep/react-native 0.6.3 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/FeedbackSheet.tsx +40 -3
- package/src/api.ts +2 -1
package/package.json
CHANGED
package/src/FeedbackSheet.tsx
CHANGED
|
@@ -271,7 +271,9 @@ function FeedCard({
|
|
|
271
271
|
)}
|
|
272
272
|
<View style={styles.cardMeta}>
|
|
273
273
|
<TypeBadge type={item.type} p={p} />
|
|
274
|
-
|
|
274
|
+
{item.status === "PENDING"
|
|
275
|
+
? <PendingBadge />
|
|
276
|
+
: <StatusDot status={item.status} />}
|
|
275
277
|
<Text style={[styles.cardDate, { color: p.textFaint }]}>{fmtDate(item.createdAt)}</Text>
|
|
276
278
|
</View>
|
|
277
279
|
</View>
|
|
@@ -329,7 +331,9 @@ function FeedDetailBody({
|
|
|
329
331
|
)}
|
|
330
332
|
<View style={styles.badgeRow}>
|
|
331
333
|
<TypeBadge type={item.type} p={p} />
|
|
332
|
-
|
|
334
|
+
{item.status === "PENDING"
|
|
335
|
+
? <PendingBadge />
|
|
336
|
+
: <StatusBadge status={item.status} p={p} />}
|
|
333
337
|
</View>
|
|
334
338
|
|
|
335
339
|
<Text style={[styles.detailContent, { color: p.textSoft }]}>{item.content}</Text>
|
|
@@ -377,7 +381,7 @@ function CommentBubble({ comment, p, accent }: { comment: Comment; p: Palette; a
|
|
|
377
381
|
<View style={styles.commentMeta}>
|
|
378
382
|
<View style={[styles.ownerBadge, { backgroundColor: accent + "20" }]}>
|
|
379
383
|
<Text style={[styles.ownerBadgeText, { color: accent }]}>
|
|
380
|
-
|
|
384
|
+
Developer
|
|
381
385
|
</Text>
|
|
382
386
|
</View>
|
|
383
387
|
<Text style={[styles.commentDate, { color: p.textFaint }]}>{fmtDate(comment.createdAt)}</Text>
|
|
@@ -517,6 +521,15 @@ const TYPE_FG: Record<FeedbackType, string> = {
|
|
|
517
521
|
BUG: "#d6453d", FEATURE: "#3b76d6", GENERAL: "",
|
|
518
522
|
};
|
|
519
523
|
|
|
524
|
+
function PendingBadge() {
|
|
525
|
+
return (
|
|
526
|
+
<View style={styles.pendingBadge}>
|
|
527
|
+
<View style={styles.pendingDot} />
|
|
528
|
+
<Text style={styles.pendingBadgeText}>Pending review</Text>
|
|
529
|
+
</View>
|
|
530
|
+
);
|
|
531
|
+
}
|
|
532
|
+
|
|
520
533
|
function TypeBadge({ type, p }: { type: FeedbackType; p: Palette }) {
|
|
521
534
|
return (
|
|
522
535
|
<View style={[styles.badge, { backgroundColor: TYPE_BG[type] || p.bgSoft }]}>
|
|
@@ -676,6 +689,30 @@ const styles = StyleSheet.create({
|
|
|
676
689
|
successTitle: { fontSize: 20, fontWeight: "700", textAlign: "center", marginBottom: 6 },
|
|
677
690
|
successSub: { fontSize: 14, textAlign: "center" },
|
|
678
691
|
|
|
692
|
+
// Pending badge
|
|
693
|
+
pendingBadge: {
|
|
694
|
+
flexDirection: "row",
|
|
695
|
+
alignItems: "center",
|
|
696
|
+
gap: 4,
|
|
697
|
+
backgroundColor: "#fff7ed",
|
|
698
|
+
borderWidth: 1,
|
|
699
|
+
borderColor: "#fed7aa",
|
|
700
|
+
borderRadius: 6,
|
|
701
|
+
paddingHorizontal: 6,
|
|
702
|
+
paddingVertical: 2,
|
|
703
|
+
},
|
|
704
|
+
pendingDot: {
|
|
705
|
+
width: 5,
|
|
706
|
+
height: 5,
|
|
707
|
+
borderRadius: 3,
|
|
708
|
+
backgroundColor: "#ea580c",
|
|
709
|
+
},
|
|
710
|
+
pendingBadgeText: {
|
|
711
|
+
fontSize: 10,
|
|
712
|
+
fontWeight: "700",
|
|
713
|
+
color: "#ea580c",
|
|
714
|
+
},
|
|
715
|
+
|
|
679
716
|
// Branding
|
|
680
717
|
poweredBy: {
|
|
681
718
|
alignItems: "center",
|
package/src/api.ts
CHANGED
|
@@ -40,7 +40,8 @@ export class UpstepApiClient {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
async getItem(feedbackId: string): Promise<FeedbackWithComments> {
|
|
43
|
-
const
|
|
43
|
+
const qs = this.userId ? `?endUserId=${encodeURIComponent(this.userId)}` : "";
|
|
44
|
+
const res = await fetch(`${this.baseUrl}/api/sdk/feedback/${feedbackId}${qs}`, {
|
|
44
45
|
headers: this.headers(),
|
|
45
46
|
});
|
|
46
47
|
if (!res.ok) throw new Error(`Upstep: ${res.status}`);
|