diff --git a/package.json b/package.json index f52e7790..3ea1a951 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mage-website", - "version": "0.0.11", + "version": "0.0.12", "license": "GPL-3.0", "private": true, "type": "module", diff --git a/src/hooks.server.ts b/src/hooks.server.ts index 4edef471..a20a54ba 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -65,7 +65,7 @@ export const handle: Handle = async ({ event, resolve }) => { } else { if ( pathname === '/maintenance' || - (pathname === '/premium' && env.PUBLIC_FEATURE_PREMIUM_PAGE === 'false') + (pathname === '/affiliate' && env.PUBLIC_FEATURE_AFFILIATE === 'false') ) { throw redirect(302, '/browse') } else { diff --git a/src/lib/assets/icons/affiliate/IconAffiliateCheck.svelte b/src/lib/assets/icons/affiliate/IconAffiliateCheck.svelte new file mode 100644 index 00000000..7960ced4 --- /dev/null +++ b/src/lib/assets/icons/affiliate/IconAffiliateCheck.svelte @@ -0,0 +1,9 @@ + diff --git a/src/lib/assets/icons/affiliate/IconAffiliateVerification.svelte b/src/lib/assets/icons/affiliate/IconAffiliateVerification.svelte new file mode 100644 index 00000000..a12ae6f0 --- /dev/null +++ b/src/lib/assets/icons/affiliate/IconAffiliateVerification.svelte @@ -0,0 +1,12 @@ + + + diff --git a/src/lib/assets/icons/drawer/IconDrawerPremium.svelte b/src/lib/assets/icons/drawer/IconDrawerPremium.svelte deleted file mode 100644 index 6f74d52e..00000000 --- a/src/lib/assets/icons/drawer/IconDrawerPremium.svelte +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/src/lib/components/Affiliate/ItemPlan.svelte b/src/lib/components/Affiliate/ItemPlan.svelte new file mode 100644 index 00000000..6eef1acb --- /dev/null +++ b/src/lib/components/Affiliate/ItemPlan.svelte @@ -0,0 +1,63 @@ + + +
+

+ {plan.name} +

+ +
+ ${plan.price} + /month +
+ + {#if $page.data.user?.userId} +
+
+ {#if plan.name === 'Affiliate'} + + {#if $page.data.user?.user?.affiliateTier === 1} + + Apply for verification + + {/if} + {:else} + + {/if} +
+
+ {/if} +
diff --git a/src/lib/components/Browse/Sections/ItemCarousel.svelte b/src/lib/components/Browse/Sections/ItemCarousel.svelte index e2c38bbe..b67af752 100644 --- a/src/lib/components/Browse/Sections/ItemCarousel.svelte +++ b/src/lib/components/Browse/Sections/ItemCarousel.svelte @@ -48,7 +48,7 @@

{channel.title || ''}

-
+
diff --git a/src/lib/components/Browse/Sections/ItemChannel.svelte b/src/lib/components/Browse/Sections/ItemChannel.svelte index 445ba7d9..1f1564f7 100644 --- a/src/lib/components/Browse/Sections/ItemChannel.svelte +++ b/src/lib/components/Browse/Sections/ItemChannel.svelte @@ -46,7 +46,7 @@

{channel.title}

-
+
diff --git a/src/lib/components/Browse/Sections/ItemTable.svelte b/src/lib/components/Browse/Sections/ItemTable.svelte index c356edf8..a1ec925d 100644 --- a/src/lib/components/Browse/Sections/ItemTable.svelte +++ b/src/lib/components/Browse/Sections/ItemTable.svelte @@ -11,7 +11,7 @@
-
+
diff --git a/src/lib/components/Browse/Sections/ItemUser.svelte b/src/lib/components/Browse/Sections/ItemUser.svelte index 1c98ab43..ca1ef705 100644 --- a/src/lib/components/Browse/Sections/ItemUser.svelte +++ b/src/lib/components/Browse/Sections/ItemUser.svelte @@ -7,7 +7,7 @@
-
+
diff --git a/src/lib/components/Browse/Sections/SectionTable.svelte b/src/lib/components/Browse/Sections/SectionTable.svelte index c3953ba5..6aa3719b 100644 --- a/src/lib/components/Browse/Sections/SectionTable.svelte +++ b/src/lib/components/Browse/Sections/SectionTable.svelte @@ -12,12 +12,12 @@ let limit = 100 let moreChannels: any[] = [] const loadMore = async () => { - let endpoint = profileId ? `channels/user?userId=${profileId}?` : 'channels?' - const infiniteChannels = await get(`${endpoint}skip=${skip}&limit=${limit}`) - if (infiniteChannels?.length) { - moreChannels = [...moreChannels, ...infiniteChannels] - skip += limit - } + // let endpoint = profileId ? `channels/user?userId=${profileId}?` : 'channels?' + // const infiniteChannels = await get(`${endpoint}skip=${skip}&limit=${limit}`) + // if (infiniteChannels?.length) { + // moreChannels = [...moreChannels, ...infiniteChannels] + // skip += limit + // } } diff --git a/src/lib/components/Channel/Chat/ChatInput.svelte b/src/lib/components/Channel/Chat/ChatInput.svelte index 50f3260e..985c5069 100644 --- a/src/lib/components/Channel/Chat/ChatInput.svelte +++ b/src/lib/components/Channel/Chat/ChatInput.svelte @@ -20,8 +20,10 @@ $channel_connection === `open-${channel._id}` && $page.data.user?.userId $: isHost = channel.user === $page.data.user?.userId - $: viewersWithOutHost = viewers.filter((viewer) => viewer.userId !== channel.user) -$: console.log("viewers : ", viewers) + $: viewersWithOutHost = viewers.filter( + (viewer) => viewer.userId !== channel.user && viewer.userId === 'anon' + ) + $: console.log('viewers : ', viewers) function insert(str: string, index: number, value: string) { return str.substr(0, index) + value + str.substr(index) } @@ -68,11 +70,10 @@ $: console.log("viewers : ", viewers) } const slectUserfromKey = (key: string) => { - if(selectedUser >= viewersWithOutHost.length - 1){ + if (selectedUser >= viewersWithOutHost.length - 1) { selectedUser = 0 - return - } - else if(selectedUser === 0){ + return + } else if (selectedUser === 0) { selectedUser = viewersWithOutHost.length - 1 return } @@ -213,7 +214,6 @@ $: console.log("viewers : ", viewers) !chatMessage.includes('@') && (channel.user === $page.data.user?.userId || channel.mods?.includes($page.data.user?.userId)) && !showUsers -
diff --git a/src/lib/components/Channel/Chat/DropdownViewChannel.svelte b/src/lib/components/Channel/Chat/DropdownViewChannel.svelte index 920dddad..20980d6d 100644 --- a/src/lib/components/Channel/Chat/DropdownViewChannel.svelte +++ b/src/lib/components/Channel/Chat/DropdownViewChannel.svelte @@ -68,7 +68,6 @@ } $: useEffect(() => { - if (!$page.data.user?.userId) return getHostAndRelationship() }, [channel?._id]) @@ -121,7 +120,7 @@
-
+
diff --git a/src/lib/components/Channel/Stream/DropdownViewers.svelte b/src/lib/components/Channel/Stream/DropdownViewers.svelte index 8ebe394f..58e3043c 100644 --- a/src/lib/components/Channel/Stream/DropdownViewers.svelte +++ b/src/lib/components/Channel/Stream/DropdownViewers.svelte @@ -29,8 +29,8 @@ var parsedMsg = JSON.parse(value) if (parsedMsg.eventName === `channel-paginated-users-${channel?._id}`) { let users = parsedMsg.users.map((user: any) => { - user.userId = user.userId || 'guest' - user.username = user.username || 'guest' + user.userId = user.userId || 'anonymous' + user.username = user.username || 'anonymous' const role = setRole({ userId: user.userId, channel, diff --git a/src/lib/components/Channel/Stream/VideoItem.svelte b/src/lib/components/Channel/Stream/VideoItem.svelte index ad5599a8..3b08bae1 100644 --- a/src/lib/components/Channel/Stream/VideoItem.svelte +++ b/src/lib/components/Channel/Stream/VideoItem.svelte @@ -345,7 +345,7 @@ 1 ? 'mask-hexagon' : 'mask-squircle'} object-cover m-auto" />
diff --git a/src/lib/components/Global/DrawerMain.svelte b/src/lib/components/Global/DrawerMain.svelte index b38c71d1..3bef667c 100644 --- a/src/lib/components/Global/DrawerMain.svelte +++ b/src/lib/components/Global/DrawerMain.svelte @@ -4,7 +4,6 @@ import IconDrawerHome from '$lib/assets/icons/drawer/IconDrawerHome.svelte' import IconDrawerVideos from '$lib/assets/icons/drawer/IconDrawerVideos.svelte' import IconDrawerCreatorSpace from '$lib/assets/icons/drawer/IconDrawerCreatorSpace.svelte' - import IconDrawerPremium from '$lib/assets/icons/drawer/IconDrawerPremium.svelte' import IconDrawerCareers from '$lib/assets/icons/drawer/IconDrawerCareers.svelte' import IconDrawerHelpAndLegal from '$lib/assets/icons/drawer/IconDrawerHelpAndLegal.svelte' import IconDrawerSettings from '$lib/assets/icons/drawer/IconDrawerSettings.svelte' @@ -17,7 +16,6 @@ import { page } from '$app/stores' import { user_role } from '$lib/stores/authStore' import { - is_feature_premium_page_enabled, is_feature_video_responses_enabled, is_feature_affiliate_enabled } from '$lib/stores/remoteConfigStore' @@ -89,7 +87,8 @@
+ 1 ? 'mask-hexagon' : 'mask-squircle'}"> @@ -164,11 +163,11 @@ Creator Space {/if} - {#if currentUser && $is_feature_premium_page_enabled} + {#if currentUser && $is_feature_affiliate_enabled}
  • - - - Premium + + + Affiliate {#if !isChannelPage} New {/if} @@ -181,17 +180,6 @@ Careers
  • - {#if currentUser && $is_feature_affiliate_enabled} -
  • - - - Affiliate - {#if !isChannelPage} - New - {/if} - -
  • - {/if}
  • { - $is_feature_follows_enabled = env.PUBLIC_FEATURE_FOLLOWS === 'true' $is_feature_stats_enabled = env.PUBLIC_FEATURE_STATS === 'true' - tabs = ['Channels'] - if ($is_feature_follows_enabled) tabs.push('Followers') + tabs = ['Channels', 'Followers'] if ($is_feature_stats_enabled) tabs.push('Stats') }) @@ -41,11 +36,9 @@
    - {#if $is_feature_follows_enabled} -
    - -
    - {/if} +
    + +
    {#if $is_feature_stats_enabled}
    diff --git a/src/lib/components/Profile/TopSection.svelte b/src/lib/components/Profile/TopSection.svelte index 1f5923c4..e4b44ec1 100644 --- a/src/lib/components/Profile/TopSection.svelte +++ b/src/lib/components/Profile/TopSection.svelte @@ -11,7 +11,6 @@ const useOueryEffect = createEffect() - $: auth = { userId: $page.data.user?.userId, token: $page.data.user?.token @@ -57,7 +56,7 @@
    1 ? 'mask-hexagon' : 'mask-squircle'} h-auto align-middle max-w-150-px"> diff --git a/src/lib/components/Search/ItemSearchChannel.svelte b/src/lib/components/Search/ItemSearchChannel.svelte index eadb015a..a83f0c29 100644 --- a/src/lib/components/Search/ItemSearchChannel.svelte +++ b/src/lib/components/Search/ItemSearchChannel.svelte @@ -55,7 +55,7 @@
    -
    +
    diff --git a/src/lib/components/Search/ItemSearchUser.svelte b/src/lib/components/Search/ItemSearchUser.svelte index 848cf454..e8ddef91 100644 --- a/src/lib/components/Search/ItemSearchUser.svelte +++ b/src/lib/components/Search/ItemSearchUser.svelte @@ -11,7 +11,7 @@
    -
    +
    diff --git a/src/lib/stores/remoteConfigStore.ts b/src/lib/stores/remoteConfigStore.ts index 1661fa74..9b8616b9 100644 --- a/src/lib/stores/remoteConfigStore.ts +++ b/src/lib/stores/remoteConfigStore.ts @@ -1,7 +1,5 @@ import { writable, type Writable } from 'svelte/store' export const is_feature_video_responses_enabled: Writable = writable(false) -export const is_feature_premium_page_enabled: Writable = writable(false) -export const is_feature_follows_enabled: Writable = writable(false) export const is_feature_stats_enabled: Writable = writable(false) export const is_feature_affiliate_enabled: Writable = writable(false) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 094501ef..83bcd52e 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -20,8 +20,6 @@ import { isOnline } from '$lib/stores/userStore' import { current_theme } from '$lib/stores/helperStore' import { - is_feature_premium_page_enabled, - is_feature_follows_enabled, is_feature_video_responses_enabled, is_feature_stats_enabled, is_feature_affiliate_enabled @@ -47,9 +45,7 @@ onMount(async () => { $current_theme = localStorage.getItem('theme') || 'dark' - $is_feature_premium_page_enabled = env.PUBLIC_FEATURE_PREMIUM_PAGE === 'true' $is_feature_video_responses_enabled = env.PUBLIC_FEATURE_VIDEO_RESPONSES === 'true' - $is_feature_follows_enabled = env.PUBLIC_FEATURE_FOLLOWS === 'true' $is_feature_stats_enabled = env.PUBLIC_FEATURE_STATS === 'true' $is_feature_affiliate_enabled = env.PUBLIC_FEATURE_AFFILIATE === 'true' await handleWebsocket() diff --git a/src/routes/premium/+page.server.ts b/src/routes/affiliate/+page.server.ts similarity index 100% rename from src/routes/premium/+page.server.ts rename to src/routes/affiliate/+page.server.ts diff --git a/src/routes/affiliate/+page.svelte b/src/routes/affiliate/+page.svelte new file mode 100644 index 00000000..ddff9525 --- /dev/null +++ b/src/routes/affiliate/+page.svelte @@ -0,0 +1,54 @@ + + +
    +
    +
    +

    Designed for dedicated streamers

    +

    + Collaborative streaming powered by AI. Our platform is designed to expand your reach and + grow your brand. +

    +
    +
    + {#each plans as plan} + + {/each} +
    +
    +
    diff --git a/src/routes/premium/+page.svelte b/src/routes/premium/+page.svelte deleted file mode 100644 index 943478d6..00000000 --- a/src/routes/premium/+page.svelte +++ /dev/null @@ -1,274 +0,0 @@ - - -
    -
    -
    -

    - Designed for business teams like yours -

    -

    - Here at Flowbite we focus on markets where technology, innovation, and capital can unlock - long-term value and drive economic growth. -

    -
    -
    - -
    -

    Starter

    -

    - Best option for personal use & for your next project. -

    -
    - $29 - /month -
    - -
      -
    • - - - Individual configuration -
    • -
    • - - - No setup, or hidden fees -
    • -
    • - - - Team size: 1 developer -
    • -
    • - - - Premium support: 6 months -
    • -
    • - - - Free updates: 6 months -
    • -
    - Get started -
    - -
    -

    Company

    -

    - Relevant for multiple users, extended & premium support. -

    -
    - $99 - /month -
    - -
      -
    • - - - Individual configuration -
    • -
    • - - - No setup, or hidden fees -
    • -
    • - - - Team size: 10 developers -
    • -
    • - - - Premium support: 24 months -
    • -
    • - - - Free updates: 24 months -
    • -
    - Get started -
    - -
    -

    Enterprise

    -

    - Best for large scale uses and extended redistribution rights. -

    -
    - $499 - /month -
    - -
      -
    • - - - Individual configuration -
    • -
    • - - - No setup, or hidden fees -
    • -
    • - - - Team size: 100+ developers -
    • -
    • - - - Premium support: 36 months -
    • -
    • - - - Free updates: 36 months -
    • -
    - Get started -
    -
    -
    -