mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Fix lint errors
This commit is contained in:
3 files changed
+24
-25
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -42,7 +42,7 @@ export function useAppSubmissions() {
|
||||
queryKey: ['app-submissions'],
|
||||
queryFn: async (): Promise<AppSubmission[]> => {
|
||||
// Get Soapbox team follow pack for auto-approval
|
||||
let teamPubkeys = new Set<string>();
|
||||
const teamPubkeys = new Set<string>();
|
||||
try {
|
||||
const decoded = nip19.decode(SOAPBOX_TEAM_NADDR);
|
||||
if (decoded.type === 'naddr') {
|
||||
|
||||
Reference in new issue
Block a user