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