hive-react-kit 0.4.9 → 0.5.1

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 CHANGED
@@ -74,12 +74,133 @@ import type { Video, Comment, Wallet as WalletType } from 'hive-react-kit/types'
74
74
 
75
75
  ### User Components
76
76
 
77
+ - **UserDetailProfile** - Full-featured user profile with 12 configurable tabs, action callbacks, and infinite scroll
77
78
  - **UserAccount** - User account management
78
79
  - **UserProfilePage** - User profile page
79
80
  - **UserInfo** - User information display
80
81
  - **UserFollowers** - User followers list
81
82
  - **UserFollowing** - User following list
82
83
 
84
+ #### UserDetailProfile Usage
85
+
86
+ ```tsx
87
+ import { UserDetailProfile } from 'hive-react-kit';
88
+
89
+ // All tabs, default order, with rich comment composer
90
+ <UserDetailProfile
91
+ username="sagarkothari88"
92
+ currentUsername="myaccount"
93
+ showBackButton
94
+ ecencyToken="your-ecency-token"
95
+ threeSpeakApiKey="your-3speak-api-key"
96
+ giphyApiKey="your-giphy-api-key"
97
+ onBack={() => navigate(-1)}
98
+ onFollow={(user) => console.log("Follow:", user)}
99
+ onUnfollow={(user) => console.log("Unfollow:", user)}
100
+ onPostClick={(author, permlink, title) => navigate(`/post/${author}/${permlink}`)}
101
+ onUserClick={(user) => navigate(`/profile/${user}`)}
102
+ />
103
+
104
+ // Custom tabs: only show 4 tabs, Wallet first
105
+ <UserDetailProfile
106
+ username="sagarkothari88"
107
+ tabShown={["wallet", "blogs", "followers", "following"]}
108
+ onPostClick={(author, permlink) => console.log(author, permlink)}
109
+ />
110
+ ```
111
+
112
+ #### UserDetailProfile Props
113
+
114
+ | Prop | Type | Default | Description |
115
+ |------|------|---------|-------------|
116
+ | `username` | `string` | *required* | Hive username to display |
117
+ | `currentUsername` | `string` | `undefined` | Logged-in user's username. Enables follow/unfollow and action menu |
118
+ | `showBackButton` | `boolean` | `false` | Show back arrow in header |
119
+ | `onBack` | `() => void` | - | Callback when back button is clicked |
120
+ | `tabShown` | `TabType[]` | all tabs | Controls which tabs are visible and their order. Only listed tabs are shown. First tab is the default active tab. If omitted, all 12 tabs are shown in default order |
121
+ | `ecencyToken` | `string` | `undefined` | Ecency image hosting token. Enables image upload and video thumbnail upload in the comment composer. When not provided, the image upload button is hidden |
122
+ | `threeSpeakApiKey` | `string` | `undefined` | 3Speak API key. Enables audio recording/upload and video upload in the comment composer. When not provided, audio and video buttons are hidden |
123
+ | `giphyApiKey` | `string` | `undefined` | GIPHY API key. Enables GIF search in the comment composer. When not provided, the GIF button is hidden |
124
+
125
+ **Social Action Callbacks**
126
+
127
+ | Prop | Type | Description |
128
+ |------|------|-------------|
129
+ | `onFollow` | `(username: string) => void` | Called when Follow is clicked from the action menu |
130
+ | `onUnfollow` | `(username: string) => void` | Called when Unfollow is clicked from the action menu |
131
+ | `onIgnoreAuthor` | `(username: string) => void` | Called when Ignore Author is confirmed |
132
+ | `onReportUser` | `(username: string, reason: string) => void` | Called when Report is submitted with selected reason |
133
+
134
+ **Post Action Callbacks (via PostActionButton)**
135
+
136
+ | Prop | Type | Description |
137
+ |------|------|-------------|
138
+ | `onUpvote` | `(author: string, permlink: string, percent: number) => void` | Called when a post/comment is upvoted via the vote slider |
139
+ | `onSubmitComment` | `(parentAuthor: string, parentPermlink: string, body: string) => void` | Called when a comment is submitted |
140
+ | `onClickCommentUpvote` | `(author: string, permlink: string, percent: number) => void` | Called when a comment inside the comments modal is upvoted |
141
+ | `onReblog` | `(author: string, permlink: string) => void` | Called when reblog is clicked |
142
+ | `onTip` | `(author: string, permlink: string) => void` | Called when tip is clicked |
143
+ | `onReportPost` | `(author: string, permlink: string) => void` | Called when a post is reported |
144
+
145
+ **Navigation Callbacks**
146
+
147
+ | Prop | Type | Description |
148
+ |------|------|-------------|
149
+ | `onUserClick` | `(username: string) => void` | Called when a user avatar/name is clicked (followers, following, etc.) |
150
+ | `onPostClick` | `(author: string, permlink: string, title: string) => void` | Called when a blog/post/reward row is clicked |
151
+ | `onSnapClick` | `(author: string, permlink: string) => void` | Called when a snap item is clicked |
152
+ | `onPollClick` | `(author: string, permlink: string, question: string) => void` | Called when a poll item is clicked |
153
+ | `onActivityPermlink` | `(author: string, permlink: string) => void` | Called when an activity permlink is clicked |
154
+ | `onActivitySelect` | `(activity: any) => void` | Called when an activity item is selected |
155
+ | `onShare` | `(username: string) => void` | Called when the share button is clicked |
156
+
157
+ #### TabType Values
158
+
159
+ The `tabShown` prop accepts an array of these values:
160
+
161
+ | Value | Tab Label | Description |
162
+ |-------|-----------|-------------|
163
+ | `"blogs"` | Blogs | User's blog posts (reblogs included) |
164
+ | `"posts"` | Posts | User's original posts |
165
+ | `"snaps"` | Snaps | User's snaps from PeakD |
166
+ | `"polls"` | Polls | User's polls from HiveHub |
167
+ | `"comments"` | Comments | User's comments |
168
+ | `"replies"` | Replies | Replies to the user |
169
+ | `"activities"` | Activities | User's activity history |
170
+ | `"authorRewards"` | Author Rewards | Pending author rewards (posts/comments with upcoming payouts) |
171
+ | `"curationRewards"` | Curation Rewards | Pending curation rewards (estimated from vote history) |
172
+ | `"followers"` | Followers | User's followers list |
173
+ | `"following"` | Following | Accounts the user follows |
174
+ | `"wallet"` | Wallet | User's HIVE/HBD/HP balances |
175
+
176
+ #### tabShown Examples
177
+
178
+ ```tsx
179
+ // Show all tabs (default when tabShown is omitted)
180
+ <UserDetailProfile username="user" />
181
+
182
+ // Only Blogs and Wallet
183
+ <UserDetailProfile username="user" tabShown={["blogs", "wallet"]} />
184
+
185
+ // Followers first, then Blogs, then Wallet — no other tabs
186
+ <UserDetailProfile
187
+ username="user"
188
+ tabShown={["followers", "following", "blogs", "wallet"]}
189
+ />
190
+
191
+ // Everything except Snaps and Polls
192
+ <UserDetailProfile
193
+ username="user"
194
+ tabShown={[
195
+ "blogs", "posts", "comments", "replies",
196
+ "activities", "authorRewards", "curationRewards",
197
+ "followers", "following", "wallet"
198
+ ]}
199
+ />
200
+ ```
201
+
202
+ See [docs/UserDetailProfile.md](docs/UserDetailProfile.md) for full documentation including all callbacks, tab types, streaming behavior, and styling details.
203
+
83
204
  ### Toolbar Component
84
205
 
85
206
  - **HiveToolbar** - A fixed bottom toolbar showcasing Hive ecosystem apps and witness voting links. Responsive across mobile, tablet, and desktop.