diff --git a/src/components/AppShowcase.tsx b/src/components/AppShowcase.tsx index 11c643f6..ca037709 100644 --- a/src/components/AppShowcase.tsx +++ b/src/components/AppShowcase.tsx @@ -1,5 +1,4 @@ import React, { useState, useMemo } from "react"; -import { Search } from "lucide-react"; import { Button } from "@/components/ui/button"; import { useCurrentUser } from "@/hooks/useCurrentUser"; import { useAppSubmissions } from "@/hooks/useAppSubmissions"; @@ -11,7 +10,6 @@ import { } from "@/components/ui/collapsible"; import { nip19 } from 'nostr-tools'; import { shuffleArray } from "@/lib/utils"; -import type { AppSubmission } from "@/hooks/useAppSubmissions"; import { Skeleton } from "@/components/ui/skeleton"; import { Card, CardContent } from "@/components/ui/card"; import { RelaySelector } from "@/components/RelaySelector"; @@ -37,32 +35,32 @@ export function AppShowcase() { // Separate template apps from other apps const templateApps = useMemo(() => - shuffleArray(visibleSubmissions.filter(app => app.appTags.includes('Template'))), - [visibleSubmissions] + shuffleArray(visibleSubmissions.filter(app => app.appTags.includes('Template'))), + [visibleSubmissions] ); const nonTemplateSubmissions = visibleSubmissions.filter(app => !app.appTags.includes('Template')); // Get Halloween Hackathon 2025 apps that are featured (for main showcase) const halloweenApps = useMemo(() => - shuffleArray(nonTemplateSubmissions.filter(app => - app.appTags.includes('Halloween Hackathon 2025') && app.isFeatured - )), - [nonTemplateSubmissions] + shuffleArray(nonTemplateSubmissions.filter(app => + app.appTags.includes('Halloween Hackathon 2025') && app.isFeatured + )), + [nonTemplateSubmissions] ); // Filter out Halloween Hackathon 2025 apps from other sections (unless featured, they go in Halloween section) const nonHalloweenSubmissions = nonTemplateSubmissions.filter(app => - !app.appTags.includes('Halloween Hackathon 2025') + !app.appTags.includes('Halloween Hackathon 2025') ); // Shuffle featured and approved apps on each component mount/render for random display order const featuredApps = useMemo(() => - shuffleArray(nonHalloweenSubmissions.filter(app => app.isFeatured)), - [nonHalloweenSubmissions] + shuffleArray(nonHalloweenSubmissions.filter(app => app.isFeatured)), + [nonHalloweenSubmissions] ); const approvedApps = useMemo(() => - shuffleArray(nonHalloweenSubmissions.filter(app => app.isApproved && !app.isFeatured)), - [nonHalloweenSubmissions] + shuffleArray(nonHalloweenSubmissions.filter(app => app.isApproved && !app.isFeatured)), + [nonHalloweenSubmissions] ); // Don't show showcase if no apps exist diff --git a/src/components/AppShowcaseCard.tsx b/src/components/AppShowcaseCard.tsx index b979e784..9085ab11 100644 --- a/src/components/AppShowcaseCard.tsx +++ b/src/components/AppShowcaseCard.tsx @@ -29,6 +29,7 @@ import { useAuthor } from '@/hooks/useAuthor'; import { nip19 } from 'nostr-tools'; import { useToast } from '@/hooks/useToast'; import { useQueryClient } from '@tanstack/react-query'; +import type { NostrEvent } from '@nostrify/nostrify'; interface AppShowcaseCardProps { app: AppSubmission; @@ -37,7 +38,7 @@ interface AppShowcaseCardProps { hideApprovalStatus?: boolean; // Hide pending/approval badges } -export function AppShowcaseCard({ app, onEdit, showModerationControls, hideApprovalStatus }: AppShowcaseCardProps) { +export function AppShowcaseCard({ app, onEdit, showModerationControls, hideApprovalStatus: _hideApprovalStatus }: AppShowcaseCardProps) { const { user } = useCurrentUser(); const { nostr } = useNostr(); const { mutate: publishEvent, isPending } = useNostrPublish(); @@ -132,9 +133,9 @@ export function AppShowcaseCard({ app, onEdit, showModerationControls, hideAppro limit: 1 }]); - const currentHomepageList = currentHomepageLists.reduce((latest: any, current: any) => + const currentHomepageList = currentHomepageLists.reduce((latest: NostrEvent | null, current: NostrEvent) => !latest || current.created_at > latest.created_at ? current : latest, - null + null as NostrEvent | null ); // Get current homepage app coordinates @@ -175,9 +176,9 @@ export function AppShowcaseCard({ app, onEdit, showModerationControls, hideAppro limit: 1 }]); - const currentApprovedList = currentApprovedLists.reduce((latest: any, current: any) => + const currentApprovedList = currentApprovedLists.reduce((latest: NostrEvent | null, current: NostrEvent) => !latest || current.created_at > latest.created_at ? current : latest, - null + null as NostrEvent | null ); // Get current approved app coordinates @@ -214,9 +215,9 @@ export function AppShowcaseCard({ app, onEdit, showModerationControls, hideAppro limit: 1 }]); - const currentFeaturedList = currentFeaturedLists.reduce((latest: any, current: any) => + const currentFeaturedList = currentFeaturedLists.reduce((latest: NostrEvent | null, current: NostrEvent) => !latest || current.created_at > latest.created_at ? current : latest, - null + null as NostrEvent | null ); // Get current featured app coordinates @@ -257,9 +258,9 @@ export function AppShowcaseCard({ app, onEdit, showModerationControls, hideAppro limit: 1 }]); - const currentApprovedList = currentApprovedLists.reduce((latest: any, current: any) => + const currentApprovedList = currentApprovedLists.reduce((latest: NostrEvent | null, current: NostrEvent) => !latest || current.created_at > latest.created_at ? current : latest, - null + null as NostrEvent | null ); // Get current approved app coordinates @@ -296,9 +297,9 @@ export function AppShowcaseCard({ app, onEdit, showModerationControls, hideAppro limit: 1 }]); - const currentApprovedList = currentApprovedLists.reduce((latest: any, current: any) => + const currentApprovedList = currentApprovedLists.reduce((latest: NostrEvent | null, current: NostrEvent) => !latest || current.created_at > latest.created_at ? current : latest, - null + null as NostrEvent | null ); // Get current approved app coordinates diff --git a/src/hooks/useAppSubmissions.ts b/src/hooks/useAppSubmissions.ts index 4bd22406..937c6e53 100644 --- a/src/hooks/useAppSubmissions.ts +++ b/src/hooks/useAppSubmissions.ts @@ -42,7 +42,7 @@ export function useAppSubmissions() { queryKey: ['app-submissions'], queryFn: async (): Promise => { // Get Soapbox team follow pack for auto-approval - let teamPubkeys = new Set(); + const teamPubkeys = new Set(); try { const decoded = nip19.decode(SOAPBOX_TEAM_NADDR); if (decoded.type === 'naddr') {