Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monetized room features #33

Merged
merged 2 commits into from
Apr 18, 2021
Merged

Conversation

wmurphyrd
Copy link
Member

Another split PR between the core (#32) & ui sides (sorry)

  • Add premium scenes section to homepage that appears if any scenes are tagged premium in the admin UI.
    • If monetized, clicking a scene creates a room with that scene
    • If not monetized, the scenes are disabled & blurred and user is prompted to sign up for coil
  • Add premium room capacity bypass
    • If a room is full, monetized users can still join (turns out room capacity is enforced only client-side up to some unspecified hard limit in retiuclum)
    • Add monetization info and sign up prompt to room entry panel

How to test:

  1. Create a temp branch from vreign-newui merge in core-monetize-ui and monetized-room-features
  2. npm run login to vreign (vreign has the Alice room as a premium scene)
  3. Insert monetization meta tags in index.html & hub.html (these are automatically inserted only in production)

…nes with premium tag and allows direct room creation from them if monetized
Comment on lines +1 to +14
import { useCallback, useContext } from "react";
import { usePaginatedAPI } from "./usePaginatedAPI";
import { fetchReticulumAuthenticated } from "../../utils/phoenix-utils";
import { AuthContext } from "../auth/AuthContext";

export function usePremiumScenes() {
const auth = useContext(AuthContext); // Re-render when you log in/out.
const getMoreScenes = useCallback(
cursor => fetchReticulumAuthenticated(`/api/v1/media/search?filter=premium&source=scene_listings&cursor=${cursor}`),
// eslint-disable-next-line react-hooks/exhaustive-deps
[auth.isSignedIn]
);
return usePaginatedAPI(getMoreScenes);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a copy/paste of usePublicRooms.js in the same folder with the api url changed

@quinn-madson quinn-madson merged commit 1b520a7 into immers-ui-refactor2 Apr 18, 2021
@quinn-madson quinn-madson deleted the monetized-room-features branch April 18, 2021 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants