diff --git a/.github/workflows/npm-publish-github-packages.yml b/.github/workflows/npm-publish-github-packages.yml new file mode 100644 index 000000000..47a37f98c --- /dev/null +++ b/.github/workflows/npm-publish-github-packages.yml @@ -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}} diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json new file mode 100644 index 000000000..f8b488856 --- /dev/null +++ b/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": null +} \ No newline at end of file diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 000000000..c19998e37 --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,10 @@ +{ + "ExpandedNodes": [ + "", + "\\ui", + "\\ui\\component", + "\\ui\\component\\claimListHeader" + ], + "SelectedNode": "\\ui\\component\\claimListHeader\\view.jsx", + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/lbry-desktop/FileContentIndex/16edad0e-4683-4a03-a317-b9497f354d3b.vsidx b/.vs/lbry-desktop/FileContentIndex/16edad0e-4683-4a03-a317-b9497f354d3b.vsidx new file mode 100644 index 000000000..47376614c Binary files /dev/null and b/.vs/lbry-desktop/FileContentIndex/16edad0e-4683-4a03-a317-b9497f354d3b.vsidx differ diff --git a/.vs/lbry-desktop/FileContentIndex/2992661f-3821-4cf1-81ea-e7e34e4fa963.vsidx b/.vs/lbry-desktop/FileContentIndex/2992661f-3821-4cf1-81ea-e7e34e4fa963.vsidx new file mode 100644 index 000000000..30ce23a15 Binary files /dev/null and b/.vs/lbry-desktop/FileContentIndex/2992661f-3821-4cf1-81ea-e7e34e4fa963.vsidx differ diff --git a/.vs/lbry-desktop/FileContentIndex/read.lock b/.vs/lbry-desktop/FileContentIndex/read.lock new file mode 100644 index 000000000..e69de29bb diff --git a/.vs/lbry-desktop/v17/.wsuo b/.vs/lbry-desktop/v17/.wsuo new file mode 100644 index 000000000..8c9437e3e Binary files /dev/null and b/.vs/lbry-desktop/v17/.wsuo differ diff --git a/.vs/lbry-desktop/v17/workspaceFileList.bin b/.vs/lbry-desktop/v17/workspaceFileList.bin new file mode 100644 index 000000000..c4220c1b0 Binary files /dev/null and b/.vs/lbry-desktop/v17/workspaceFileList.bin differ diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 000000000..dac7fc6cd Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/ui/component/channelForm/view.jsx b/ui/component/channelForm/view.jsx index fa0357cb3..b5dc705bf 100644 --- a/ui/component/channelForm/view.jsx +++ b/ui/component/channelForm/view.jsx @@ -107,6 +107,7 @@ function ChannelForm(props: Props) { const primaryLanguage = Array.isArray(languageParam) && languageParam.length && languageParam[0]; const secondaryLanguage = Array.isArray(languageParam) && languageParam.length >= 2 && languageParam[1]; const [hideWatched, setHideWatched] = usePersistedState('hideWatched', false); + const [hideWatched, setHideWatched] = usePersistedState('hideWatched', false); const submitLabel = React.useMemo(() => { if (isClaimingInitialRewards) { return __('Claiming credits...'); @@ -257,7 +258,24 @@ function ChannelForm(props: Props) { ); } - React.useEffect(() => { + // Add "Hide Watched" to channel pages + function getHideWatchedElem() { + return ( +
+ { + setHideWatched((prev) => !prev); + }} + /> +
+ ); + } + + React.useEffect(() => { let nameError; if (!name && name !== undefined) { nameError = __('A name is required for your url'); diff --git a/ui/component/claimListDiscover/view.jsx b/ui/component/claimListDiscover/view.jsx index f15a20483..a53f0c2fc 100644 --- a/ui/component/claimListDiscover/view.jsx +++ b/ui/component/claimListDiscover/view.jsx @@ -318,11 +318,6 @@ function ClaimListDiscover(props: Props) { if (orderParam === CS.ORDER_BY_TOP && freshnessParam !== CS.FRESH_ALL) { options.release_time = `>${Math.floor(moment().subtract(1, freshnessParam).startOf('hour').unix())}`; } 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 ( (options.channel_ids && options.channel_ids.length > 20) || (options.any_tags && options.any_tags.length > 20) diff --git a/ui/component/claimListHeader/view.jsx b/ui/component/claimListHeader/view.jsx index cf276c9ba..9b7c1ec84 100644 --- a/ui/component/claimListHeader/view.jsx +++ b/ui/component/claimListHeader/view.jsx @@ -98,7 +98,22 @@ function ClaimListHeader(props: Props) { const shouldHighlight = searchInLanguage ? languageParam !== languageSetting && languageParam !== null - : languageParam !== CS.LANGUAGES_ALL && languageParam !== null; + : languageParam !== CS.LANGUAGES_ALL && languageParam !== null; + + function getHideWatchedElem() { + return ( +
+ { + setHideWatched((prev) => !prev); + }} + /> +
+ ); + } function getHideWatchedElem() { return ( @@ -497,10 +512,10 @@ function ClaimListHeader(props: Props) { ); })} - - - )} + + + )} {channelIdsInUrl && (
@@ -518,7 +533,7 @@ function ClaimListHeader(props: Props) {
- )} + )} {hasMatureTags && hiddenNsfwMessage} diff --git a/ui/component/claimPreview/view.jsx b/ui/component/claimPreview/view.jsx index 35d55bf37..036ea3f6f 100644 --- a/ui/component/claimPreview/view.jsx +++ b/ui/component/claimPreview/view.jsx @@ -147,7 +147,7 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { } = props; const isMobile = useIsMobile(); - const [hideWatched, setHideWatched] = usePersistedState('hideWatched', false); + const [hideWatched, setHideWatched] = usePersistedState('hideWatched', false); const isCollection = claim && claim.value_type === 'collection'; const collectionClaimId = isCollection && claim && claim.claim_id; const listId = collectionId || collectionClaimId; @@ -256,8 +256,9 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { if (customShouldHide(claim)) { shouldHide = true; } - } + } + // Weird placement warning // Make sure this happens after we figure out if this claim needs to be hidden const thumbnailUrl = useGetThumbnail(uri, claim, streamingUrl, getFile, shouldHide); @@ -275,7 +276,7 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { } } - useEffect(() => { + useEffect(() => { if (isValid && !isResolvingUri && shouldFetch && uri) { resolveUri(uri); } @@ -291,7 +292,7 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { if (shouldHide && !showNullPlaceholder) { return null; - } + } if (placeholder === 'loading' || (uri && !claim && isResolvingUri)) { return ; diff --git a/ui/component/claimPreviewTile/view.jsx b/ui/component/claimPreviewTile/view.jsx index 63cca1e49..270aa0f21 100644 --- a/ui/component/claimPreviewTile/view.jsx +++ b/ui/component/claimPreviewTile/view.jsx @@ -146,18 +146,21 @@ function ClaimPreviewTile(props: Props) { return null; } - if (isMature && !showMature) { - // Unfortunately needed until this is resolved - // https://github.com/lbryio/lbry-sdk/issues/2785 - shouldHide = true; - } else { - shouldHide = - banState.blacklisted || banState.filtered || (!showHiddenByUser && (banState.muted || banState.blocked)); - } + if (isMature && !showMature) { + // Unfortunately needed until this is resolved + // https://github.com/lbryio/lbry-sdk/issues/2785 + shouldHide = true; + } else { + shouldHide = + banState.blacklisted || + banState.filtered || + (!showHiddenByUser && (banState.muted || banState.blocked)) || + (isWatched && hideWatched); + } - if (shouldHide) { - return null; - } + if (shouldHide) { + return null; + } const isChannelPage = location.pathname.startsWith('/@'); diff --git a/ui/component/searchOptions/view.jsx b/ui/component/searchOptions/view.jsx index 39036e509..98ac5bbff 100644 --- a/ui/component/searchOptions/view.jsx +++ b/ui/component/searchOptions/view.jsx @@ -60,7 +60,7 @@ const SearchOptions = (props: Props) => { if (simple) { delete TYPES_ADVANCED[SEARCH_OPTIONS.MEDIA_APPLICATION]; delete TYPES_ADVANCED[SEARCH_OPTIONS.MEDIA_IMAGE]; - } + } const [hideWatched, setHideWatched] = usePersistedState('hideWatched', false); @@ -199,6 +199,7 @@ const SearchOptions = (props: Props) => { ); + const uploadDateElem = (
{ onClick={() => updateSearchOptions(SEARCH_OPTIONS.TIME_FILTER, '')} />
- ); + ); + + const hideWatchedElem = ( +
+ {getHideWatchedElem()} +
+ ); const hideWatchedElem = (
@@ -241,7 +248,7 @@ const SearchOptions = (props: Props) => {
); - const uploadDateLabel = + const uploadDateLabel = options[SEARCH_OPTIONS.CLAIM_TYPE] === SEARCH_OPTIONS.INCLUDE_CHANNELS ? __('Creation Date') : __('Upload Date'); return ( @@ -270,6 +277,7 @@ const SearchOptions = (props: Props) => { ); + }; export default SearchOptions; diff --git a/ui/scss/component/_claim-search.scss b/ui/scss/component/_claim-search.scss index f7ca6f0ae..4865fd221 100644 --- a/ui/scss/component/_claim-search.scss +++ b/ui/scss/component/_claim-search.scss @@ -17,7 +17,7 @@ margin-top: var(--spacing-m); margin-bottom: var(--spacing-m); color: var(--color-text-subtitle); - align-items: flex-start; + align-items: baseline; @media (min-width: $breakpoint-small) { flex-direction: row; @@ -31,6 +31,7 @@ .claim-search__checkbox { padding-left: 45%; padding-top: 7%; + } //UPDATE: Added style for checkbox on search page diff --git a/ui/scss/component/_file-thumbnail.scss b/ui/scss/component/_file-thumbnail.scss index ebfc4339c..85abe19a9 100644 --- a/ui/scss/component/_file-thumbnail.scss +++ b/ui/scss/component/_file-thumbnail.scss @@ -1,13 +1,13 @@ .file-thumbnail__viewed-bar { - position: absolute; - bottom: 0; - left: 0; - width: 100%; - height: 5px; - background-color: var(--color-gray-7); + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 5px; + background-color: var(--color-gray-7); } .file-thumbnail__viewed-bar-progress { - height: 5px; - background-color: var(--color-primary); + height: 5px; + background-color: var(--color-primary); } diff --git a/ui/scss/component/_search.scss b/ui/scss/component/_search.scss index b9193583d..fb1d62c4c 100644 --- a/ui/scss/component/_search.scss +++ b/ui/scss/component/_search.scss @@ -90,7 +90,7 @@ .radio, .checkbox { display: inline-block; - margin-top: 0; + margin-top: 5px; // UPDATE: Helps to align items in "Other Options" in search &:not(:first-of-type) { margin-top: var(--spacing-s);