Commit graph

108 commits

Author SHA1 Message Date
Thomas Zarebczan
f56e552764
Fix ads near recommended on Premium 2022-05-27 15:28:09 -04:00
infinite-persistence
3557e72419
Remount banner on theme-change as their ad can't change theme on the fly.
It would be nice if the individual components can handle the remounting of the ad-script, but there is currently a need to synchronize the cleanup of the `window.OBR` object.

The quickest solution for now is to add a key at the parent side to synchronize the mount-unmounting. Not ideal -- revisit later.
2022-05-27 20:48:53 +08:00
infinite-persistence
327a574982
Create banner ads and add to homepage
## Behavior in homepage
- Mobile: show after every other category
- Desktop: show after first category, then every 2 categories.

## Known issue:
- "FYP" is not part of the categories array at the moment, so it does mess up the behavior.

## Notes
I think this is also called "in-content" by adnim (not 100% sure of the terminology).
2022-05-27 20:48:51 +08:00
infinite-persistence
f0bf6fa9a0 Homepage: limit livestreams in categories to 3 ...
... but leave Following as "no limit"

The primary reason for this case is due to News and Wild West having lots of livestreams. But instead of just applying the limit to these 2 and polluting the loop, just limit it for all Categories.
2022-05-26 10:59:31 -04:00
infinite-persistence
cc0ed44bf6 Homepage: add "reset" + 'hideByDefault' categories
Requires a related commit from the homepages repo.

## Changes
- Add ability to reset the sort order.
- Make 'News' and 'Wild West' a "hideByDefault" category. It can be made visible in the homepage from the customization dialog.
2022-05-26 10:59:31 -04:00
Rave | 図書館猫
746d321dfe
Remove Premium+ Tiles when Premium+ is active (#1525) 2022-05-18 20:51:15 +02:00
infinite-persistence
53079d92b6
Move PremiumPlusTile into Ads (#1522)
* Move `PremiumPlusTile` into `Ads`

This saves the need to repeat the logic everywhere.

* Add option to disable fallback.
2022-05-18 19:52:46 +02:00
Rave | 図書館猫
c16516fab5
Show premium ads for users outside the US (#1521) 2022-05-18 10:05:58 -04:00
Rave | 図書館猫
ffdb5abf63
Tile Grid Revamp (#1502)
* Save

* Save

* Add pulse

* Adjust footer ad

* Adjust tile ad

* Adjust tile ad hover

* Fix premium badge alignment in tile grid

* Adjust livestream icon

* Adjust livestream icon

* Save scheduled livestreasm & tile ad

* Fix scheduled callback

* Fix playlist icon size on file page

* Fix grid distortion in 3 & 4 column layout

* -

* Fix grid on category & channel page

* Fix Premium Plus Grid

* Add custom tile for adblockers

* Reset env

* Remove collapsed tiles

* Remove setLoaded on scheduled livestreams page

* -

* Make isHidden optional

* Remove px

* Review adjustments

* Inject Premium+ ads

* Fix injection

* Fix injection when using the last tile

* Fix injection when using the last tile

* Enable stripe dev

* Create PremiumPlusTile component and add list view design

* Create PremiumPlusTile component and add list view design

* Adjust ads in list view

* Remove setState from render loop

* Clean code

* Fix livestream margin in list view

* Rewrite & tune some logic - Homepage & Channel page

* Clean details...

* Clean details...

* Requested review changes

Signed-off-by: Raphael Wickihalder <raphael.wickihalder@odysee.com>

* Requested review changes

Signed-off-by: Raphael Wickihalder <raphael.wickihalder@odysee.com>
2022-05-18 13:16:35 +02:00
infinite-persistence
8874008245 Support homepage-specific memes
1446

- Requires an accompanying commit in `odysee-frontend`.
- The change assumes that the `odysee-frontend` is the only project that uses these files directly, i.e. other clients will use the API instead.
2022-05-10 21:43:14 +08:00
infinite-persistence
cd2998d695
Membership-name state updates
- Corrected flow definitions.
- Properly differentiate between "not yet fetched" and "no membership" as "undefined" and "<empty string>", respectively. There are GUI elements that need to know the unfetched case.
2022-05-04 10:45:58 +08:00
infinite-persistence
f27b68587e
Restore original way to exclude categories in Homepage
It was previously done in `GetLinkData`, but accidentally removed in d854a992.
It is DRY-er to do it here rather than at the client side.

Also needed to filter in the homepage-sort dialog, so move the definition to a constant array.
2022-04-20 22:56:13 +08:00
infinite-persistence
07463312f0 Ad: change to 'insert' mode in Mobile layout.
## Ticket
1074
In mobile, the second livestream tile in Following gets missing because of the Ad being in 'replace' mode.

## Change
Switch from 'replace' to 'insert' mode in Mobile layout.

If missing (replaced) tiles is not a desired behavior, the true fix would be to always use 'insert' mode, and either live with the uneven tiles or wait for our design master's solution.
2022-04-19 10:18:51 -04:00
infinite-persistence
95df6fedc0 Fix new categories not showing until Customize is opened
## Ticket
1307 newly added categories aren't adding to existing customized homepage

## Change
In Customize, new categories were appended at the bottom, but forgot to repeat the behavior on the actual homepage itself.
2022-04-08 09:35:43 -04:00
infinite-persistence
5a400ca2fa
Clean homepage and export copy/paste issues, (no functional change) 2022-04-08 18:56:17 +08:00
infinite-persistence
f5034f74ca Batch resolve pin urls in 2 ways
Expanded homepage pins to support 2 types of input (if both are passed in, pinnedUrls take precedence):
  (1) pinnedUrls     --> uses doResolveUris (resolve)
  (2) pinnedClaimIds --> uses doResolveClaimIds (claim_search)

Instead of injecting the pinned URLs directly, we inject from `resolvedPinUris`, which will be blank until the uris are resolved, thus preventing it from being resolved individually from the tiles.

There's additional complexity with the `claim_search` method, as the rest of the code deals with uris instead of IDs. Fortunately, it's all contained with `useResolvePins`, so removal would be easier when the batch `resolve` issue is fixed.
2022-03-31 15:58:10 -04:00
infinite-persistence
d482b2d35a Second attempt at preventing "empty homepage" flash
The delay in fetching homepages causes the "empty homepage" splash to appear briefly for the authenticated case.

Part 2 of 61630930
2022-03-31 10:55:11 -04:00
infinite-persistence
1366f8d3ce Force reposts in Homepage + Category Page, except Following & WW
Ticket: 1220
2022-03-30 09:39:06 -04:00
Thomas Zarebczan
157b6d3f19
fix recommended showing blank on homepage 2022-03-28 10:01:55 -04:00
Thomas Zarebczan
79aa098484 fix: always inject FYP 2022-03-26 16:01:27 -04:00
infinite-persistence
616309301d Homepage: don't wait for prefs if incognito
It causes the "empty homepage" splash to briefly appear.
2022-03-25 09:14:37 -04:00
Thomas Zarebczan
56ae81198a Shorten title
Mobile was cutting off, otherwise worked okay!
2022-03-23 15:35:27 -04:00
infinite-persistence
5b16b3b058 Ability to customize homepage
Ticket: 1145

- Limited to premium for now (early access).
- Needed to handle custom categories from non-English homepages.
2022-03-23 15:35:27 -04:00
infinite-persistence
71e9837002 Repost: hide ribbon in Category Pages and Home Section
Allow in Following and Wild West

`index === 0` is not always Following, so compare link instead.
2022-03-22 08:54:22 -04:00
Thomas Zarebczan
9af32a0024
move recommendations below following
Until we have the reordering option. Recommended will require it's own page most liklely , the show more is strange in the middle of the page.
2022-03-21 18:53:09 -04:00
infinite-persistence
bffc27e8d0
Just always show homepage segment titles.. (#1116)
## Issue
- "Following" was showing up in place of "Featured"
- "Following" doesn't appear until livestreams are fetched, causing shifts.

When "Upcoming Livestreams" was implemented, it was trying to retain the original behavior of not showing "Following" title if that was the first in the list.

Not only is it a chicken-and-egg problem, but it causes extra renders due to the need to check if the other guys was rendered.

With FYP, there are now more combinations to handle.

## Change
Just show the title...
2022-03-16 08:49:44 -04:00
infinite-persistence
745e40a83e
Move blocker flag to redux
Was trying to save 1 state by assuming the homepage will be in a busy state and the ad-detection code will finish first. But this is not true for those with a small Following count.
2022-03-16 16:48:26 +08:00
infinite-persistence
1e67a5cc7f
[on hold recsys work] Recommended For You (#782)
* Factor out lighthouse-result processing code for FYP re-use.

The FYP results will be in the same format as LH.

* Recsys: add ability to pass in specific uuid to use

For FYP, we want to pass the UUID as a param when searching for recommendations. The search comes before the recsys entry creation, so we need to generate the UUID first when searching, and then tell recsys to use that specific ID.

* Redux: fetch and store FYP

Note that the gid cannot be used as "hash" for the uri list -- it doesn't necessarily change when the list changes, so we can't use it to optimize redux.  For now, just always update/render when re-fetched.

* UI for FYP

* Mark rendered FYPs

* Pass the FYP ID down the same way as Collection ID

Not ideal, but at least it's in the same pattern as existing code for now. The whole prop-drilling problem with the claim components will be fixed together later.

* Include 'gid' and 'uuid' in recommendation search

* Allow users to mark recommendations that they dislike

* Pass auth-token to all FYP requests + remove beacon use

beacons are unreliable and often blocked

* Only show FYP for members

* FYP readme page

* small fixes

* fyp

Co-authored-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
2022-03-15 15:07:31 -04:00
infinite-persistence
de29e323a8
Homepage-Following: insert instead of replace when ad-blocker is detected (#1092)
* Homepage-Following: insert instead of replace when ad-blocker is detected.

`window.odysee_ad_blocker_detected` was not meant to be used outside of `<Ads>`, since it wouldn't spark a GUI update. But since homepages are rendered several times, perhaps it doesn't matter and we can skip adding to redux for now.

* Handle uBlock origin

If refreshed via "Clear Cache and Hard Reload", the detection method fails, but it does perform an internal redirect, so treat that as a failure.
2022-03-14 14:25:51 -04:00
infinite-persistence
2dd0fc283d
Simplify ad-injection logic
Since `<Ads>` is already checking against SHOW_ADS and membershipship details, there is no need for all clients to repeat the same thing.
2022-03-10 21:54:11 +08:00
mayeaux
fb3a73d8a7
Membership subscriptions (#812)
Enter: Odysee Premium.
2022-03-09 13:05:37 -05:00
infinite-persistence
0143b63c74 Ads: replace DOM manipulations with React components
- Instead of 2 ways to display ads (DOM injection + React method) and having both of them clash, just do it the predictable React way.
    - Augment the existing React version to support tile layout + ability to place in last visible slot.
    - Consolidate styling code to scss ... DOM manipulations were making it even harder to maintain.
    - Removed the need to check for ad-blockers for now. It was being executed every time an ad is displayed, and now that we are displaying ads in more places, the gains doesn't justify the performance loss. Also, it wasn't being done for Recommended ads anyway, so the inconsistency probably means it's not needed in the first place.

Other known issues fixed:
- double ad injection when changing language via nag.
- additional "total-blocking-time" due to ads at startup removed.
- fixed ads not appearing in mobile homepage until navigated away and back to homepage.
- enable ads in channel page.
- support for both List and Tile layout.
2022-03-08 10:53:52 -05:00
infinite-persistence
678a160f7c
Fix missing homepage placeholder while waiting for livestream data (#904)
## Issue
When loading the homepage, I kept seeing a blank page with footer first. Even Google is picking it up.

## Ticket
572 Slow appearance of tiles

## Notes
The tiles were originally delayed to prevent the "Upcoming Livestream" section from causing layout shifts.

With the new theme, the footer would cause a visible shift anyway.  Hiding the footer is one solution, but I think not showing anything until the fetch is done is bad because the livestream fetch could stall.
2022-02-17 09:18:49 -05:00
toshikanneko
06782c0e31 Hide repost ribbon on category pages 2022-02-12 19:30:55 +01:00
mayeaux
0c4f85fe53
MAKE ODYSEE EVEN MORE BEAUTIFUL (#539)
WE LOVE YOU RAPHAEL FOR MAKING THIS HAPPEN!
2022-02-11 13:50:55 -05:00
infinite-persistence
431f55ef26
Delete pixel experiment (#683) 2022-01-12 10:14:44 -05:00
Dan Peterson
a89cb17ce4
Add horizontal layout (#636)
* Test out a horizontal scroll for upcoming (tile only for now)

* - add support for list layout
- add following label on home page
- clan up css and naming conventions

* Update header type + show only if scheduled streams are showing
2022-01-06 16:13:26 -05:00
Dan Peterson
bbe68a3319
Add a setting to hide scheduled livestreams from home/following (#626)
* Add a setting to hide scheduled livestreams from home/following

* Add a hide button in the scheduled stream header.

* Fix typo + make sure pref is synced
2022-01-05 16:20:43 -05:00
Anthony
cac05d5714 more touchups 2022-01-04 18:05:10 -05:00
Anthony
e3395e31ba refactor ad implementation 2022-01-04 18:05:10 -05:00
Anthony
28bcb96ec7 autoscroll on home page and dont run ads js at all for firefox android 2022-01-04 18:05:10 -05:00
Dan Peterson
038692cafc
Feature livestream scheduling (#458)
Add livestream scheduling feature
Also supports back to back streams, and will notify on a non-active stream of an active one.
2021-12-16 16:59:13 -05:00
Anthony
27012f0c8d add comment 2021-12-16 14:18:55 -05:00
infinite-persistence
fe3bbb0c70 Home: prevent layout shift from ads
## Issue
The ad tile causes a layout shift on certain screen/zoom, pushing CLS from green to red.

## Change
- Do replacement instead of insertion.
- Fixed "null lastCard" flow warning instead of suppressing it.
2021-12-16 14:18:55 -05:00
infinite-persistence
eb5a6ccde9 Memoize GetLinksData for performance
`GetLinksData` is somewhat expensive.  The value won't change until user changes the window size or selects another homepage.

As we can't call an `effect` within a `memo`, we had to extract out `isLargeScreen` as an input parameter, which is fine as it makes `GetLinksData` more functional (functional programming).
2021-12-08 13:59:33 -05:00
mayeaux
82643b1f4a
Finish cleaning out DOM (#413)
* finish cleaning out dom

* lint
2021-12-02 13:22:51 -05:00
mayeaux
a842a58608
Persist ads (#411)
* persist homepage ads

* persist all ads
2021-12-02 12:04:40 -05:00
mayeaux
6d3ec149b3
use second card on small screens and dont load script if authenticated (#406) 2021-12-01 09:52:03 -05:00
infinite-persistence
beeec64271 i18n ads 2021-11-30 22:53:47 -08:00
infinite-persistence
0aff130ea4
Fix lint and formatting (#394) 2021-11-30 19:53:23 -05:00