hive-react-kit 0.2.1 → 0.2.3

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.
@@ -5,7 +5,7 @@ interface CommentsListProps {
5
5
  currentUser?: string;
6
6
  token?: string;
7
7
  onClickUpvoteButton?: (currentUser?: string, token?: string) => void;
8
- onClickCommentUpvote?: (comment: Discussion) => void;
8
+ onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
9
9
  onClickCommentReply?: (comment: Discussion) => void;
10
10
  }
11
11
  export declare function CommentsList({ author, permlink, currentUser, token, onClickUpvoteButton, onClickCommentUpvote, onClickCommentReply, }: CommentsListProps): import("react/jsx-runtime").JSX.Element;
@@ -5,7 +5,7 @@ interface HiveDetailPostProps {
5
5
  currentUser?: string;
6
6
  token?: string;
7
7
  onClickUpvoteButton?: (currentUser?: string, token?: string) => void;
8
- onClickCommentUpvote?: (comment: Discussion) => void;
8
+ onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
9
9
  onClickCommentReply?: (comment: Discussion) => void;
10
10
  }
11
11
  export declare function HiveDetailPost({ author, permlink, currentUser, token, onClickUpvoteButton, onClickCommentUpvote, onClickCommentReply }: HiveDetailPostProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ export interface PostActionButtonProps {
2
+ author: string;
3
+ permlink: string;
4
+ /** Current logged-in username; null or '' means not logged in */
5
+ currentUser?: string | null;
6
+ /** Optional: Hive payout/value to display */
7
+ hiveValue?: number;
8
+ /** Called when user confirms vote with percent (1–100). Frontend handles signing/broadcast. */
9
+ onUpvote?: (percent: number) => void | Promise<void>;
10
+ /** Called when user submits a comment. Frontend handles signing/broadcast. */
11
+ onSubmitComment?: (parentAuthor: string, parentPermlink: string, body: string) => void | Promise<void>;
12
+ /** Called when comment button is clicked (e.g. open comments). */
13
+ onComments?: () => void;
14
+ /** Called when reblog is clicked (when logged in). */
15
+ onReblog?: () => void;
16
+ /** Called when share is clicked. */
17
+ onShare?: () => void;
18
+ /** Called when tip is clicked (when logged in). */
19
+ onTip?: () => void;
20
+ /** Called when report is clicked (when logged in). */
21
+ onReport?: () => void;
22
+ /** Called when user confirms comment upvote with (author, permlink, percent). Frontend handles signing. Voted comments show icon in blue. */
23
+ onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
24
+ }
25
+ export declare function PostActionButton({ author, permlink, currentUser: currentUserProp, hiveValue, onUpvote, onSubmitComment, onComments, onReblog, onShare, onTip, onReport, onClickCommentUpvote, }: PostActionButtonProps): import("react/jsx-runtime").JSX.Element;
26
+ export default PostActionButton;
@@ -0,0 +1 @@
1
+ export { PostActionButton, type PostActionButtonProps } from "./PostActionButton";
@@ -8,7 +8,8 @@ interface CommentTileProps {
8
8
  searchQuery?: string;
9
9
  depth?: number;
10
10
  onVotedRefresh?: () => void;
11
- onClickCommentUpvote?: (comment: Discussion) => void;
11
+ /** When provided: called with (author, permlink, percent) on vote confirm; apiService.handleUpvote is never used. Token is ignored. */
12
+ onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
12
13
  onClickCommentReply?: (comment: Discussion) => void;
13
14
  onClickUpvoteButton?: (currentUser?: string, token?: string) => void;
14
15
  }
@@ -5,9 +5,12 @@ interface CommentsModalProps {
5
5
  onClose: () => void;
6
6
  currentUser?: string;
7
7
  token?: string;
8
- onClickCommentUpvote?: (comment: Discussion) => void;
8
+ /** Called with (author, permlink, percent) when user confirms comment upvote; frontend handles signing. */
9
+ onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
9
10
  onClickCommentReply?: (comment: Discussion) => void;
10
11
  onClickUpvoteButton?: (currentUser?: string, token?: string) => void;
12
+ /** When provided, used instead of apiService.handleComment (e.g. for aioha wallet) */
13
+ onSubmitComment?: (parentAuthor: string, parentPermlink: string, body: string) => Promise<void>;
11
14
  }
12
- declare const CommentsModal: ({ author, permlink, onClose, currentUser, token, onClickCommentUpvote, onClickCommentReply, onClickUpvoteButton }: CommentsModalProps) => import("react/jsx-runtime").JSX.Element;
15
+ declare const CommentsModal: ({ author, permlink, onClose, currentUser, token, onClickCommentUpvote, onClickCommentReply, onClickUpvoteButton, onSubmitComment }: CommentsModalProps) => import("react/jsx-runtime").JSX.Element;
13
16
  export default CommentsModal;
@@ -20,6 +20,7 @@ export { default as Modal } from './modals/Modal';
20
20
  export { UpvoteList } from './UpvoteList';
21
21
  export { CommentsList } from './CommentsList';
22
22
  export { default as CommentsModal } from './comments/CommentsModal';
23
+ export { PostActionButton, type PostActionButtonProps } from './actionButtons';
23
24
  export { default as UserAccount } from './user/UserAccount';
24
25
  export { default as UserFollowers } from './user/UserFollowers';
25
26
  export { default as UserFollowing } from './user/UserFollowing';