@akita-protocol/algomd-rn 1.0.0-alpha.0 → 1.0.0-alpha.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.
@@ -0,0 +1,290 @@
1
+ import React, { useEffect, useRef, useState } from "react";
2
+ import { StyleSheet, View } from "react-native";
3
+ import {
4
+ formatRelativeTime,
5
+ guildBallotOutcome,
6
+ guildProposalStatusLabel,
7
+ guildRequirementsText,
8
+ splitGuildProposalId,
9
+ type GuildBallotData,
10
+ type GuildProposalData,
11
+ type GuildProposalStatus,
12
+ } from "@akita-protocol/algomd-core";
13
+ import { useGuildProposal } from "@akita-protocol/algomd-core/react";
14
+ import { GuildIcon, HandThumbDownIcon, HandThumbUpIcon } from "../presentation/icons";
15
+ import { PLUGIN_COLORS } from "../presentation/pluginColors";
16
+ import { Text, useAppTheme, usePresentation, type GuildVoteChoice } from "../presentation/runtime";
17
+ import { ActionButton, plural, useNow } from "./contractParts";
18
+ import { GuildActionList } from "./GuildActions";
19
+ import {
20
+ Card,
21
+ CardHeader,
22
+ CardSkeleton,
23
+ InlinePill,
24
+ KindTile,
25
+ Note,
26
+ Row,
27
+ RowSkeleton,
28
+ StatusBadge,
29
+ Title,
30
+ Unavailable,
31
+ usePalette,
32
+ type Tone,
33
+ } from "./primitives";
34
+ import type { RefViewProps } from "./types";
35
+
36
+ type CardAction = GuildVoteChoice | "submit" | "finalize" | "execute";
37
+
38
+ const PROGRESS: Record<CardAction, string> = {
39
+ approve: "Voting yes…",
40
+ reject: "Voting no…",
41
+ abstain: "Abstaining…",
42
+ submit: "Opening the vote…",
43
+ finalize: "Closing the vote…",
44
+ execute: "Applying the changes…",
45
+ };
46
+
47
+ const VOTED: Record<GuildVoteChoice, string> = {
48
+ approve: "You voted yes",
49
+ reject: "You voted no",
50
+ abstain: "You abstained",
51
+ };
52
+
53
+ const STATUS_TONE: Record<GuildProposalStatus, Tone> = {
54
+ draft: "neutral",
55
+ invalid: "bad",
56
+ voting: "warn",
57
+ rejected: "bad",
58
+ approved: "good",
59
+ executed: "good",
60
+ };
61
+
62
+ /** How long the host's automation gets before the card offers to do it by hand. */
63
+ const AUTOMATION_GRACE = 10 * 60;
64
+
65
+ function timeLeft(votingEnd: string, now: number): string {
66
+ const remaining = Number(votingEnd) - now;
67
+ if (remaining <= 0) return "Voting closed";
68
+ const minutes = Math.ceil(remaining / 60);
69
+ if (minutes < 60) return `${minutes}m left`;
70
+ const hours = Math.floor(minutes / 60);
71
+ return hours < 48 ? `${hours}h left` : `${Math.floor(hours / 24)}d left`;
72
+ }
73
+
74
+ /**
75
+ * A Guild proposal: its status, what it does if it passes, and the tally against
76
+ * the Guild's requirements, all from chain. `params.title` and `params.summary`
77
+ * are the proposer's own words, shown as such. Members vote with the host's wallet.
78
+ */
79
+ export function GuildProposalRef({ id, size = "large", params, onPress, visible }: RefViewProps) {
80
+ const { theme } = useAppTheme();
81
+ const presentation = usePresentation();
82
+ const proposal = useGuildProposal(id, { visible });
83
+ const data = proposal.data?.data;
84
+ const parts = splitGuildProposalId(id);
85
+ const label = params?.title || `Proposal #${parts?.proposalId ?? id}`;
86
+ const press = onPress ?? (presentation.onOpenContract ? () => presentation.onOpenContract!("guild-proposal", id) : undefined);
87
+ const retry = proposal.isError ? () => void proposal.refetch() : undefined;
88
+
89
+ if (size === "inline") {
90
+ return <InlinePill label={label} dim={proposal.isPending} leading={<GuildIcon size={12} color={PLUGIN_COLORS.Guild} />} onPress={press} />;
91
+ }
92
+
93
+ if (size === "small") {
94
+ if (proposal.isPending) return <RowSkeleton shape="rounded" />;
95
+ if (!data) return <Unavailable size="small" label={label} Icon={GuildIcon} onRetry={retry} />;
96
+ return (
97
+ <Row
98
+ leading={<KindTile Icon={GuildIcon} color={PLUGIN_COLORS.Guild} size={40} />}
99
+ title={<Title>{label}</Title>}
100
+ subtitle={`Guild proposal #${data.proposalId} · ${plural(data.actions.length, "action")}`}
101
+ trailing={<StatusBadge label={guildProposalStatusLabel(data.status)} tone={STATUS_TONE[data.status]} />}
102
+ onPress={press}
103
+ accessibilityLabel={`Open guild proposal: ${label}`}
104
+ />
105
+ );
106
+ }
107
+
108
+ if (proposal.isPending) return <CardSkeleton media="rounded" blocks={3} action full={size === "full"} />;
109
+ if (!data) return <Unavailable size={size} label={label} Icon={GuildIcon} onRetry={retry} />;
110
+ return (
111
+ <GuildProposalCard
112
+ data={data}
113
+ title={label}
114
+ summary={params?.summary}
115
+ full={size === "full"}
116
+ visible={visible}
117
+ refresh={() => void proposal.refetch()}
118
+ />
119
+ );
120
+ }
121
+
122
+ function TallyBar({ ballot }: { ballot: GuildBallotData }) {
123
+ const { theme, tone, inset } = usePalette();
124
+ const approvals = Number(ballot.votes.approvals);
125
+ const rejections = Number(ballot.votes.rejections);
126
+ const abstains = Number(ballot.votes.abstains);
127
+ const total = approvals + rejections + abstains;
128
+ const share = (n: number) => (total ? `${(n / total) * 100}%` : "0%") as `${number}%`;
129
+ return (
130
+ <View style={[styles.track, { backgroundColor: inset }]} accessibilityElementsHidden importantForAccessibility="no-hide-descendants">
131
+ <View style={{ width: share(approvals), backgroundColor: tone("good") }} />
132
+ <View style={{ width: share(rejections), backgroundColor: tone("bad") }} />
133
+ <View style={{ width: share(abstains), backgroundColor: theme.colors.textDim }} />
134
+ </View>
135
+ );
136
+ }
137
+
138
+ function GuildProposalCard({
139
+ data,
140
+ title,
141
+ summary,
142
+ full,
143
+ visible,
144
+ refresh,
145
+ }: {
146
+ data: GuildProposalData;
147
+ title: string;
148
+ summary?: string;
149
+ full: boolean;
150
+ visible?: boolean;
151
+ refresh: () => void;
152
+ }) {
153
+ const { theme, tone } = usePalette();
154
+ const presentation = usePresentation();
155
+ const actions = presentation.actions;
156
+ const automated = !!presentation.guildAutomation;
157
+ const now = useNow(automated ? 15_000 : 60_000, data.status === "voting" || (automated && data.status === "approved"));
158
+ const [busy, setBusy] = useState<CardAction>();
159
+ const [error, setError] = useState<string>();
160
+ const [voted, setVoted] = useState<GuildVoteChoice>();
161
+ const ballot = data.ballot;
162
+ const outcome = ballot ? guildBallotOutcome(ballot, now) : undefined;
163
+ const blocked = presentation.guildActionBlock?.(data.guildAppId);
164
+ const open = data.status === "voting" && !!ballot && !ballot.resolved;
165
+ const canVote = open && outcome === undefined && now <= Number(ballot!.votingEnd) && !!actions?.guildVote;
166
+ const settled = open && outcome !== undefined;
167
+ // Bootstrap proposals (no vote) only run for their creator, so the host's automation skips them.
168
+ const pendingRun = data.status === "approved" && data.votingTs !== "0";
169
+ const waiting = automated && (settled || pendingRun);
170
+ // When the automation's turn began: the vote's end, or when this card first saw it due.
171
+ const firstDue = useRef<number | undefined>(undefined);
172
+ if (waiting && firstDue.current === undefined) firstDue.current = now;
173
+ const dueSince = Math.min(Number(ballot?.votingEnd) || Infinity, firstDue.current ?? now);
174
+ const late = waiting && now - dueSince >= AUTOMATION_GRACE;
175
+ // Re-read the proposal while the automation works, so the card moves on by itself.
176
+ const refreshRef = useRef(refresh);
177
+ refreshRef.current = refresh;
178
+ useEffect(() => {
179
+ if (!waiting) return;
180
+ const t = setInterval(() => refreshRef.current(), 20_000);
181
+ return () => clearInterval(t);
182
+ }, [waiting]);
183
+ const canFinalize = settled && !!actions?.guildFinalize && (!automated || late);
184
+ const canExecute = (automated ? pendingRun && late : data.status === "approved") && !!actions?.guildExecute;
185
+ const canSubmit =
186
+ data.status === "draft" && !!data.creator && data.creator === presentation.viewerAddress && !!actions?.guildSubmit;
187
+ const statusLabel = settled ? (outcome === "approved" ? "Passed" : "Rejected") : guildProposalStatusLabel(data.status);
188
+ const statusTone: Tone = settled ? (outcome === "approved" ? "good" : "bad") : STATUS_TONE[data.status];
189
+
190
+ const run = async (action: CardAction) => {
191
+ if (busy || blocked) return;
192
+ setBusy(action);
193
+ setError(undefined);
194
+ try {
195
+ const { guildAppId, proposalId } = data;
196
+ if (action === "approve" || action === "reject" || action === "abstain") {
197
+ await actions?.guildVote?.(guildAppId, proposalId, action);
198
+ setVoted(action);
199
+ } else if (action === "submit") await actions?.guildSubmit?.(guildAppId, proposalId);
200
+ else if (action === "finalize") await actions?.guildFinalize?.(guildAppId, proposalId);
201
+ else await actions?.guildExecute?.(guildAppId, proposalId);
202
+ refresh();
203
+ } catch (cause) {
204
+ setError(cause instanceof Error ? cause.message : "The guild transaction failed.");
205
+ } finally {
206
+ setBusy(undefined);
207
+ }
208
+ };
209
+
210
+ return (
211
+ <Card>
212
+ <CardHeader
213
+ eyebrow={{ label: "Guild proposal", Icon: GuildIcon, color: PLUGIN_COLORS.Guild }}
214
+ title={title}
215
+ titleLines={3}
216
+ full={full}
217
+ status={<StatusBadge label={statusLabel} tone={statusTone} />}
218
+ meta={`#${data.proposalId}${data.created && data.created !== "0" ? ` · ${formatRelativeTime(Number(data.created))}` : ""}`}
219
+ />
220
+
221
+ {summary ? (
222
+ <Text size="xs" numberOfLines={full ? undefined : 6} style={{ color: theme.colors.textDim }}>
223
+ {summary}
224
+ </Text>
225
+ ) : null}
226
+
227
+ {data.actions.length ? <GuildActionList actions={data.actions} consensus={data.consensus} feeAsset={data.feeAsset} visible={visible} /> : null}
228
+
229
+ {ballot ? (
230
+ <View style={{ gap: 6 }}>
231
+ {guildRequirementsText(ballot) ? <Note>{guildRequirementsText(ballot)}</Note> : null}
232
+ <TallyBar ballot={ballot} />
233
+ <View style={styles.legend}>
234
+ <Text size="xxs" style={{ color: theme.colors.textDim }}>
235
+ {`${ballot.votes.approvals} yes · ${ballot.votes.rejections} no · ${ballot.votes.abstains} abstain`}
236
+ </Text>
237
+ <Text size="xxs" style={{ color: theme.colors.textDim }}>
238
+ {ballot.resolved ? "Closed" : settled && now <= Number(ballot.votingEnd) ? "Decided early" : timeLeft(ballot.votingEnd, now)}
239
+ </Text>
240
+ </View>
241
+ </View>
242
+ ) : null}
243
+
244
+ {blocked ? (
245
+ <Note tone="warn">{blocked}</Note>
246
+ ) : busy ? (
247
+ <Note>{PROGRESS[busy]}</Note>
248
+ ) : voted && canVote ? (
249
+ <Text size="xs" weight="semiBold" style={{ color: tone("good") }}>
250
+ {VOTED[voted]}
251
+ </Text>
252
+ ) : canVote ? (
253
+ <View style={styles.buttons}>
254
+ <ActionButton label="Abstain" variant="text" onPress={() => void run("abstain")} />
255
+ <ActionButton label="No" Icon={HandThumbDownIcon} variant="secondary" onPress={() => void run("reject")} accessibilityLabel="Vote no" />
256
+ <ActionButton label="Yes" Icon={HandThumbUpIcon} onPress={() => void run("approve")} accessibilityLabel="Vote yes" />
257
+ </View>
258
+ ) : late && (canFinalize || canExecute) ? (
259
+ <View style={{ gap: 8 }}>
260
+ <Note tone="warn">
261
+ {canFinalize
262
+ ? "Closing this vote is taking longer than usual. You can close it yourself; your wallet pays the network fee."
263
+ : "Applying this proposal is taking longer than usual. You can apply it yourself; your wallet pays the network fee."}
264
+ </Note>
265
+ <ActionButton
266
+ label={canFinalize ? "Close the vote now" : "Apply it now"}
267
+ variant="secondary"
268
+ onPress={() => void run(canFinalize ? "finalize" : "execute")}
269
+ />
270
+ </View>
271
+ ) : waiting ? (
272
+ <Note>{settled ? (outcome === "approved" ? "The vote passed. The changes apply automatically in a moment." : "The vote failed. It closes automatically in a moment.") : "Passed. The changes are being applied automatically."}</Note>
273
+ ) : canFinalize ? (
274
+ <ActionButton label="Close the vote" onPress={() => void run("finalize")} />
275
+ ) : canExecute ? (
276
+ <ActionButton label="Apply the changes" onPress={() => void run("execute")} />
277
+ ) : canSubmit ? (
278
+ <ActionButton label="Open voting" onPress={() => void run("submit")} />
279
+ ) : null}
280
+
281
+ {error ? <Note tone="bad">{error}</Note> : null}
282
+ </Card>
283
+ );
284
+ }
285
+
286
+ const styles = StyleSheet.create({
287
+ track: { borderRadius: 3, flexDirection: "row", height: 6, overflow: "hidden" },
288
+ legend: { flexDirection: "row", justifyContent: "space-between", gap: 12 },
289
+ buttons: { alignItems: "center", flexDirection: "row", gap: 8, justifyContent: "flex-end" },
290
+ });
@@ -17,6 +17,7 @@ import { RewardRef } from "./RewardRef";
17
17
  import { SubscriptionRef } from "./SubscriptionRef";
18
18
  import { TradeRef } from "./TradeRef";
19
19
  import { DualStakeRef } from "./DualStakeRef";
20
+ import { GuildProposalRef } from "./GuildProposalRef";
20
21
  import { PageCardRef, PageLinksProvider, PrivateContentRef, type PageLinks } from "./HostRefs";
21
22
  import type { RefViewProps } from "./types";
22
23
 
@@ -35,6 +36,8 @@ export { RewardRef } from "./RewardRef";
35
36
  export { SubscriptionRef } from "./SubscriptionRef";
36
37
  export { TradeRef } from "./TradeRef";
37
38
  export { DualStakeRef } from "./DualStakeRef";
39
+ export { GuildProposalRef } from "./GuildProposalRef";
40
+ export { GuildActionList, GuildPluginDetails } from "./GuildActions";
38
41
  export { PageCardRef, PageLinksProvider, PrivateContentRef, type PageLinks } from "./HostRefs";
39
42
  export { useAssetInfo, useFormattedAmount, ALGO_ASSET, type AssetInfo } from "./assetInfo";
40
43
  export { Amount, StatusChip, ProvenanceNote, useNow } from "./contractParts";
@@ -58,6 +61,7 @@ export const REF_VIEWS: Record<string, React.ComponentType<RefViewProps>> = {
58
61
  subscription: SubscriptionRef,
59
62
  trade: TradeRef,
60
63
  "dual-stake": DualStakeRef,
64
+ "guild-proposal": GuildProposalRef,
61
65
  "page-card": PageCardRef,
62
66
  "private-content": PrivateContentRef,
63
67
  };
@@ -110,11 +110,11 @@ export function Avatar({ uri, size, shape = "circle", initial, icon }: AvatarPro
110
110
  }
111
111
 
112
112
  /** The tile for kinds without their own image: the kind's icon on a primary tint. */
113
- export function KindTile({ Icon, size, dim }: { Icon: IconComponent; size: number; dim?: boolean }) {
113
+ export function KindTile({ Icon, size, dim, color }: { Icon: IconComponent; size: number; dim?: boolean; color?: string }) {
114
114
  const { theme, tint } = usePalette();
115
115
  return (
116
116
  <View style={[styles.center, { width: size, height: size, borderRadius: Math.max(4, size / 4), backgroundColor: dim ? theme.colors.border : tint }]}>
117
- <Icon size={Math.round(size * 0.48)} color={dim ? theme.colors.textDim : theme.colors.primary} />
117
+ <Icon size={Math.round(size * 0.48)} color={dim ? theme.colors.textDim : (color ?? theme.colors.primary)} />
118
118
  </View>
119
119
  );
120
120
  }
@@ -130,18 +130,20 @@ export interface InlinePillProps {
130
130
  leading?: React.ReactNode;
131
131
  trailing?: React.ReactNode;
132
132
  dim?: boolean;
133
+ /** Tints the pill with the primary color, to pick a name out of a sentence. */
134
+ highlight?: boolean;
133
135
  onPress?: () => void;
134
136
  onLongPress?: () => void;
135
137
  accessibilityLabel?: string;
136
138
  }
137
139
 
138
140
  /** The inline shape. It is a View, so it can sit inside a Text run. */
139
- export function InlinePill({ label, leading, trailing, dim, onPress, onLongPress, accessibilityLabel }: InlinePillProps) {
141
+ export function InlinePill({ label, leading, trailing, dim, highlight, onPress, onLongPress, accessibilityLabel }: InlinePillProps) {
140
142
  const { theme } = useAppTheme();
141
143
  const pill = (
142
- <View style={[styles.pill, { backgroundColor: theme.colors.accentBackground, opacity: dim ? 0.6 : 1 }]}>
144
+ <View style={[styles.pill, { backgroundColor: highlight ? `${theme.colors.primary}24` : theme.colors.accentBackground, opacity: dim ? 0.6 : 1 }]}>
143
145
  {leading}
144
- <Text weight="medium" numberOfLines={1} style={[styles.pillText, { color: theme.colors.text }]}>
146
+ <Text weight="medium" numberOfLines={1} style={[styles.pillText, { color: highlight ? theme.colors.primary : theme.colors.text }]}>
145
147
  {label}
146
148
  </Text>
147
149
  {trailing}
@@ -225,7 +227,13 @@ export function Card({ children, style }: { children: React.ReactNode; style?: S
225
227
  }
226
228
 
227
229
  export interface CardHeaderProps {
228
- media: React.ReactNode;
230
+ /** The image or kind tile. Leave out when the eyebrow already names the kind. */
231
+ media?: React.ReactNode;
232
+ /**
233
+ * The card's kind above the title, like the auction, listing and raffle
234
+ * cards: a small icon and an uppercase label in the kind's colour.
235
+ */
236
+ eyebrow?: { label: string; Icon?: IconComponent; color?: string };
229
237
  title: React.ReactNode;
230
238
  verified?: boolean;
231
239
  /** A status badge, shown before the meta line. */
@@ -244,12 +252,21 @@ export interface CardHeaderProps {
244
252
  * line of context under it. Status sits under the title so a long name keeps
245
253
  * the full width on a phone.
246
254
  */
247
- export function CardHeader({ media, title, verified, status, meta, menu, full, titleLines = 2 }: CardHeaderProps) {
255
+ export function CardHeader({ media, eyebrow, title, verified, status, meta, menu, full, titleLines = 2 }: CardHeaderProps) {
248
256
  const { theme } = useAppTheme();
257
+ const eyebrowColor = eyebrow?.color ?? theme.colors.primary;
249
258
  return (
250
259
  <View style={styles.header}>
251
260
  {media}
252
261
  <View style={styles.headerText}>
262
+ {eyebrow ? (
263
+ <View style={styles.eyebrow}>
264
+ {eyebrow.Icon ? <eyebrow.Icon size={13} color={eyebrowColor} /> : null}
265
+ <Text size="xxs" weight="semiBold" numberOfLines={1} style={{ color: eyebrowColor, letterSpacing: 0.6, textTransform: "uppercase" }}>
266
+ {eyebrow.label}
267
+ </Text>
268
+ </View>
269
+ ) : null}
253
270
  <View style={styles.inlineRow}>
254
271
  {typeof title === "string" ? (
255
272
  <Text size={full ? "lg" : "md"} weight="bold" numberOfLines={titleLines} style={{ flexShrink: 1 }}>
@@ -388,14 +405,31 @@ export function StatusBadge({ label, tone = "neutral" }: { label: string; tone?:
388
405
  export interface ActionButtonProps {
389
406
  label: string;
390
407
  onPress: () => void;
391
- /** `secondary` is a quiet fill for the second of two actions. */
392
- variant?: "primary" | "secondary";
408
+ /**
409
+ * `secondary` is a quiet fill for the second of two actions. `text` has no
410
+ * fill, for an action to de-emphasize.
411
+ */
412
+ variant?: "primary" | "secondary" | "text";
413
+ /** Draws the icon in place of the label, in a button only as wide as it needs. The label stays for accessibility. */
414
+ Icon?: IconComponent;
393
415
  accessibilityLabel?: string;
394
416
  }
395
417
 
396
418
  /** The card's action, drawn like the Akita app's confirm buttons. */
397
- export function ActionButton({ label, onPress, variant = "primary", accessibilityLabel }: ActionButtonProps) {
419
+ export function ActionButton({ label, onPress, variant = "primary", Icon, accessibilityLabel }: ActionButtonProps) {
398
420
  const { theme, inset } = usePalette();
421
+ const color = variant === "primary" ? theme.gradients.interactiveText : variant === "text" ? theme.colors.textDim : theme.colors.text;
422
+ const content = Icon ? (
423
+ // Positioned, so the web renderer paints it above the gradient fill.
424
+ <View style={{ position: "relative" }}>
425
+ <Icon size={20} color={color} />
426
+ </View>
427
+ ) : (
428
+ <Text size="sm" weight={variant === "text" ? "semiBold" : "bold"} numberOfLines={1} style={{ color }}>
429
+ {label}
430
+ </Text>
431
+ );
432
+ const shape = StyleSheet.flatten([styles.button, Icon && styles.iconButton, variant === "text" && styles.textButton]);
399
433
  return (
400
434
  <SquishyPressable pressedScale={0.97} onPress={onPress} accessibilityRole="button" accessibilityLabel={accessibilityLabel ?? label}>
401
435
  {variant === "primary" ? (
@@ -404,18 +438,12 @@ export function ActionButton({ label, onPress, variant = "primary", accessibilit
404
438
  locations={theme.gradients.interactiveLocations ? [...theme.gradients.interactiveLocations] : undefined}
405
439
  start={{ x: 0, y: 0 }}
406
440
  end={{ x: 1, y: 0 }}
407
- style={styles.button}
441
+ style={shape}
408
442
  >
409
- <Text size="sm" weight="bold" numberOfLines={1} style={{ color: theme.gradients.interactiveText }}>
410
- {label}
411
- </Text>
443
+ {content}
412
444
  </LinearGradient>
413
445
  ) : (
414
- <View style={[styles.button, { backgroundColor: inset }]}>
415
- <Text size="sm" weight="bold" numberOfLines={1}>
416
- {label}
417
- </Text>
418
- </View>
446
+ <View style={[shape, variant === "secondary" && { backgroundColor: inset }]}>{content}</View>
419
447
  )}
420
448
  </SquishyPressable>
421
449
  );
@@ -570,6 +598,7 @@ const styles = StyleSheet.create({
570
598
  card: { borderRadius: 16, gap: 16, overflow: "hidden", padding: 16 },
571
599
  header: { alignItems: "center", flexDirection: "row", gap: 12 },
572
600
  headerText: { flex: 1, minWidth: 0, gap: 4 },
601
+ eyebrow: { alignItems: "center", flexDirection: "row", gap: 4, marginBottom: -2 },
573
602
  metaRow: { alignItems: "center", flexDirection: "row", flexWrap: "wrap", columnGap: 8, rowGap: 2 },
574
603
  statRow: { borderRadius: 14, flexDirection: "row", gap: 12, paddingHorizontal: 14, paddingVertical: 12 },
575
604
  inset: { borderRadius: 14, paddingHorizontal: 14, paddingVertical: 4 },
@@ -585,4 +614,7 @@ const styles = StyleSheet.create({
585
614
  badge: { alignItems: "center", flexDirection: "row", gap: 5 },
586
615
  dot: { borderRadius: 3, height: 6, marginHorizontal: 3, width: 6 },
587
616
  button: { alignItems: "center", borderRadius: 14, height: 48, justifyContent: "center", paddingHorizontal: 16 },
617
+ // Icon buttons are pills: the radius is half the 48px height.
618
+ iconButton: { borderRadius: 24, paddingHorizontal: 28 },
619
+ textButton: { paddingHorizontal: 8 },
588
620
  });