Add tipping feature to app. #391
Closed
hackrush01 wants to merge 0 commits from
tipping_button
into master
pull from: tipping_button
merge into: LBRYCommunity:master
LBRYCommunity:master
LBRYCommunity:dependabot/npm_and_yarn/electron-22.3.21
LBRYCommunity:dependabot/npm_and_yarn/semver-5.7.2
LBRYCommunity:7681-remove-block-list-apis
LBRYCommunity:new-sync-demo-no-user
LBRYCommunity:commentserver-swap-test-2
LBRYCommunity:Comment-server-swap
LBRYCommunity:7683-upgrade-to-electron-20
LBRYCommunity:7668-improve-startup-performance-while-fetching-comment-moderation-info
LBRYCommunity:feat-exportWalletSync
LBRYCommunity:feat-walletExport
LBRYCommunity:new-sync-demo
LBRYCommunity:test-updates4b
LBRYCommunity:test-updates-4a
LBRYCommunity:update-test-3c
LBRYCommunity:update-test-3b
LBRYCommunity:update-test-3
LBRYCommunity:test7495b2
LBRYCommunity:test7495a2
LBRYCommunity:test7495b
LBRYCommunity:test7495
LBRYCommunity:test109
LBRYCommunity:test-sdk-109
LBRYCommunity:feat-restoreLocalNotifications
LBRYCommunity:test-gatekeeper
LBRYCommunity:test-107
LBRYCommunity:test-mac-notarize
LBRYCommunity:update-postcss-quagmire
LBRYCommunity:testpush
LBRYCommunity:commentApiDefault
LBRYCommunity:inspect-upgrades
LBRYCommunity:fix-unblockIsChannelClaim
LBRYCommunity:ody255
LBRYCommunity:robd-mac-2
LBRYCommunity:sso-demo
LBRYCommunity:robd-universal
LBRYCommunity:remove-swap
LBRYCommunity:cleaning.dec.21
LBRYCommunity:update-trending-param
LBRYCommunity:collection-ordering
LBRYCommunity:download-progress
LBRYCommunity:anton
LBRYCommunity:anthony-fix-video-ios
LBRYCommunity:saltdev
LBRYCommunity:bump-electron-to-11
LBRYCommunity:fix-noBlockSubmitOnImgError
LBRYCommunity:x.lint.extras
LBRYCommunity:x.final
LBRYCommunity:somehow-working
LBRYCommunity:reenable-ads
LBRYCommunity:issue/7152
LBRYCommunity:chat-markdown
LBRYCommunity:ip/muted.uris
LBRYCommunity:odysee-split
LBRYCommunity:feat-desktopRelated
LBRYCommunity:ip/memo
LBRYCommunity:bs
LBRYCommunity:ip/memoization
LBRYCommunity:bump-flow-version
LBRYCommunity:ip/shared.block.list
LBRYCommunity:keycloak-sso
LBRYCommunity:a-r-w-k-2
LBRYCommunity:auth-refactor-w-keycloak
LBRYCommunity:auth-refactor
LBRYCommunity:rb-ip/embed-replay
LBRYCommunity:issue/2120
LBRYCommunity:oidc
LBRYCommunity:fix-videojs-ios
LBRYCommunity:fiat-tip-improvements
LBRYCommunity:test-tom-1
LBRYCommunity:fix-videojs-issues
LBRYCommunity:fix-persistSupportOption
LBRYCommunity:ctrl-txt
LBRYCommunity:add-play-button-on-pause-ios
LBRYCommunity:mobile-ui-bugfix-for-preview-images
LBRYCommunity:fix-livestream-claim-type
LBRYCommunity:playback-controls-2
LBRYCommunity:copy-list
LBRYCommunity:feat-collection-background-publishing
LBRYCommunity:ip/repost.in.homepage
LBRYCommunity:wallet-iteration-2
LBRYCommunity:broken-ads-branch
LBRYCommunity:move-stripe-transactions-to-wallet-fix
LBRYCommunity:lint.autoformat
LBRYCommunity:jessop-stripe
LBRYCommunity:move-transactions
LBRYCommunity:stripe-move-transactions-to-wallet
LBRYCommunity:mater
LBRYCommunity:more-stripe-integration
LBRYCommunity:more-stripe-integration1
LBRYCommunity:desktop-redirect
LBRYCommunity:rss-test
LBRYCommunity:fixed-collectionEdit
LBRYCommunity:watchman-plugin-odysee-anthony
LBRYCommunity:grin
LBRYCommunity:watchman-plugin-odysee
LBRYCommunity:protocol
LBRYCommunity:salt_saved_list
LBRYCommunity:salt-saved_list
LBRYCommunity:watchman-plugin
LBRYCommunity:more-stripe-integration2
LBRYCommunity:salt-savedList
LBRYCommunity:salt/mobile-comments
LBRYCommunity:chromecast-test2
LBRYCommunity:odysee
LBRYCommunity:wpe-on-ody
LBRYCommunity:bring-back-subtitles-button
LBRYCommunity:merge-to-odysee
LBRYCommunity:bugfix-tip-error
LBRYCommunity:popup-fix
LBRYCommunity:favi-cherry
LBRYCommunity:searchDefaults
LBRYCommunity:pin-from-homepages-master
LBRYCommunity:ody-7-22-c
LBRYCommunity:ody-7-22-b
LBRYCommunity:ody-7-22
LBRYCommunity:ody-7-21
LBRYCommunity:cherry.pick.thumbs.fix
LBRYCommunity:ody-rb-7-20c
LBRYCommunity:test-chromecast
LBRYCommunity:ody-7-20-rb
LBRYCommunity:odysee-cnsearch
LBRYCommunity:ody-7-19-b
LBRYCommunity:anthony-odysee
LBRYCommunity:drewhancock-patch-2
LBRYCommunity:horizon-server
LBRYCommunity:feat-nicer-outages
LBRYCommunity:tech-debt/selectors-search
LBRYCommunity:fix-lbry-tv-thumbnails
LBRYCommunity:drewhancock-patch-1
LBRYCommunity:jbnrecsys
LBRYCommunity:feat/disableListEditPending
LBRYCommunity:testapi
LBRYCommunity:bump-lightouse-throttle
LBRYCommunity:popup
LBRYCommunity:replays-rebased-tom
LBRYCommunity:pre-reoll-ads-rebase
LBRYCommunity:julianchandra-patch-1
LBRYCommunity:feat/better-chat
LBRYCommunity:revert-livestream
LBRYCommunity:feat/code-splitting
LBRYCommunity:feat/go-live-forms
LBRYCommunity:UI/drop-down-menu-animation
LBRYCommunity:faster-builds
No reviewers
Labels
Clear labels
Work is part of a proposal
Beamer is waiting on you!
Discuss this issue at the next planning meeting, then remove this label
Welcome to Hacktoberfest
Long-term storage
No knowledge of the existing code required
Some knowledge of the existing code is recommended
Significant knowledge of the existing code is recommended
Intimate knowledge of the existing code is recommended
Solution unclear, needs research
Issue needs to be groomed before work can start
Priority level needs to be defined
Issue needs step-by-step instructions on how to reproduce in latest code
Needs technical design signoff before implementation can begin
Temporarily paused
Issue is blocking release, do ASAP
Work needs to be moved into sprint ASAP
Work should be done but can stay in the backlog for now
Work needs to be done within 2-3 sprints
general redesign not prioritize for anyone release
Requires work on lbry-sdk repo
Existing functionality is wrong or broken
A conversation. No specific changes requested
Existing (or partially existing) functionality needs to be changed
New functionality that does not exist yet
Minimal user-visible changes, but significant internal work
Either work that's not related to the code, or a small chore that does not fit into other categories
Solution needs additional user testing
Work that was not planned into the spirnt, took priority over planned work
accessibility
app-parity
area: creator
area: daemon
area: design
area: devops
area: discovery
area: docs
area: installer
area: internal
area: livestream
area: performance
area: proposal
Work is part of a proposal
area: reposts
area: rewards
area: search
area: security
area: subscriptions
area: sync
area: ux
area: viewer
area: wallet
BEAMER
Beamer is waiting on you!
channel
comments
community PR
consider soon
Discuss this issue at the next planning meeting, then remove this label
core team
css
dependencies
electron
Epic
feature request
first-timers-only
good first issue
hacktoberfest
Welcome to Hacktoberfest
help wanted
hub-dependent
icebox
Long-term storage
Invalid
level: 0
level: 1
No knowledge of the existing code required
level: 2
Some knowledge of the existing code is recommended
level: 3
Significant knowledge of the existing code is recommended
level: 4
Intimate knowledge of the existing code is recommended
merge when green
needs: exploration
Solution unclear, needs research
needs: grooming
Issue needs to be groomed before work can start
needs: priority
Priority level needs to be defined
needs: repro
Issue needs step-by-step instructions on how to reproduce in latest code
needs: tech design
Needs technical design signoff before implementation can begin
notifications
odysee
on hold
Temporarily paused
playlists
priority: blocker
Issue is blocking release, do ASAP
priority: high
Work needs to be moved into sprint ASAP
priority: low
Work should be done but can stay in the backlog for now
priority: medium
Work needs to be done within 2-3 sprints
protocol dependent
recsys
redesign
general redesign not prioritize for anyone release
regression
resilience
sdk dependent
Requires work on lbry-sdk repo
Tom's Wishlist
trending
type: bug
Existing functionality is wrong or broken
type: discussion
A conversation. No specific changes requested
type: improvement
Existing (or partially existing) functionality needs to be changed
type: new feature
New functionality that does not exist yet
type: refactor
Minimal user-visible changes, but significant internal work
type: task
Either work that's not related to the code, or a small chore that does not fit into other categories
type: testing
Solution needs additional user testing
unplanned
Work that was not planned into the spirnt, took priority over planned work
windows
No labels
accessibility
app-parity
area: creator
area: daemon
area: design
area: devops
area: discovery
area: docs
area: installer
area: internal
area: livestream
area: performance
area: proposal
area: reposts
area: rewards
area: search
area: security
area: subscriptions
area: sync
area: ux
area: viewer
area: wallet
BEAMER
channel
comments
community PR
consider soon
core team
css
dependencies
electron
Epic
feature request
first-timers-only
good first issue
hacktoberfest
help wanted
hub-dependent
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
merge when green
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
notifications
odysee
on hold
playlists
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
recsys
redesign
regression
resilience
sdk dependent
Tom's Wishlist
trending
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
windows
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-desktop#391
Reference in a new issue
No description provided.
Delete branch "tipping_button"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
FileActions
component, from a new component file.gift
For issue #355
New list copied from below to track
wallet_send
API commandFilePage
instead ofFileActions
ExtractWallet_Send
form and use that for tipping instead of theFormFieldPrice
as one can tip in LBC onlyBorrow things fromtip_and_supports
branch?????? (Not at sure what to do with that)Transaction List
with columns for types of transaction(Support, claim, update, unbound), a link to claim if applicable(this might need some changes depending on how lbryio/lbryum#148 goes)Changed for consistency
First set of feedback.
If these source values are shared across forms, could this cause any weird behavior?
All of the tip box logic should be it's own component.
We've also changed the way modals work to use constants. I also think this code was copy and pasted, which is a sign it ought to be refactored. These should probably be moved into
app/view.jsx
.You can see the FIRST_REWARD modal here for reference
29553bc391
Shouldn't this should be obtainable from the URI without being passed in?
I'm unsure. This might need some testing/confirmation from your side. Although to make an educated guess, we are dispatching states in
doSendDraftTransactions
, so it must be to avoid these weird behaviour. But I am not sure if that's how it works.It is(by resolving it). But I think re-resolving the same URL, would be a useless overhead, when we could simply use an existing data-set. This also helps the app to remain fast and fluid in its operation. I suggest keeping this as is. What's your stance on this?
I will look into it.
Ok. I'll do it.
That's how it was originally done(the modal one), but I got confused with "add button to
fileActions
" part. A slight misinterpretation on my part.Updated task list to reflect the review.
More feedback.
Let's drop this modal and replace with a snackbar showing:
You sent ${amount} LBC. [History]
History is a link to the Transaction History page.
@ -169,1 +177,4 @@
icon="icon-gift"
onClick={this.handleSupportButtonClicked.bind(this)}
/>
{showMenu
This should hide everything else in this component when activated.
Just "Tip"
And move inside of the "..." menu button
All of this modal code can be dropped from here now.
Turn this into a snackbar (mentioned elsewhere).
An LBC/USD input now appears:
It should probably just be turned into it's own component.
Are you sure an actual second resolve is triggered? I.e. is an API call actually made or are you just seeing the action dispatch?
Either way, the claim shouldn't be passed. If we are doing an unnecessary extra resolve, that should be fixed elsewhere.
Ok
You mean inside the drop-down menu after open?
Not quite sure what you mean by this. Please elaborate.
A text input coupled with an LBC/USD select box appears in a few places. This adds another place it should appear (even though you did it without the currency select).
I was proposing that the text input and lbc/usd select could become it's own component, then that component could be used in all 3 places.
I've added this css, is this okay?
Done, now it is being done using selectors in the FileActions
@ -169,1 +177,4 @@
icon="icon-gift"
onClick={this.handleSupportButtonClicked.bind(this)}
/>
{showMenu
Done
Done
Done
Done, please check slack
done
Done
Done
Done
More feedback.
@ -169,2 +178,4 @@
onClick={this.handleSupportButtonClicked.bind(this)}
/>
{showMenu
? <div className="button-set-item">
This shouldn't get rendered here.
I think it probably needs to go into
FilePage
.It's fine for this to be
this.props.sendSupport(claim_id, amount)
.Please review React docs on controlled and uncontrolled components. I suspect this may not reset to defaults the way you expect.
defaultValue
can only be used when rendering the element for the first time.@ -193,0 +193,4 @@
reducers[types.SUPPORT_TRANSACTION_STARTED] = function(state, action) {
const newSupportTransaction = Object.assign({}, state.supportTransaction, {
sendingSupport: true,
});
All of this can be simplified by having the component send these values directly to the action, unless I'm missing the need for these to be in Redux state.
@ -169,2 +178,4 @@
onClick={this.handleSupportButtonClicked.bind(this)}
/>
{showMenu
? <div className="button-set-item">
Yes, UI changes will be made in subsequent commits. I have a list of them.
Amount's value in store is needed for this
As for
claim_id
; currently it being passed as a prop here, which was possible due to having theclaimInfo
in FileActions, but since this component will be moved toFilePage
,claim_id
(for support) will be set during the loading of the page by directly fetching the values from the store(FETCH_FILE_INFO_COMPLETED
action to be specific). Seems to me a neater and React way of doing this. Also it will ensure no redundant data is being passed between the components.As far as I understood by reading the docs, controlled components are not a problem, so long all of them have associated
setState
handlers, as the component will re-render. So I'm inclined to keep it here.But If you have some particular scenario in mind, I'll be happy to test it out though.
@ -193,0 +193,4 @@
reducers[types.SUPPORT_TRANSACTION_STARTED] = function(state, action) {
const newSupportTransaction = Object.assign({}, state.supportTransaction, {
sendingSupport: true,
});
Clarified in first comment, above.
wallet_send
API commandFilePage
instead ofFileActions
ExtractWallet_Send
form and use that for tipping instead of theFormFieldPrice
as one can tip in LBC onlyBorrow things fromtip_and_supports
branch?????? (Not at sure what to do with that)Transaction List
with columns for types of transaction(Support, claim, update, unbound), a link to claim if applicable(this might need some changes depending on how lbryio/lbryum#148 goes)Made the merge to master, definitely must have broken something.
@hackrush01 there are changes in master that affect the
TransactionList
component. I'd advise rebasing this onto master before continuing.@kauffj Ok, I'll look into it.
@ -12,0 +43,4 @@
onChange={this.handleFilterChanged.bind(this)}
>
<option value="unfiltered">{__("All")}</option>
<option value="claim">{__("Publishes")}</option>
I was not sure about the css part so I left it as is.
Ran the latest today. Here's what ought to change. It might seem long but it's all very minor -- very close to shippable.
Tipping
FileActions
(description and report I noticed stay)<p>
) with a link to lbry.io/faq/tipping (to be created). First draft: "Support the creator and the success of their content by sending a tip. <a>Learn more.</a>"Transaction List
TransactionTableXXX
probably ought to be moved into aninternal
folder inside ofTransactionList
, since they are strongly tied to this component rather than likely to be used individually. See theVideo
component for an example of this.CreditAmount
components in the table (i.e.label=false
).See above.
Pull request closed