hive-react-kit 0.4.8 → 0.5.0
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/README.md +115 -0
- package/dist/build.css +600 -20
- package/dist/components/actionButtons/PostActionButton.d.ts +11 -2
- package/dist/components/landing-page/HiveContributionsLanding.d.ts +1 -0
- package/dist/components/user/UserDetailProfile.d.ts +35 -0
- package/dist/index.cjs.js +112 -111
- package/dist/index.d.ts +8 -2
- package/dist/index.esm.js +11404 -9678
- package/dist/pages/UserDetailProfilePage.d.ts +2 -0
- package/dist/services/userService.d.ts +70 -6
- package/dist/types/poll.d.ts +64 -0
- package/dist/types/reward.d.ts +22 -0
- package/package.json +1 -1
|
@@ -1,10 +1,19 @@
|
|
|
1
|
+
import { ActiveVote } from "@/types/video";
|
|
1
2
|
export interface PostActionButtonProps {
|
|
2
3
|
author: string;
|
|
3
4
|
permlink: string;
|
|
4
5
|
/** Current logged-in username; null or '' means not logged in */
|
|
5
6
|
currentUser?: string | null;
|
|
6
|
-
/** Optional: Hive value to display (string
|
|
7
|
+
/** Optional: Hive value to display (numeric string, e.g. "8.500") */
|
|
7
8
|
hiveValue?: string;
|
|
9
|
+
/** Optional: URL to a Hive logo icon shown next to the payout value */
|
|
10
|
+
hiveIconUrl?: string;
|
|
11
|
+
/** Optional: Tooltip text shown on hover over the payout value (e.g. payout breakdown) */
|
|
12
|
+
payoutTooltip?: string;
|
|
13
|
+
/** Optional: Pre-loaded active votes array from the Post object. Skips the API call when provided. */
|
|
14
|
+
initialVotes?: ActiveVote[];
|
|
15
|
+
/** Optional: Pre-loaded comments count from the Post object (item.children). Skips the API call when provided. */
|
|
16
|
+
initialCommentsCount?: number;
|
|
8
17
|
/** Called when user confirms vote with percent (1–100). Frontend handles signing/broadcast. */
|
|
9
18
|
onUpvote?: (percent: number) => void | Promise<void>;
|
|
10
19
|
/** Called when user submits a comment. Frontend handles signing/broadcast. */
|
|
@@ -22,5 +31,5 @@ export interface PostActionButtonProps {
|
|
|
22
31
|
/** Called when user confirms comment upvote with (author, permlink, percent). Frontend handles signing. Voted comments show icon in blue. */
|
|
23
32
|
onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
|
|
24
33
|
}
|
|
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;
|
|
34
|
+
export declare function PostActionButton({ author, permlink, currentUser: currentUserProp, hiveValue, hiveIconUrl, payoutTooltip, initialVotes, initialCommentsCount, onUpvote, onSubmitComment, onComments, onReblog, onShare, onTip, onReport, onClickCommentUpvote, }: PostActionButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
26
35
|
export default PostActionButton;
|
|
@@ -13,6 +13,7 @@ interface HiveContributionsLandingProps {
|
|
|
13
13
|
isDividerShow?: boolean;
|
|
14
14
|
dividerColor?: string;
|
|
15
15
|
isExpensesCTA?: boolean;
|
|
16
|
+
onViewExpenses?: () => void;
|
|
16
17
|
extraSupporters?: SupporterItem[];
|
|
17
18
|
}
|
|
18
19
|
declare const HiveContributionsLanding: React.FC<HiveContributionsLandingProps>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface UserDetailProfileProps {
|
|
3
|
+
username: string;
|
|
4
|
+
currentUsername?: string;
|
|
5
|
+
onBack?: () => void;
|
|
6
|
+
showBackButton?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Controls which tabs are shown and their order.
|
|
9
|
+
* Only tabs listed here will be visible, in the order provided.
|
|
10
|
+
* The first tab becomes the default active tab.
|
|
11
|
+
* If omitted, all tabs are shown in default order.
|
|
12
|
+
* Example: `["followers", "following", "blogs", "wallet"]` — only these 4 tabs, in this order.
|
|
13
|
+
*/
|
|
14
|
+
tabShown?: TabType[];
|
|
15
|
+
onFollow?: (username: string) => void | Promise<void>;
|
|
16
|
+
onUnfollow?: (username: string) => void | Promise<void>;
|
|
17
|
+
onIgnoreAuthor?: (username: string) => void | Promise<void>;
|
|
18
|
+
onReportUser?: (username: string, reason: string) => void | Promise<void>;
|
|
19
|
+
onUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
|
|
20
|
+
onSubmitComment?: (parentAuthor: string, parentPermlink: string, body: string) => void | Promise<void>;
|
|
21
|
+
onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
|
|
22
|
+
onReblog?: (author: string, permlink: string) => void;
|
|
23
|
+
onTip?: (author: string, permlink: string) => void;
|
|
24
|
+
onReportPost?: (author: string, permlink: string) => void;
|
|
25
|
+
onUserClick?: (username: string) => void;
|
|
26
|
+
onPostClick?: (author: string, permlink: string, title: string) => void;
|
|
27
|
+
onSnapClick?: (author: string, permlink: string) => void;
|
|
28
|
+
onPollClick?: (author: string, permlink: string, question: string) => void;
|
|
29
|
+
onActivityPermlink?: (author: string, permlink: string) => void;
|
|
30
|
+
onActivitySelect?: (activity: any) => void;
|
|
31
|
+
onShare?: (username: string) => void;
|
|
32
|
+
}
|
|
33
|
+
type TabType = "blogs" | "posts" | "snaps" | "polls" | "comments" | "replies" | "activities" | "authorRewards" | "curationRewards" | "followers" | "following" | "wallet";
|
|
34
|
+
declare const UserDetailProfile: React.FC<UserDetailProfileProps>;
|
|
35
|
+
export default UserDetailProfile;
|