Fixes
This commit is contained in:
parent
1f367c641e
commit
0394211021
7 changed files with 26 additions and 15 deletions
|
@ -13,7 +13,11 @@ import * as COLLECTIONS_CONSTS from 'constants/collections';
|
||||||
import * as SETTINGS from 'constants/settings';
|
import * as SETTINGS from 'constants/settings';
|
||||||
import { selectCostInfoForUri, doFetchCostInfoForUri } from 'lbryinc';
|
import { selectCostInfoForUri, doFetchCostInfoForUri } from 'lbryinc';
|
||||||
import { selectShowMatureContent, selectClientSetting } from 'redux/selectors/settings';
|
import { selectShowMatureContent, selectClientSetting } from 'redux/selectors/settings';
|
||||||
import { makeSelectFileRenderModeForUri, makeSelectContentPositionForUri } from 'redux/selectors/content';
|
import {
|
||||||
|
makeSelectFileRenderModeForUri,
|
||||||
|
makeSelectContentPositionForUri,
|
||||||
|
makeSelectIsUriCurrentlyPlaying,
|
||||||
|
} from 'redux/selectors/content';
|
||||||
import { makeSelectCommentsListTitleForUri, selectSettingsByChannelId } from 'redux/selectors/comments';
|
import { makeSelectCommentsListTitleForUri, selectSettingsByChannelId } from 'redux/selectors/comments';
|
||||||
import { DISABLE_COMMENTS_TAG } from 'constants/tags';
|
import { DISABLE_COMMENTS_TAG } from 'constants/tags';
|
||||||
import { doSetMobilePlayerDimensions } from 'redux/actions/app';
|
import { doSetMobilePlayerDimensions } from 'redux/actions/app';
|
||||||
|
@ -45,6 +49,7 @@ const select = (state, props) => {
|
||||||
collectionId,
|
collectionId,
|
||||||
position: makeSelectContentPositionForUri(uri)(state),
|
position: makeSelectContentPositionForUri(uri)(state),
|
||||||
commentsListTitle: makeSelectCommentsListTitleForUri(uri)(state),
|
commentsListTitle: makeSelectCommentsListTitleForUri(uri)(state),
|
||||||
|
isPlaying: makeSelectIsUriCurrentlyPlaying(uri)(state),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ type Props = {
|
||||||
position: number,
|
position: number,
|
||||||
commentsListTitle: string,
|
commentsListTitle: string,
|
||||||
settingsByChannelId: { [channelId: string]: PerChannelSettings },
|
settingsByChannelId: { [channelId: string]: PerChannelSettings },
|
||||||
|
isPlaying?: boolean,
|
||||||
doFetchCostInfoForUri: (uri: string) => void,
|
doFetchCostInfoForUri: (uri: string) => void,
|
||||||
doSetContentHistoryItem: (uri: string) => void,
|
doSetContentHistoryItem: (uri: string) => void,
|
||||||
doSetPrimaryUri: (uri: ?string) => void,
|
doSetPrimaryUri: (uri: ?string) => void,
|
||||||
|
@ -69,6 +70,7 @@ export default function FilePage(props: Props) {
|
||||||
position,
|
position,
|
||||||
commentsListTitle,
|
commentsListTitle,
|
||||||
settingsByChannelId,
|
settingsByChannelId,
|
||||||
|
isPlaying,
|
||||||
doFetchCostInfoForUri,
|
doFetchCostInfoForUri,
|
||||||
doSetContentHistoryItem,
|
doSetContentHistoryItem,
|
||||||
doSetPrimaryUri,
|
doSetPrimaryUri,
|
||||||
|
@ -127,11 +129,11 @@ export default function FilePage(props: Props) {
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
// No floating player on mobile as of now, so clear the playing uri
|
// No floating player on mobile as of now, so clear the playing uri
|
||||||
return () => {
|
return () => {
|
||||||
if (isMobile && RENDER_MODES.FLOATING_MODES.includes(renderMode)) {
|
if (isMobile && isPlaying && RENDER_MODES.FLOATING_MODES.includes(renderMode)) {
|
||||||
doClearPlayingUri();
|
doClearPlayingUri();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, [doClearPlayingUri, isMobile, renderMode]);
|
}, [doClearPlayingUri, isMobile, isPlaying, renderMode]);
|
||||||
|
|
||||||
function renderFilePageLayout() {
|
function renderFilePageLayout() {
|
||||||
if (RENDER_MODES.FLOATING_MODES.includes(renderMode)) {
|
if (RENDER_MODES.FLOATING_MODES.includes(renderMode)) {
|
||||||
|
|
|
@ -459,15 +459,10 @@ export function doCommentReact(commentId: string, type: string) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param comment
|
|
||||||
* @param claim_id The ID of the claim to create the comment on. Can be a file, livestream, or channel page.
|
|
||||||
* @param parent_id
|
|
||||||
* @param uri
|
* @param uri
|
||||||
* @param livestream
|
* @param livestream
|
||||||
* @param sticker
|
* @param params the CommentSubmitParams needed for CommentCreateParams (not the same as they are dealt differently,
|
||||||
* @param {string} [txid] Optional transaction id
|
* like mentionedChannels which is selected after submission)
|
||||||
* @param {string} [payment_intent_id] Optional transaction id
|
|
||||||
* @param {string} [environment] Optional environment for Stripe (test|live)
|
|
||||||
* @returns {(function(Dispatch, GetState): Promise<undefined|void|*>)|*}
|
* @returns {(function(Dispatch, GetState): Promise<undefined|void|*>)|*}
|
||||||
*/
|
*/
|
||||||
export function doCommentCreate(uri: string, livestream: boolean, params: CommentSubmitParams) {
|
export function doCommentCreate(uri: string, livestream: boolean, params: CommentSubmitParams) {
|
||||||
|
|
|
@ -46,6 +46,7 @@ export type AppState = {
|
||||||
interestedInYoutubeSync: boolean,
|
interestedInYoutubeSync: boolean,
|
||||||
activeChannel: ?string,
|
activeChannel: ?string,
|
||||||
incognito: boolean,
|
incognito: boolean,
|
||||||
|
mobilePlayerDimensions?: { height: number, width: number },
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultState: AppState = {
|
const defaultState: AppState = {
|
||||||
|
@ -85,6 +86,7 @@ const defaultState: AppState = {
|
||||||
interestedInYoutubeSync: false,
|
interestedInYoutubeSync: false,
|
||||||
activeChannel: undefined,
|
activeChannel: undefined,
|
||||||
incognito: false,
|
incognito: false,
|
||||||
|
mobilePlayerDimensions: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
// @@router comes from react-router
|
// @@router comes from react-router
|
||||||
|
|
|
@ -30,6 +30,9 @@ export const selectListShuffle = (state: State) => selectState(state).shuffleLis
|
||||||
export const makeSelectIsPlaying = (uri: string) =>
|
export const makeSelectIsPlaying = (uri: string) =>
|
||||||
createSelector(selectPrimaryUri, (primaryUri) => primaryUri === uri);
|
createSelector(selectPrimaryUri, (primaryUri) => primaryUri === uri);
|
||||||
|
|
||||||
|
export const makeSelectIsUriCurrentlyPlaying = (uri: string) =>
|
||||||
|
createSelector(selectPlayingUri, (playingUri) => playingUri && playingUri.uri === uri);
|
||||||
|
|
||||||
export const makeSelectIsPlayerFloating = (location: UrlLocation) =>
|
export const makeSelectIsPlayerFloating = (location: UrlLocation) =>
|
||||||
createSelector(selectPrimaryUri, selectPlayingUri, (primaryUri, playingUri) => {
|
createSelector(selectPrimaryUri, selectPlayingUri, (primaryUri, playingUri) => {
|
||||||
if (!playingUri) return false;
|
if (!playingUri) return false;
|
||||||
|
|
|
@ -530,9 +530,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ReactModalPortal {
|
@media (max-width: $breakpoint-small) {
|
||||||
.button--close {
|
.ReactModalPortal {
|
||||||
top: 0;
|
.button--close {
|
||||||
right: 0;
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
@import 'init/breakpoints';
|
||||||
|
|
||||||
html {
|
html {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
text-rendering: optimizeLegibility;
|
text-rendering: optimizeLegibility;
|
||||||
|
@ -156,7 +158,7 @@ select {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 900px) {
|
@media (min-width: $breakpoint-small) {
|
||||||
textarea {
|
textarea {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: var(--spacing-xxl);
|
min-height: var(--spacing-xxl);
|
||||||
|
|
Loading…
Reference in a new issue