use lbry-redux constants for view settings
This commit is contained in:
parent
31ef391ff6
commit
ef2171e457
7 changed files with 22 additions and 15 deletions
|
@ -988,5 +988,7 @@
|
||||||
"Allow the app to access third party analytics platforms": "Allow the app to access third party analytics platforms",
|
"Allow the app to access third party analytics platforms": "Allow the app to access third party analytics platforms",
|
||||||
"Share usage data with LBRY inc.": "Share usage data with LBRY inc.",
|
"Share usage data with LBRY inc.": "Share usage data with LBRY inc.",
|
||||||
"Required": "Required",
|
"Required": "Required",
|
||||||
"Email %help_link% or join our %chat_link% if you encounter any trouble verifying.": "Email %help_link% or join our %chat_link% if you encounter any trouble verifying."
|
"Email %help_link% or join our %chat_link% if you encounter any trouble verifying.": "Email %help_link% or join our %chat_link% if you encounter any trouble verifying.",
|
||||||
}
|
"Show reposts": "Show reposts",
|
||||||
|
"Show reposts from the creators you follow.": "Show reposts from the creators you follow."
|
||||||
|
}
|
|
@ -1,4 +1,3 @@
|
||||||
import * as SETTINGS from 'constants/settings';
|
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import {
|
import {
|
||||||
doClaimSearch,
|
doClaimSearch,
|
||||||
|
@ -6,6 +5,7 @@ import {
|
||||||
selectFetchingClaimSearch,
|
selectFetchingClaimSearch,
|
||||||
doToggleTagFollow,
|
doToggleTagFollow,
|
||||||
selectBlockedChannels,
|
selectBlockedChannels,
|
||||||
|
SETTINGS,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||||
import ClaimListDiscover from './view';
|
import ClaimListDiscover from './view';
|
||||||
|
|
|
@ -103,14 +103,14 @@ function ClaimListDiscover(props: Props) {
|
||||||
not_tags: Array<string>,
|
not_tags: Array<string>,
|
||||||
order_by: Array<string>,
|
order_by: Array<string>,
|
||||||
release_time?: string,
|
release_time?: string,
|
||||||
claim_type?: string,
|
claim_type?: Array<string>,
|
||||||
name?: string,
|
name?: string,
|
||||||
claim_type?: string | Array<string>,
|
claim_type?: Array<string>,
|
||||||
} = {
|
} = {
|
||||||
page_size: pageSize || PAGE_SIZE,
|
page_size: pageSize || PAGE_SIZE,
|
||||||
page,
|
page,
|
||||||
name,
|
name,
|
||||||
claim_type: claimType || ['stream', 'channel', 'repost'],
|
claim_type: claimType || undefined,
|
||||||
// no_totals makes it so the sdk doesn't have to calculate total number pages for pagination
|
// no_totals makes it so the sdk doesn't have to calculate total number pages for pagination
|
||||||
// it's faster, but we will need to remove it if we start using total_pages
|
// it's faster, but we will need to remove it if we start using total_pages
|
||||||
no_totals: true,
|
no_totals: true,
|
||||||
|
@ -167,7 +167,10 @@ function ClaimListDiscover(props: Props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!showReposts) {
|
if (!showReposts) {
|
||||||
options.claim_type = options.claim_type.filter(claimType => claimType !== 'repost');
|
options.claim_type =
|
||||||
|
options.claim_type === undefined
|
||||||
|
? ['stream', 'channel']
|
||||||
|
: options.claim_type.filter(claimType => claimType !== 'repost');
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasMatureTags = tags && tags.some(t => MATURE_TAGS.includes(t));
|
const hasMatureTags = tags && tags.some(t => MATURE_TAGS.includes(t));
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import * as SETTINGS from 'constants/settings';
|
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import {
|
import {
|
||||||
doClaimSearch,
|
doClaimSearch,
|
||||||
|
@ -6,6 +5,7 @@ import {
|
||||||
selectFetchingClaimSearch,
|
selectFetchingClaimSearch,
|
||||||
doToggleTagFollow,
|
doToggleTagFollow,
|
||||||
selectBlockedChannels,
|
selectBlockedChannels,
|
||||||
|
SETTINGS,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||||
import ClaimListDiscover from './view';
|
import ClaimListDiscover from './view';
|
||||||
|
|
|
@ -54,11 +54,11 @@ function ClaimTilesDiscover(props: Props) {
|
||||||
not_tags: Array<string>,
|
not_tags: Array<string>,
|
||||||
order_by: Array<string>,
|
order_by: Array<string>,
|
||||||
release_time?: string,
|
release_time?: string,
|
||||||
claim_type: string,
|
claim_type?: Array<string>,
|
||||||
timestamp?: string,
|
timestamp?: string,
|
||||||
} = {
|
} = {
|
||||||
page_size: pageSize,
|
page_size: pageSize,
|
||||||
claim_type: claimType || ['stream', 'channel', 'repost'],
|
claim_type: claimType || undefined,
|
||||||
// no_totals makes it so the sdk doesn't have to calculate total number pages for pagination
|
// no_totals makes it so the sdk doesn't have to calculate total number pages for pagination
|
||||||
// it's faster, but we will need to remove it if we start using total_pages
|
// it's faster, but we will need to remove it if we start using total_pages
|
||||||
no_totals: true,
|
no_totals: true,
|
||||||
|
@ -77,7 +77,10 @@ function ClaimTilesDiscover(props: Props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!showReposts) {
|
if (!showReposts) {
|
||||||
options.claim_type = options.claim_type.filter(claimType => claimType !== 'repost');
|
options.claim_type =
|
||||||
|
options.claim_type === undefined
|
||||||
|
? ['stream', 'channel']
|
||||||
|
: options.claim_type.filter(claimType => claimType !== 'repost');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (claimType) {
|
if (claimType) {
|
||||||
|
|
|
@ -23,4 +23,3 @@ export const HIDE_SPLASH_ANIMATION = 'hide_splash_animation';
|
||||||
export const FLOATING_PLAYER = 'floating_player';
|
export const FLOATING_PLAYER = 'floating_player';
|
||||||
export const DARK_MODE_TIMES = 'dark_mode_times';
|
export const DARK_MODE_TIMES = 'dark_mode_times';
|
||||||
export const ENABLE_SYNC = 'enable_sync';
|
export const ENABLE_SYNC = 'enable_sync';
|
||||||
export const SHOW_REPOSTS = 'show_reposts';
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as SETTINGS from 'constants/settings';
|
import * as SETTINGS from 'constants/settings';
|
||||||
import { SHARED_PREFERENCES } from 'lbry-redux';
|
import { SHARED_PREFERENCES, SETTINGS as LBRY_REDUX_SETTINGS } from 'lbry-redux';
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
|
|
||||||
const selectState = state => state.settings || {};
|
const selectState = state => state.settings || {};
|
||||||
|
@ -31,10 +31,10 @@ export const makeSelectClientSetting = setting =>
|
||||||
);
|
);
|
||||||
|
|
||||||
// refactor me
|
// refactor me
|
||||||
export const selectShowMatureContent = makeSelectClientSetting(SETTINGS.SHOW_MATURE);
|
export const selectShowMatureContent = makeSelectClientSetting(LBRY_REDUX_SETTINGS.SHOW_MATURE);
|
||||||
|
|
||||||
// and me
|
// and me
|
||||||
export const selectShowRepostedContent = makeSelectClientSetting(SETTINGS.SHOW_REPOSTS);
|
export const selectShowRepostedContent = makeSelectClientSetting(LBRY_REDUX_SETTINGS.SHOW_REPOSTS);
|
||||||
|
|
||||||
export const selectTheme = makeSelectClientSetting(SETTINGS.THEME);
|
export const selectTheme = makeSelectClientSetting(SETTINGS.THEME);
|
||||||
export const selectAutomaticDarkModeEnabled = makeSelectClientSetting(SETTINGS.AUTOMATIC_DARK_MODE_ENABLED);
|
export const selectAutomaticDarkModeEnabled = makeSelectClientSetting(SETTINGS.AUTOMATIC_DARK_MODE_ENABLED);
|
||||||
|
|
Loading…
Add table
Reference in a new issue