diff --git a/src/components/notifications/AppExplorer/AppCard/index.tsx b/src/components/notifications/AppExplorer/AppCard/index.tsx index 6e97def5e..eb532e6cd 100644 --- a/src/components/notifications/AppExplorer/AppCard/index.tsx +++ b/src/components/notifications/AppExplorer/AppCard/index.tsx @@ -6,6 +6,7 @@ import { useNavigate } from 'react-router-dom' import SpannerSVG from '@/assets/Spanner.svg' import Badge from '@/components/general/Badge' import Text from '@/components/general/Text' +import SettingsContext from '@/contexts/SettingsContext/context' import W3iContext from '@/contexts/W3iContext/context' import { logError } from '@/utils/error' import { showErrorMessageToast, showSuccessMessageToast } from '@/utils/toasts' @@ -37,6 +38,7 @@ const AppCard: React.FC = ({ const nav = useNavigate() const ref = useRef(null) const { notifyClientProxy, userPubkey } = useContext(W3iContext) + const { isDevModeEnabled } = useContext(SettingsContext) const { activeSubscriptions } = useContext(W3iContext) const host = new URL(url).host @@ -113,7 +115,7 @@ const AppCard: React.FC = ({
{`${name} - {!isVerified && !isComingSoon ? ( + {isDevModeEnabled && !isVerified && !isComingSoon ? ( Dev mode icon ) : null}
@@ -133,7 +135,7 @@ const AppCard: React.FC = ({
{name} - {!isVerified && !isComingSoon ? DEV : null} + {isDevModeEnabled && !isVerified && !isComingSoon ? DEV : null}
{host} diff --git a/src/utils/hooks/useNotifyProjects.ts b/src/utils/hooks/useNotifyProjects.ts index d6e93a66a..c2147c0eb 100644 --- a/src/utils/hooks/useNotifyProjects.ts +++ b/src/utils/hooks/useNotifyProjects.ts @@ -10,14 +10,16 @@ import { logError } from '../error' const useNotifyProjects = () => { const [loading, setLoading] = useState(false) const [projects, setProjects] = useState([]) - const { filterAppDomain } = useContext(SettingsContext) + const { filterAppDomain, isDevModeEnabled } = useContext(SettingsContext) useEffect(() => { const fetchNotifyProjects = async () => { setLoading(true) try { - const { data: featuredProjects } = await fetchFeaturedProjects() + const { data: featuredProjects } = await fetchFeaturedProjects({ + isDevModeEnabled + }) const { data: domainProject } = await fetchDomainProjects(filterAppDomain) const allProjects: INotifyProjectWithComingSoon[] = featuredProjects.map(item => ({ @@ -61,7 +63,7 @@ const useNotifyProjects = () => { } fetchNotifyProjects() - }, [setProjects, filterAppDomain]) + }, [isDevModeEnabled, setProjects, filterAppDomain]) return { projects, loading } } diff --git a/src/utils/projects.ts b/src/utils/projects.ts index b253225b6..58c8a4182 100644 --- a/src/utils/projects.ts +++ b/src/utils/projects.ts @@ -2,12 +2,18 @@ import { EXPLORER_API_BASE_URL, EXPLORER_ENDPOINTS } from '@/utils/constants' const projectId: string = import.meta.env.VITE_PROJECT_ID -export async function fetchFeaturedProjects() { +type FetchFeaturedProjectsProps = { + isDevModeEnabled: boolean +} + +export async function fetchFeaturedProjects({ isDevModeEnabled }: FetchFeaturedProjectsProps) { const explorerUrlFeatured = new URL(EXPLORER_ENDPOINTS.projects, EXPLORER_API_BASE_URL) explorerUrlFeatured.searchParams.set('projectId', projectId) explorerUrlFeatured.searchParams.set('isVerified', 'true') - explorerUrlFeatured.searchParams.set('isFeatured', 'true') + if (!isDevModeEnabled) { + explorerUrlFeatured.searchParams.set('isFeatured', 'true') + } try { const discoverProjectsData = await fetch(explorerUrlFeatured).then(async res => res.json())