@upstep/react-native 0.6.13 → 0.6.15

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/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ ## 0.6.15
4
+
5
+ - Show the custom dashboard status name and color in the feedback sheet.
6
+
7
+ ## 0.6.14
8
+
9
+ - Show dashboard custom labels on feedback cards and detail views.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@upstep/react-native",
3
- "version": "0.6.13",
3
+ "version": "0.6.15",
4
4
  "description": "Upstep feedback SDK for React Native",
5
5
  "homepage": "https://upstep.dev",
6
6
  "repository": {
@@ -19,7 +19,7 @@
19
19
  }
20
20
  },
21
21
  "dependencies": {
22
- "@upstep/types": "0.5.5"
22
+ "@upstep/types": "0.5.6"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@react-native-async-storage/async-storage": ">=1.18",
@@ -277,9 +277,10 @@ function FeedCard({
277
277
  <TypeBadge type={item.type} p={p} />
278
278
  {item.status === "PENDING"
279
279
  ? <PendingBadge />
280
- : <StatusDot status={item.status} />}
280
+ : <StatusDot status={item.status} color={item.boardStatus?.color} />}
281
281
  <Text style={[styles.cardDate, { color: p.textFaint }]}>{fmtDate(item.createdAt)}</Text>
282
282
  </View>
283
+ <LabelBadges labels={item.labels} p={p} />
283
284
  </View>
284
285
 
285
286
  <Text style={[styles.chevron, { color: p.textFaint }]}>›</Text>
@@ -337,7 +338,8 @@ function FeedDetailBody({
337
338
  <TypeBadge type={item.type} p={p} />
338
339
  {item.status === "PENDING"
339
340
  ? <PendingBadge />
340
- : <StatusBadge status={item.status} p={p} />}
341
+ : <StatusBadge status={item.status} boardStatus={item.boardStatus} p={p} />}
342
+ <LabelBadges labels={item.labels} p={p} />
341
343
  </View>
342
344
 
343
345
  <Text style={[styles.detailContent, { color: p.textSoft }]}>{item.content}</Text>
@@ -547,15 +549,34 @@ const STATUS_COLOR: Record<string, string> = {
547
549
  PENDING: "#ea580c", CLOSED: "#6b7280",
548
550
  };
549
551
 
550
- function StatusDot({ status }: { status: string }) {
551
- return <View style={[styles.statusDot, { backgroundColor: STATUS_COLOR[status] ?? "#9ca3af" }]} />;
552
+ function StatusDot({ status, color }: { status: string; color?: string }) {
553
+ return <View style={[styles.statusDot, { backgroundColor: color ?? STATUS_COLOR[status] ?? "#9ca3af" }]} />;
552
554
  }
553
555
 
554
- function StatusBadge({ status, p }: { status: string; p: Palette }) {
556
+ function StatusBadge({
557
+ status, boardStatus, p,
558
+ }: {
559
+ status: string; boardStatus: Feedback["boardStatus"]; p: Palette;
560
+ }) {
555
561
  return (
556
562
  <View style={[styles.statusBadge, { backgroundColor: p.bgSoft, borderColor: p.border }]}>
557
- <StatusDot status={status} />
558
- <Text style={[styles.statusBadgeText, { color: p.textSoft }]}>{status.replace("_", " ")}</Text>
563
+ <StatusDot status={status} color={boardStatus?.color} />
564
+ <Text style={[styles.statusBadgeText, { color: p.textSoft }]}>{boardStatus?.name ?? status.replace("_", " ")}</Text>
565
+ </View>
566
+ );
567
+ }
568
+
569
+ function LabelBadges({ labels, p }: { labels: Feedback["labels"]; p: Palette }) {
570
+ if (!labels?.length) return null;
571
+
572
+ return (
573
+ <View style={styles.labelBadges}>
574
+ {labels.map((label) => (
575
+ <View key={label.id} style={[styles.labelBadge, { backgroundColor: p.bgSoft, borderColor: label.color }]}>
576
+ <View style={[styles.labelDot, { backgroundColor: label.color }]} />
577
+ <Text style={[styles.labelBadgeText, { color: p.textSoft }]} numberOfLines={1}>{label.name}</Text>
578
+ </View>
579
+ ))}
559
580
  </View>
560
581
  );
561
582
  }
@@ -641,12 +662,16 @@ const styles = StyleSheet.create({
641
662
  cardDesc: { fontSize: 12.5, lineHeight: 17, marginBottom: 6 },
642
663
  cardMeta: { flexDirection: "row", alignItems: "center", gap: 6 },
643
664
  cardDate: { fontSize: 11 },
665
+ labelBadges: { flexDirection: "row", flexWrap: "wrap", gap: 6, marginTop: 7 },
666
+ labelBadge: { flexDirection: "row", alignItems: "center", gap: 5, borderWidth: 1, borderRadius: 10, paddingHorizontal: 7, paddingVertical: 3, maxWidth: "100%" },
667
+ labelDot: { width: 6, height: 6, borderRadius: 3 },
668
+ labelBadgeText: { fontSize: 11, fontWeight: "500", flexShrink: 1 },
644
669
  chevron: { fontSize: 22, fontWeight: "300", marginLeft: 4 },
645
670
 
646
671
  // Detail
647
672
  detailPad: { paddingTop: 4 },
648
673
  detailTitle: { fontSize: 22, fontWeight: "700", letterSpacing: -0.4, marginBottom: 10, lineHeight: 28 },
649
- badgeRow: { flexDirection: "row", gap: 8, marginBottom: 16 },
674
+ badgeRow: { flexDirection: "row", flexWrap: "wrap", gap: 8, marginBottom: 16 },
650
675
  detailContent: { fontSize: 15, lineHeight: 23, marginBottom: 24 },
651
676
  upvoteBtn: {
652
677
  flexDirection: "row", alignItems: "center", gap: 8,
@@ -1,4 +0,0 @@
1
-
2
- > @upstep/react-native@0.6.12 type-check /Users/sandhyasandy/Dev/upstep/packages/sdk-react-native
3
- > tsc --noEmit
4
-