From 192f004bc72525a035cfa86e5a195978a1dd0130 Mon Sep 17 00:00:00 2001 From: Producdevity Date: Thu, 4 Jun 2026 16:35:21 +0200 Subject: [PATCH 1/2] chore: remove unused Stop Killing Games popup --- .../popups/StopKillingGamesPopup.tsx | 122 ------------------ src/data/storageKeys.ts | 1 - src/lib/analytics/actions.ts | 2 - src/lib/analytics/analytics.ts | 18 --- 4 files changed, 143 deletions(-) delete mode 100644 src/components/popups/StopKillingGamesPopup.tsx diff --git a/src/components/popups/StopKillingGamesPopup.tsx b/src/components/popups/StopKillingGamesPopup.tsx deleted file mode 100644 index 176f871f6..000000000 --- a/src/components/popups/StopKillingGamesPopup.tsx +++ /dev/null @@ -1,122 +0,0 @@ -'use client' - -import { AlertTriangle, X } from 'lucide-react' -import { useState, useEffect, useRef } from 'react' -import { Modal } from '@/components/ui' -import storageKeys from '@/data/storageKeys' -import analytics from '@/lib/analytics' -import { env } from '@/lib/env' - -const signPetitionUrl = 'https://eci.ec.europa.eu/045/public/#/screen/home' - -// TODO: check if we still need this for something -export function StopKillingGamesPopup() { - const [isOpen, setIsOpen] = useState(false) - - // Track the time when component mounts - const startTimeRef = useRef(Date.now()) - - // Function to get actual time spent on page in seconds - const getTimeOnPage = (): number => { - return Math.round((Date.now() - startTimeRef.current) / 1000) - } - - useEffect(() => { - if (!env.IS_PUBLIC_PRODUCTION) return - - // Don't show on admin pages - if (window.location.pathname.startsWith('/admin')) return - - const hasBeenDismissed = localStorage.getItem(storageKeys.popups.stopKillingGamesDismissed) - - if (hasBeenDismissed) return - - // Show popup after 20 seconds - const timer = setTimeout(() => { - setIsOpen(true) - }, 20000) - - return () => clearTimeout(timer) - }, []) - - function handleDismiss() { - analytics.engagement.stopKillingGamesDismissed({ - timeOnPage: getTimeOnPage(), - }) - localStorage.setItem(storageKeys.popups.stopKillingGamesDismissed, 'true') - setIsOpen(false) - } - - const handleClick = () => { - setIsOpen(false) - analytics.engagement.stopKillingGamesCTA({ timeOnPage: getTimeOnPage() }) - window.open(signPetitionUrl, '_blank', 'noopener,noreferrer') - } - - if (!env.IS_PUBLIC_PRODUCTION || !isOpen) return null - - return ( - -
-
-
- -
- -
-

- The Community needs your help to "Stop Killing Games" -

- -
-

- 765,634 people have already signed a petition urging publishers to make future games - playable even after servers shut down. -

-

- It calls for offline modes or private server support—to preserve ownership and - access. -

-

Once 1 million signatures are reached, the EU Commission must review it.

-

- - Care to help to hit the mark? - -

-

- - Learn more - -

-
- -
- - - - Sign the Petition - -
-
-
-
-
- ) -} diff --git a/src/data/storageKeys.ts b/src/data/storageKeys.ts index ccc5ee701..3dc7325eb 100644 --- a/src/data/storageKeys.ts +++ b/src/data/storageKeys.ts @@ -9,7 +9,6 @@ const storageKeys = { lastUsedDevice: `${PREFIX}new_listing_last_used_device`, }, popups: { - stopKillingGamesDismissed: `${PREFIX}stop_killing_games_dismissed`, voteReminderDismissed: `${PREFIX}vote_reminder_dismissed`, betaWarningDismissed: `${PREFIX}beta_warning_dismissed_v2`, supportBannerDismissed: `${PREFIX}support_banner_dismissed`, diff --git a/src/lib/analytics/actions.ts b/src/lib/analytics/actions.ts index 2f1a74870..c13337fa1 100644 --- a/src/lib/analytics/actions.ts +++ b/src/lib/analytics/actions.ts @@ -51,12 +51,10 @@ export const ENGAGEMENT_ACTIONS = { COMMENT_VOTE_UP: 'comment_vote_up', GAME_VIEW: 'game_view', LISTING_VIEW: 'listing_view', - STOP_KILLING_GAMES_CTA: 'stop_killing_games_cta', USER_PROFILE_VIEW: 'user_profile_view', VOTE_DOWN: 'vote_down', VOTE_REMINDER_CLICKED: 'vote_reminder_clicked', VOTE_REMINDER_DISMISSED: 'vote_reminder_dismissed', - STOP_KILLING_GAMES_DISMISSED: 'stop_killing_games_dismissed', SUPPORT_BANNER_SHOWN: 'support_banner_shown', SUPPORT_BANNER_DISMISSED: 'support_banner_dismissed', SUPPORT_BANNER_CTA: 'support_banner_cta', diff --git a/src/lib/analytics/analytics.ts b/src/lib/analytics/analytics.ts index 79482c3b1..9c44e30ff 100644 --- a/src/lib/analytics/analytics.ts +++ b/src/lib/analytics/analytics.ts @@ -385,24 +385,6 @@ const analytics = { }) }, - stopKillingGamesDismissed: (params: { timeOnPage: number }) => { - sendAnalyticsEvent({ - category: ANALYTICS_CATEGORIES.ENGAGEMENT, - action: ENGAGEMENT_ACTIONS.STOP_KILLING_GAMES_DISMISSED, - entityType: 'popup', - metadata: { timeOnPage: params.timeOnPage }, - }) - }, - - stopKillingGamesCTA: (params: { timeOnPage: number }) => { - sendAnalyticsEvent({ - category: ANALYTICS_CATEGORIES.ENGAGEMENT, - action: ENGAGEMENT_ACTIONS.STOP_KILLING_GAMES_CTA, - entityType: 'popup', - metadata: { timeOnPage: params.timeOnPage }, - }) - }, - supportBannerShown: (params: { variant: string; page: string }) => { sendAnalyticsEvent({ category: ANALYTICS_CATEGORIES.ENGAGEMENT, From a2c508abe0ea93d26693c9f84ae8a3876acfa66b Mon Sep 17 00:00:00 2001 From: Producdevity Date: Thu, 4 Jun 2026 16:54:00 +0200 Subject: [PATCH 2/2] chore: remove unused beta warning popup --- src/components/popups/BetaWarningPopup.tsx | 112 --------------------- src/components/popups/index.ts | 1 - src/data/storageKeys.ts | 1 - 3 files changed, 114 deletions(-) delete mode 100644 src/components/popups/BetaWarningPopup.tsx delete mode 100644 src/components/popups/index.ts diff --git a/src/components/popups/BetaWarningPopup.tsx b/src/components/popups/BetaWarningPopup.tsx deleted file mode 100644 index 8b1721d84..000000000 --- a/src/components/popups/BetaWarningPopup.tsx +++ /dev/null @@ -1,112 +0,0 @@ -'use client' - -import { AlertTriangle, X } from 'lucide-react' -import { useState, useEffect } from 'react' -import { Modal } from '@/components/ui' -import storageKeys from '@/data/storageKeys' -import { env } from '@/lib/env' - -const discordUrl = process.env.NEXT_PUBLIC_DISCORD_LINK - -export function BetaWarningPopup() { - const [isOpen, setIsOpen] = useState(false) - - useEffect(() => { - if (!env.IS_PUBLIC_PRODUCTION) return - - // Don't show on admin pages - if (window.location.pathname.startsWith('/admin')) return - - const hasBeenDismissed = localStorage.getItem(storageKeys.popups.betaWarningDismissed) - - if (hasBeenDismissed) return - - // Small delay to ensure page has loaded - const timer = setTimeout(() => { - setIsOpen(true) - }, 1000) - - return () => clearTimeout(timer) - }, []) - - function handleDismiss() { - localStorage.setItem(storageKeys.popups.betaWarningDismissed, 'true') - setIsOpen(false) - } - - if (!env.IS_PUBLIC_PRODUCTION || !isOpen) return null - - return ( - -
-
-
- -
- -
-

- Welcome to EmuReady Beta! -

- -
-

- Thanks for checking out EmuReady! We're excited to have you here, but please - note that - - {' '} - we're still in beta testing - - . -

- -

What this means:

- -
    -
  • You may encounter bugs or unexpected behavior
  • -
  • Features may change or be temporarily unavailable
  • -
- -

- If you find any issues, please report them on our{' '} - - Discord - {' '} - or{' '} - - GitHub - - . - - Feel free to explore, create an account, and get familiar with the platform. - -

-
- -
- -
-
-
-
-
- ) -} diff --git a/src/components/popups/index.ts b/src/components/popups/index.ts deleted file mode 100644 index 427f0f8f5..000000000 --- a/src/components/popups/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './BetaWarningPopup' diff --git a/src/data/storageKeys.ts b/src/data/storageKeys.ts index 3dc7325eb..cd980e2c7 100644 --- a/src/data/storageKeys.ts +++ b/src/data/storageKeys.ts @@ -10,7 +10,6 @@ const storageKeys = { }, popups: { voteReminderDismissed: `${PREFIX}vote_reminder_dismissed`, - betaWarningDismissed: `${PREFIX}beta_warning_dismissed_v2`, supportBannerDismissed: `${PREFIX}support_banner_dismissed`, }, cookies: {