hive-react-kit 1.6.2 → 1.6.4

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.
@@ -1,6 +1,6 @@
1
1
  interface UpvoteListModalProps {
2
- author: string;
3
- permlink: string;
2
+ author?: string;
3
+ permlink?: string;
4
4
  onClose: () => void;
5
5
  currentUser?: string;
6
6
  token?: string;
@@ -11,7 +11,37 @@ interface UpvoteListModalProps {
11
11
  * works offline; falls back to the official Hive logo from
12
12
  * hive.io otherwise. */
13
13
  hiveIconUrl?: string;
14
+ /** "Voters-only" mode. When a plain list of account names is passed
15
+ * (e.g. accounts that voted for a witness), the modal skips the
16
+ * post fetch + reward maths and just renders the same avatar/name
17
+ * grid — no upvote button. Used by surfaces that have voters but no
18
+ * per-vote reward (witnesses, proposals). */
19
+ voters?: string[];
20
+ /** Voters-only mode with deferred loading: the modal calls this on
21
+ * open, shows its own spinner while it resolves, then renders the
22
+ * returned voters. Use instead of `voters` when the list has to be
23
+ * fetched (e.g. witness voters from the chain). Returning a `value`
24
+ * per voter (e.g. each voter's MHP weight) also lights up the same
25
+ * breakdown bar the post-votes view uses. */
26
+ fetchVoters?: () => Promise<VoterRow[]>;
27
+ /** Unit suffix for each voter's `value` (e.g. "MHP"). Shown after the
28
+ * number in voters-only mode; no Hive reward icon is rendered. */
29
+ valueUnit?: string;
30
+ /** Header title override. Defaults to "Votes (Hive Rewards)". */
31
+ title?: string;
32
+ /** Makes each voter row navigate to the account's profile. Mainly
33
+ * used in voters-only mode. */
34
+ onUserClick?: (username: string) => void;
35
+ /** Builds a profile URL so voter rows render as real <a href> links
36
+ * (open-in-new-tab). Paired with `onUserClick` for SPA nav. */
37
+ getUserUrl?: (username: string) => string;
38
+ }
39
+ /** A single row in voters-only mode. `value` is an optional weight
40
+ * (e.g. the voter's MHP) used for sorting + the breakdown bar. */
41
+ export interface VoterRow {
42
+ account: string;
43
+ value?: number;
14
44
  }
15
45
  export declare function formatTimeAgo(date: string | Date): string;
16
- declare const UpvoteListModal: ({ author, permlink, onClose, currentUser, token, onClickUpvoteButton, hiveIconUrl, }: UpvoteListModalProps) => import("react/jsx-runtime").JSX.Element;
46
+ declare const UpvoteListModal: ({ author, permlink, onClose, currentUser, token, onClickUpvoteButton, hiveIconUrl, voters, fetchVoters, valueUnit, title, onUserClick, getUserUrl, }: UpvoteListModalProps) => import("react/jsx-runtime").JSX.Element;
17
47
  export default UpvoteListModal;