2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2022-02-17 10:19:22 +01:00
|
|
|
import { doSetContentHistoryItem, doSetPrimaryUri, clearPosition } from 'redux/actions/content';
|
2021-08-10 16:38:53 +02:00
|
|
|
import { withRouter } from 'react-router-dom';
|
2021-01-08 16:21:27 +01:00
|
|
|
import {
|
2021-11-16 02:10:03 +01:00
|
|
|
selectClaimIsNsfwForUri,
|
2021-02-04 06:45:49 +01:00
|
|
|
makeSelectTagInClaimOrChannelForUri,
|
2021-11-16 04:52:35 +01:00
|
|
|
selectIsStreamPlaceholderForUri,
|
2022-02-05 13:06:19 +01:00
|
|
|
selectClaimForUri,
|
2022-04-20 15:12:32 +02:00
|
|
|
selectClaimWasPurchasedForUri,
|
2021-10-17 10:36:14 +02:00
|
|
|
} from 'redux/selectors/claims';
|
|
|
|
import { makeSelectFileInfoForUri } from 'redux/selectors/file_info';
|
|
|
|
import { makeSelectCollectionForId } from 'redux/selectors/collections';
|
|
|
|
import * as COLLECTIONS_CONSTS from 'constants/collections';
|
Re-design comment threads (#1489)
* Redesign threadline and fetching state
- threadline goes right below channel avatar, mimicking reddits implementation, has a increase effect on hover and is slimmer, creating more space for comments on screen
- fetching state now replaces show/hide button, also mimicking reddit, and now says that it is loading, instead of a blank spinner, and also improves space a bit
* Redesign comment threads
- Allow for infinite comment chains
- Can go back and forth between the pages
- Can go back to all comments or to the first comment in the chain
- Some other improvements, which include:
- add title on non-drawer comment sections (couldn't see amount of comments)
- fix Expandable component (would begin expanded and collapse after the effect runs, which looked bad and shifted the layout, now each comments greater than the set length begins collapsed)
- used constants for consistency
* Fix replying to last thread comment
* Fix buttons condition (only on fetched comment to avoid deleted case)
* Fix auto-scroll
* Bring back instant feedback for Show More replies
* Improve thread back links
- Now going back to all comments links the top-level comment for easier navigation
- Going back to ~ previous ~ now goes back into the chain instead of topmost level
* Clear timeouts due to unrelated issue
* Fix deep thread linked comment case and more scroll improvements
* More minor changes
* Flow
* Fix commentList tile style
* Fix long channel names overflowing on small screens
* More scroll changes
* Fix threadline
* Revert "Fix long channel names overflowing on small screens"
This reverts commit e4d2dc7da5861ed8136a60f3352e41a690cd4d33.
* Fix replies fetch
* Revert "Fix replies fetch"
This reverts commit ec70054675a604a7a5f3764ba07c36bf7b0f49c8.
* Cleanup and make smooth
* Always use linked comment on threads
* Cleanup
* Higlight thread comment
* Fix comment body styles
2022-05-16 12:22:13 +02:00
|
|
|
import { LINKED_COMMENT_QUERY_PARAM, THREAD_COMMENT_QUERY_PARAM } from 'constants/comment';
|
2021-10-17 10:36:14 +02:00
|
|
|
import * as SETTINGS from 'constants/settings';
|
2021-11-19 03:40:01 +01:00
|
|
|
import { selectCostInfoForUri, doFetchCostInfoForUri } from 'lbryinc';
|
2021-11-23 05:29:04 +01:00
|
|
|
import { selectShowMatureContent, selectClientSetting } from 'redux/selectors/settings';
|
2022-04-01 10:18:51 +02:00
|
|
|
import { makeSelectFileRenderModeForUri, selectContentPositionForUri } from 'redux/selectors/content';
|
2022-03-11 05:11:01 +01:00
|
|
|
import { selectCommentsListTitleForUri, selectSettingsByChannelId } from 'redux/selectors/comments';
|
2021-02-05 00:00:07 +01:00
|
|
|
import { DISABLE_COMMENTS_TAG } from 'constants/tags';
|
2022-04-04 14:13:15 +02:00
|
|
|
import { doToggleAppDrawer } from 'redux/actions/app';
|
2022-02-05 13:06:19 +01:00
|
|
|
import { getChannelIdFromClaim } from 'util/claim';
|
2022-04-20 15:12:32 +02:00
|
|
|
import { doFileGet } from 'redux/actions/file';
|
2021-02-05 00:00:07 +01:00
|
|
|
|
2020-11-02 17:51:08 +01:00
|
|
|
import FilePage from './view';
|
2017-04-24 09:25:27 +02:00
|
|
|
|
2020-08-24 19:35:21 +02:00
|
|
|
const select = (state, props) => {
|
2022-02-01 21:27:48 +01:00
|
|
|
const { uri } = props;
|
|
|
|
const { search } = location;
|
|
|
|
|
2020-08-24 19:35:21 +02:00
|
|
|
const urlParams = new URLSearchParams(search);
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
const collectionId = urlParams.get(COLLECTIONS_CONSTS.COLLECTION_ID);
|
2022-02-05 13:06:19 +01:00
|
|
|
const claim = selectClaimForUri(state, uri);
|
2020-08-24 19:35:21 +02:00
|
|
|
|
|
|
|
return {
|
2022-02-05 13:06:19 +01:00
|
|
|
channelId: getChannelIdFromClaim(claim),
|
Re-design comment threads (#1489)
* Redesign threadline and fetching state
- threadline goes right below channel avatar, mimicking reddits implementation, has a increase effect on hover and is slimmer, creating more space for comments on screen
- fetching state now replaces show/hide button, also mimicking reddit, and now says that it is loading, instead of a blank spinner, and also improves space a bit
* Redesign comment threads
- Allow for infinite comment chains
- Can go back and forth between the pages
- Can go back to all comments or to the first comment in the chain
- Some other improvements, which include:
- add title on non-drawer comment sections (couldn't see amount of comments)
- fix Expandable component (would begin expanded and collapse after the effect runs, which looked bad and shifted the layout, now each comments greater than the set length begins collapsed)
- used constants for consistency
* Fix replying to last thread comment
* Fix buttons condition (only on fetched comment to avoid deleted case)
* Fix auto-scroll
* Bring back instant feedback for Show More replies
* Improve thread back links
- Now going back to all comments links the top-level comment for easier navigation
- Going back to ~ previous ~ now goes back into the chain instead of topmost level
* Clear timeouts due to unrelated issue
* Fix deep thread linked comment case and more scroll improvements
* More minor changes
* Flow
* Fix commentList tile style
* Fix long channel names overflowing on small screens
* More scroll changes
* Fix threadline
* Revert "Fix long channel names overflowing on small screens"
This reverts commit e4d2dc7da5861ed8136a60f3352e41a690cd4d33.
* Fix replies fetch
* Revert "Fix replies fetch"
This reverts commit ec70054675a604a7a5f3764ba07c36bf7b0f49c8.
* Cleanup and make smooth
* Always use linked comment on threads
* Cleanup
* Higlight thread comment
* Fix comment body styles
2022-05-16 12:22:13 +02:00
|
|
|
linkedCommentId: urlParams.get(LINKED_COMMENT_QUERY_PARAM),
|
|
|
|
threadCommentId: urlParams.get(THREAD_COMMENT_QUERY_PARAM),
|
2022-02-01 21:27:48 +01:00
|
|
|
costInfo: selectCostInfoForUri(state, uri),
|
2020-08-24 19:35:21 +02:00
|
|
|
obscureNsfw: !selectShowMatureContent(state),
|
2022-02-01 21:27:48 +01:00
|
|
|
isMature: selectClaimIsNsfwForUri(state, uri),
|
|
|
|
fileInfo: makeSelectFileInfoForUri(uri)(state),
|
|
|
|
renderMode: makeSelectFileRenderModeForUri(uri)(state),
|
2021-11-23 05:29:04 +01:00
|
|
|
videoTheaterMode: selectClientSetting(state, SETTINGS.VIDEO_THEATER_MODE),
|
2022-02-05 13:06:19 +01:00
|
|
|
contentCommentsDisabled: makeSelectTagInClaimOrChannelForUri(uri, DISABLE_COMMENTS_TAG)(state),
|
|
|
|
settingsByChannelId: selectSettingsByChannelId(state),
|
2022-02-01 21:27:48 +01:00
|
|
|
isLivestream: selectIsStreamPlaceholderForUri(state, uri),
|
|
|
|
hasCollectionById: Boolean(makeSelectCollectionForId(collectionId)(state)),
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
collectionId,
|
2022-04-01 10:18:51 +02:00
|
|
|
position: selectContentPositionForUri(state, uri),
|
2022-04-01 15:32:58 +02:00
|
|
|
audioVideoDuration: claim?.value?.video?.duration || claim?.value?.audio?.duration,
|
2022-03-11 05:11:01 +01:00
|
|
|
commentsListTitle: selectCommentsListTitleForUri(state, uri),
|
2022-04-20 15:12:32 +02:00
|
|
|
claimWasPurchased: selectClaimWasPurchasedForUri(state, uri),
|
2020-08-24 19:35:21 +02:00
|
|
|
};
|
|
|
|
};
|
2017-04-24 09:25:27 +02:00
|
|
|
|
2022-02-01 21:27:48 +01:00
|
|
|
const perform = {
|
|
|
|
doFetchCostInfoForUri,
|
|
|
|
doSetContentHistoryItem,
|
|
|
|
doSetPrimaryUri,
|
|
|
|
clearPosition,
|
2022-04-04 14:13:15 +02:00
|
|
|
doToggleAppDrawer,
|
2022-04-20 15:12:32 +02:00
|
|
|
doFileGet,
|
2022-02-01 21:27:48 +01:00
|
|
|
};
|
2017-04-24 09:25:27 +02:00
|
|
|
|
2020-08-24 19:35:21 +02:00
|
|
|
export default withRouter(connect(select, perform)(FilePage));
|