Merge branch 'master' into 7645-LBRY-Hide-Watched-Content
This commit is contained in:
commit
cf3f1bf3ea
18 changed files with 129 additions and 39 deletions
36
.github/workflows/npm-publish-github-packages.yml
vendored
Normal file
36
.github/workflows/npm-publish-github-packages.yml
vendored
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
||||||
|
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
||||||
|
|
||||||
|
name: Node.js Package
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm test
|
||||||
|
|
||||||
|
publish-gpr:
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
registry-url: https://npm.pkg.github.com/
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm publish
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
3
.vs/ProjectSettings.json
Normal file
3
.vs/ProjectSettings.json
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"CurrentProjectSetting": null
|
||||||
|
}
|
10
.vs/VSWorkspaceState.json
Normal file
10
.vs/VSWorkspaceState.json
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"ExpandedNodes": [
|
||||||
|
"",
|
||||||
|
"\\ui",
|
||||||
|
"\\ui\\component",
|
||||||
|
"\\ui\\component\\claimListHeader"
|
||||||
|
],
|
||||||
|
"SelectedNode": "\\ui\\component\\claimListHeader\\view.jsx",
|
||||||
|
"PreviewInSolutionExplorer": false
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
0
.vs/lbry-desktop/FileContentIndex/read.lock
Normal file
0
.vs/lbry-desktop/FileContentIndex/read.lock
Normal file
BIN
.vs/lbry-desktop/v17/.wsuo
Normal file
BIN
.vs/lbry-desktop/v17/.wsuo
Normal file
Binary file not shown.
BIN
.vs/lbry-desktop/v17/workspaceFileList.bin
Normal file
BIN
.vs/lbry-desktop/v17/workspaceFileList.bin
Normal file
Binary file not shown.
BIN
.vs/slnx.sqlite
Normal file
BIN
.vs/slnx.sqlite
Normal file
Binary file not shown.
|
@ -107,6 +107,7 @@ function ChannelForm(props: Props) {
|
||||||
const primaryLanguage = Array.isArray(languageParam) && languageParam.length && languageParam[0];
|
const primaryLanguage = Array.isArray(languageParam) && languageParam.length && languageParam[0];
|
||||||
const secondaryLanguage = Array.isArray(languageParam) && languageParam.length >= 2 && languageParam[1];
|
const secondaryLanguage = Array.isArray(languageParam) && languageParam.length >= 2 && languageParam[1];
|
||||||
const [hideWatched, setHideWatched] = usePersistedState('hideWatched', false);
|
const [hideWatched, setHideWatched] = usePersistedState('hideWatched', false);
|
||||||
|
const [hideWatched, setHideWatched] = usePersistedState('hideWatched', false);
|
||||||
const submitLabel = React.useMemo(() => {
|
const submitLabel = React.useMemo(() => {
|
||||||
if (isClaimingInitialRewards) {
|
if (isClaimingInitialRewards) {
|
||||||
return __('Claiming credits...');
|
return __('Claiming credits...');
|
||||||
|
@ -257,6 +258,23 @@ function ChannelForm(props: Props) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add "Hide Watched" to channel pages
|
||||||
|
function getHideWatchedElem() {
|
||||||
|
return (
|
||||||
|
<div className={classnames(`card claim-search__menus`)}>
|
||||||
|
<FormField
|
||||||
|
label={__('Hide Watched')}
|
||||||
|
name="hide_watched"
|
||||||
|
type="checkbox"
|
||||||
|
checked={hideWatched}
|
||||||
|
onChange={() => {
|
||||||
|
setHideWatched((prev) => !prev);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
let nameError;
|
let nameError;
|
||||||
if (!name && name !== undefined) {
|
if (!name && name !== undefined) {
|
||||||
|
|
|
@ -318,11 +318,6 @@ function ClaimListDiscover(props: Props) {
|
||||||
if (orderParam === CS.ORDER_BY_TOP && freshnessParam !== CS.FRESH_ALL) {
|
if (orderParam === CS.ORDER_BY_TOP && freshnessParam !== CS.FRESH_ALL) {
|
||||||
options.release_time = `>${Math.floor(moment().subtract(1, freshnessParam).startOf('hour').unix())}`;
|
options.release_time = `>${Math.floor(moment().subtract(1, freshnessParam).startOf('hour').unix())}`;
|
||||||
} else if (orderParam === CS.ORDER_BY_NEW || orderParam === CS.ORDER_BY_TRENDING) {
|
} else if (orderParam === CS.ORDER_BY_NEW || orderParam === CS.ORDER_BY_TRENDING) {
|
||||||
// Warning - hack below
|
|
||||||
// If users are following more than 10 channels or tags, limit results to stuff less than a year old
|
|
||||||
// For more than 20, drop it down to 6 months
|
|
||||||
// This helps with timeout issues for users that are following a ton of stuff
|
|
||||||
// https://github.com/lbryio/lbry-sdk/issues/2420
|
|
||||||
if (
|
if (
|
||||||
(options.channel_ids && options.channel_ids.length > 20) ||
|
(options.channel_ids && options.channel_ids.length > 20) ||
|
||||||
(options.any_tags && options.any_tags.length > 20)
|
(options.any_tags && options.any_tags.length > 20)
|
||||||
|
|
|
@ -115,6 +115,21 @@ function ClaimListHeader(props: Props) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getHideWatchedElem() {
|
||||||
|
return (
|
||||||
|
<div className={`claim-search__checkbox`}>
|
||||||
|
<FormField
|
||||||
|
name="hide_watched"
|
||||||
|
type="checkbox"
|
||||||
|
checked={hideWatched}
|
||||||
|
onChange={() => {
|
||||||
|
setHideWatched((prev) => !prev);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (action !== 'POP' && isFiltered()) {
|
if (action !== 'POP' && isFiltered()) {
|
||||||
setExpanded(true);
|
setExpanded(true);
|
||||||
|
@ -499,8 +514,8 @@ function ClaimListHeader(props: Props) {
|
||||||
})}
|
})}
|
||||||
</FormField>
|
</FormField>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
|
|
||||||
|
)}
|
||||||
{channelIdsInUrl && (
|
{channelIdsInUrl && (
|
||||||
<div className={'claim-search__input-container'}>
|
<div className={'claim-search__input-container'}>
|
||||||
<label>{__('Advanced Filters from URL')}</label>
|
<label>{__('Advanced Filters from URL')}</label>
|
||||||
|
|
|
@ -258,6 +258,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Weird placement warning
|
// Weird placement warning
|
||||||
// Make sure this happens after we figure out if this claim needs to be hidden
|
// Make sure this happens after we figure out if this claim needs to be hidden
|
||||||
const thumbnailUrl = useGetThumbnail(uri, claim, streamingUrl, getFile, shouldHide);
|
const thumbnailUrl = useGetThumbnail(uri, claim, streamingUrl, getFile, shouldHide);
|
||||||
|
|
|
@ -152,7 +152,10 @@ function ClaimPreviewTile(props: Props) {
|
||||||
shouldHide = true;
|
shouldHide = true;
|
||||||
} else {
|
} else {
|
||||||
shouldHide =
|
shouldHide =
|
||||||
banState.blacklisted || banState.filtered || (!showHiddenByUser && (banState.muted || banState.blocked));
|
banState.blacklisted ||
|
||||||
|
banState.filtered ||
|
||||||
|
(!showHiddenByUser && (banState.muted || banState.blocked)) ||
|
||||||
|
(isWatched && hideWatched);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldHide) {
|
if (shouldHide) {
|
||||||
|
|
|
@ -199,6 +199,7 @@ const SearchOptions = (props: Props) => {
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
const uploadDateElem = (
|
const uploadDateElem = (
|
||||||
<div className="filter-values">
|
<div className="filter-values">
|
||||||
<FormField
|
<FormField
|
||||||
|
@ -227,6 +228,12 @@ const SearchOptions = (props: Props) => {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const hideWatchedElem = (
|
||||||
|
<div>
|
||||||
|
{getHideWatchedElem()}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
const sortByElem = (
|
const sortByElem = (
|
||||||
<div className="filter-values">
|
<div className="filter-values">
|
||||||
<FormField
|
<FormField
|
||||||
|
@ -270,6 +277,7 @@ const SearchOptions = (props: Props) => {
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default SearchOptions;
|
export default SearchOptions;
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
margin-top: var(--spacing-m);
|
margin-top: var(--spacing-m);
|
||||||
margin-bottom: var(--spacing-m);
|
margin-bottom: var(--spacing-m);
|
||||||
color: var(--color-text-subtitle);
|
color: var(--color-text-subtitle);
|
||||||
align-items: flex-start;
|
align-items: baseline;
|
||||||
|
|
||||||
@media (min-width: $breakpoint-small) {
|
@media (min-width: $breakpoint-small) {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
@ -31,6 +31,7 @@
|
||||||
.claim-search__checkbox {
|
.claim-search__checkbox {
|
||||||
padding-left: 45%;
|
padding-left: 45%;
|
||||||
padding-top: 7%;
|
padding-top: 7%;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//UPDATE: Added style for checkbox on search page
|
//UPDATE: Added style for checkbox on search page
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
.radio,
|
.radio,
|
||||||
.checkbox {
|
.checkbox {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-top: 0;
|
margin-top: 5px; // UPDATE: Helps to align items in "Other Options" in search
|
||||||
|
|
||||||
&:not(:first-of-type) {
|
&:not(:first-of-type) {
|
||||||
margin-top: var(--spacing-s);
|
margin-top: var(--spacing-s);
|
||||||
|
|
Loading…
Reference in a new issue