mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-06 00:37:23 +00:00
.jsx -> .js
This commit is contained in:
28 files changed
+100
-100
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import { render } from '@testing-library/react';
|
import { render } from '@testing-library/react';
|
||||||
import { test } from 'vitest';
|
import { test } from 'vitest';
|
||||||
|
|
||||||
import App from "./App.jsx";
|
import App from "./App.js";
|
||||||
|
|
||||||
test('App', () => {
|
test('App', () => {
|
||||||
render(<App />);
|
render(<App />);
|
||||||
|
|||||||
+7
-7
@@ -5,14 +5,14 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|||||||
import { createHead, UnheadProvider } from '@unhead/react/client';
|
import { createHead, UnheadProvider } from '@unhead/react/client';
|
||||||
import { InferSeoMetaPlugin } from '@unhead/addons';
|
import { InferSeoMetaPlugin } from '@unhead/addons';
|
||||||
import { Suspense } from 'react';
|
import { Suspense } from 'react';
|
||||||
import NostrProvider from '@/components/NostrProvider.jsx';
|
import NostrProvider from '@/components/NostrProvider.js';
|
||||||
import { Toaster } from "@/components/ui/toaster.jsx";
|
import { Toaster } from "@/components/ui/toaster.js";
|
||||||
import { TooltipProvider } from "@/components/ui/tooltip.jsx";
|
import { TooltipProvider } from "@/components/ui/tooltip.js";
|
||||||
import { NostrLoginProvider } from '@nostrify/react/login';
|
import { NostrLoginProvider } from '@nostrify/react/login';
|
||||||
import { AppProvider } from '@/components/AppProvider.jsx';
|
import { AppProvider } from '@/components/AppProvider.js';
|
||||||
import { NWCProvider } from '@/contexts/NWCContext.jsx';
|
import { NWCProvider } from '@/contexts/NWCContext.js';
|
||||||
import { AppConfig } from '@/contexts/AppContext.jsx';
|
import { AppConfig } from '@/contexts/AppContext.js';
|
||||||
import AppRouter from "./AppRouter.jsx";
|
import AppRouter from "./AppRouter.js";
|
||||||
|
|
||||||
const head = createHead({
|
const head = createHead({
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|||||||
+4
-4
@@ -1,9 +1,9 @@
|
|||||||
import { BrowserRouter, Route, Routes } from "react-router-dom";
|
import { BrowserRouter, Route, Routes } from "react-router-dom";
|
||||||
import { ScrollToTop } from "./components/ScrollToTop.jsx";
|
import { ScrollToTop } from "./components/ScrollToTop.js";
|
||||||
|
|
||||||
import Index from "./pages/Index.jsx";
|
import Index from "./pages/Index.js";
|
||||||
import { NIP19Page } from "./pages/NIP19Page.jsx";
|
import { NIP19Page } from "./pages/NIP19Page.js";
|
||||||
import NotFound from "./pages/NotFound.jsx";
|
import NotFound from "./pages/NotFound.js";
|
||||||
|
|
||||||
export function AppRouter() {
|
export function AppRouter() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { ReactNode, useEffect } from 'react';
|
import { ReactNode, useEffect } from 'react';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { useLocalStorage } from '@/hooks/useLocalStorage.js';
|
import { useLocalStorage } from '@/hooks/useLocalStorage.js';
|
||||||
import { AppContext, type AppConfig, type AppContextType, type Theme } from '@/contexts/AppContext.jsx';
|
import { AppContext, type AppConfig, type AppContextType, type Theme } from '@/contexts/AppContext.js';
|
||||||
|
|
||||||
interface AppProviderProps {
|
interface AppProviderProps {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
@@ -88,7 +88,7 @@ function useApplyTheme(theme: Theme) {
|
|||||||
if (theme !== 'system') return;
|
if (theme !== 'system') return;
|
||||||
|
|
||||||
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
||||||
|
|
||||||
const handleChange = () => {
|
const handleChange = () => {
|
||||||
const root = window.document.documentElement;
|
const root = window.document.documentElement;
|
||||||
root.classList.remove('light', 'dark');
|
root.classList.remove('light', 'dark');
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
|
|||||||
import { useCurrentUser } from '@/hooks/useCurrentUser.js';
|
import { useCurrentUser } from '@/hooks/useCurrentUser.js';
|
||||||
import { useNostrPublish } from '@/hooks/useNostrPublish.js';
|
import { useNostrPublish } from '@/hooks/useNostrPublish.js';
|
||||||
import { useToast } from '@/hooks/useToast.js';
|
import { useToast } from '@/hooks/useToast.js';
|
||||||
import { Button } from '@/components/ui/button.jsx';
|
import { Button } from '@/components/ui/button.js';
|
||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
FormControl,
|
FormControl,
|
||||||
@@ -13,10 +13,10 @@ import {
|
|||||||
FormItem,
|
FormItem,
|
||||||
FormLabel,
|
FormLabel,
|
||||||
FormMessage,
|
FormMessage,
|
||||||
} from '@/components/ui/form.jsx';
|
} from '@/components/ui/form.js';
|
||||||
import { Input } from '@/components/ui/input.jsx';
|
import { Input } from '@/components/ui/input.js';
|
||||||
import { Textarea } from '@/components/ui/textarea.jsx';
|
import { Textarea } from '@/components/ui/textarea.js';
|
||||||
import { Switch } from '@/components/ui/switch.jsx';
|
import { Switch } from '@/components/ui/switch.js';
|
||||||
import { Loader2, Upload } from 'lucide-react';
|
import { Loader2, Upload } from 'lucide-react';
|
||||||
import { NSchema as n, type NostrMetadata } from '@nostrify/nostrify';
|
import { NSchema as n, type NostrMetadata } from '@nostrify/nostrify';
|
||||||
import { useQueryClient } from '@tanstack/react-query';
|
import { useQueryClient } from '@tanstack/react-query';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { describe, it, expect } from 'vitest';
|
import { describe, it, expect } from 'vitest';
|
||||||
import { render, screen } from '@testing-library/react';
|
import { render, screen } from '@testing-library/react';
|
||||||
import { TestApp } from '@/test/TestApp.jsx';
|
import { TestApp } from '@/test/TestApp.js';
|
||||||
import { NoteContent } from "./NoteContent.jsx";
|
import { NoteContent } from "./NoteContent.js";
|
||||||
import type { NostrEvent } from '@nostrify/nostrify';
|
import type { NostrEvent } from '@nostrify/nostrify';
|
||||||
|
|
||||||
describe('NoteContent', () => {
|
describe('NoteContent', () => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Check, ChevronsUpDown, Wifi, Plus } from "lucide-react";
|
import { Check, ChevronsUpDown, Wifi, Plus } from "lucide-react";
|
||||||
import { cn } from "@/lib/utils.js";
|
import { cn } from "@/lib/utils.js";
|
||||||
import { Button } from "@/components/ui/button.jsx";
|
import { Button } from "@/components/ui/button.js";
|
||||||
import {
|
import {
|
||||||
Command,
|
Command,
|
||||||
CommandEmpty,
|
CommandEmpty,
|
||||||
@@ -8,12 +8,12 @@ import {
|
|||||||
CommandInput,
|
CommandInput,
|
||||||
CommandItem,
|
CommandItem,
|
||||||
CommandList,
|
CommandList,
|
||||||
} from "@/components/ui/command.jsx";
|
} from "@/components/ui/command.js";
|
||||||
import {
|
import {
|
||||||
Popover,
|
Popover,
|
||||||
PopoverContent,
|
PopoverContent,
|
||||||
PopoverTrigger,
|
PopoverTrigger,
|
||||||
} from "@/components/ui/popover.jsx";
|
} from "@/components/ui/popover.js";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useAppContext } from "@/hooks/useAppContext.js";
|
import { useAppContext } from "@/hooks/useAppContext.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useState, forwardRef } from 'react';
|
import { useState, forwardRef } from 'react';
|
||||||
import { Wallet, Plus, Trash2, Zap, Globe, WalletMinimal, CheckCircle, X } from 'lucide-react';
|
import { Wallet, Plus, Trash2, Zap, Globe, WalletMinimal, CheckCircle, X } from 'lucide-react';
|
||||||
import { Button } from '@/components/ui/button.jsx';
|
import { Button } from '@/components/ui/button.js';
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
} from '@/components/ui/dialog.jsx';
|
} from '@/components/ui/dialog.js';
|
||||||
import {
|
import {
|
||||||
Drawer,
|
Drawer,
|
||||||
DrawerContent,
|
DrawerContent,
|
||||||
@@ -18,12 +18,12 @@ import {
|
|||||||
DrawerTitle,
|
DrawerTitle,
|
||||||
DrawerTrigger,
|
DrawerTrigger,
|
||||||
DrawerClose,
|
DrawerClose,
|
||||||
} from '@/components/ui/drawer.jsx';
|
} from '@/components/ui/drawer.js';
|
||||||
import { Input } from '@/components/ui/input.jsx';
|
import { Input } from '@/components/ui/input.js';
|
||||||
import { Label } from '@/components/ui/label.jsx';
|
import { Label } from '@/components/ui/label.js';
|
||||||
import { Textarea } from '@/components/ui/textarea.jsx';
|
import { Textarea } from '@/components/ui/textarea.js';
|
||||||
import { Badge } from '@/components/ui/badge.jsx';
|
import { Badge } from '@/components/ui/badge.js';
|
||||||
import { Separator } from '@/components/ui/separator.jsx';
|
import { Separator } from '@/components/ui/separator.js';
|
||||||
import { useNWC } from '@/hooks/useNWCContext.js';
|
import { useNWC } from '@/hooks/useNWCContext.js';
|
||||||
import { useWallet } from '@/hooks/useWallet.js';
|
import { useWallet } from '@/hooks/useWallet.js';
|
||||||
import { useToast } from '@/hooks/useToast.js';
|
import { useToast } from '@/hooks/useToast.js';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ZapDialog } from '@/components/ZapDialog.jsx';
|
import { ZapDialog } from '@/components/ZapDialog.js';
|
||||||
import { useZaps } from '@/hooks/useZaps.js';
|
import { useZaps } from '@/hooks/useZaps.js';
|
||||||
import { useWallet } from '@/hooks/useWallet.js';
|
import { useWallet } from '@/hooks/useWallet.js';
|
||||||
import { useCurrentUser } from '@/hooks/useCurrentUser.js';
|
import { useCurrentUser } from '@/hooks/useCurrentUser.js';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useState, useEffect, useRef, forwardRef } from 'react';
|
import { useState, useEffect, useRef, forwardRef } from 'react';
|
||||||
import { Zap, Copy, Check, ExternalLink, Sparkle, Sparkles, Star, Rocket, ArrowLeft, X } from 'lucide-react';
|
import { Zap, Copy, Check, ExternalLink, Sparkle, Sparkles, Star, Rocket, ArrowLeft, X } from 'lucide-react';
|
||||||
import { Button } from '@/components/ui/button.jsx';
|
import { Button } from '@/components/ui/button.js';
|
||||||
import { cn } from '@/lib/utils.js';
|
import { cn } from '@/lib/utils.js';
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
} from '@/components/ui/dialog.jsx';
|
} from '@/components/ui/dialog.js';
|
||||||
import {
|
import {
|
||||||
Drawer,
|
Drawer,
|
||||||
DrawerContent,
|
DrawerContent,
|
||||||
@@ -18,13 +18,13 @@ import {
|
|||||||
DrawerTitle,
|
DrawerTitle,
|
||||||
DrawerTrigger,
|
DrawerTrigger,
|
||||||
DrawerClose,
|
DrawerClose,
|
||||||
} from '@/components/ui/drawer.jsx';
|
} from '@/components/ui/drawer.js';
|
||||||
import { Input } from '@/components/ui/input.jsx';
|
import { Input } from '@/components/ui/input.js';
|
||||||
import { Label } from '@/components/ui/label.jsx';
|
import { Label } from '@/components/ui/label.js';
|
||||||
import { Textarea } from '@/components/ui/textarea.jsx';
|
import { Textarea } from '@/components/ui/textarea.js';
|
||||||
import { Card, CardContent } from '@/components/ui/card.jsx';
|
import { Card, CardContent } from '@/components/ui/card.js';
|
||||||
import { Separator } from '@/components/ui/separator.jsx';
|
import { Separator } from '@/components/ui/separator.js';
|
||||||
import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group.jsx';
|
import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group.js';
|
||||||
import { useCurrentUser } from '@/hooks/useCurrentUser.js';
|
import { useCurrentUser } from '@/hooks/useCurrentUser.js';
|
||||||
import { useAuthor } from '@/hooks/useAuthor.js';
|
import { useAuthor } from '@/hooks/useAuthor.js';
|
||||||
import { useToast } from '@/hooks/useToast.js';
|
import { useToast } from '@/hooks/useToast.js';
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import {
|
|||||||
DropdownMenuItem,
|
DropdownMenuItem,
|
||||||
DropdownMenuSeparator,
|
DropdownMenuSeparator,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from '@/components/ui/dropdown-menu.jsx';
|
} from '@/components/ui/dropdown-menu.js';
|
||||||
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar.jsx';
|
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar.js';
|
||||||
import { RelaySelector } from '@/components/RelaySelector.jsx';
|
import { RelaySelector } from '@/components/RelaySelector.js';
|
||||||
import { WalletModal } from '@/components/WalletModal.jsx';
|
import { WalletModal } from '@/components/WalletModal.js';
|
||||||
import { useLoggedInAccounts, type Account } from '@/hooks/useLoggedInAccounts.js';
|
import { useLoggedInAccounts, type Account } from '@/hooks/useLoggedInAccounts.js';
|
||||||
import { genUserName } from '@/lib/genUserName.js';
|
import { genUserName } from '@/lib/genUserName.js';
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { User, UserPlus } from 'lucide-react';
|
import { User, UserPlus } from 'lucide-react';
|
||||||
import { Button } from '@/components/ui/button.jsx';
|
import { Button } from '@/components/ui/button.js';
|
||||||
import LoginDialog from "./LoginDialog.js";
|
import LoginDialog from "./LoginDialog.js";
|
||||||
import SignupDialog from "./SignupDialog.js";
|
import SignupDialog from "./SignupDialog.js";
|
||||||
import { useLoggedInAccounts } from '@/hooks/useLoggedInAccounts.js';
|
import { useLoggedInAccounts } from '@/hooks/useLoggedInAccounts.js';
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
import React, { useRef, useState, useEffect } from 'react';
|
import React, { useRef, useState, useEffect } from 'react';
|
||||||
import { Shield, Upload, AlertTriangle, UserPlus, KeyRound, Sparkles, Cloud } from 'lucide-react';
|
import { Shield, Upload, AlertTriangle, UserPlus, KeyRound, Sparkles, Cloud } from 'lucide-react';
|
||||||
import { Button } from '@/components/ui/button.jsx';
|
import { Button } from '@/components/ui/button.js';
|
||||||
import { Input } from '@/components/ui/input.jsx';
|
import { Input } from '@/components/ui/input.js';
|
||||||
import { Dialog, DialogContent, DialogHeader, DialogDescription } from "@/components/ui/dialog.jsx";
|
import { Dialog, DialogContent, DialogHeader, DialogDescription } from "@/components/ui/dialog.js";
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs.jsx';
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs.js';
|
||||||
import { Alert, AlertDescription } from '@/components/ui/alert.jsx';
|
import { Alert, AlertDescription } from '@/components/ui/alert.js';
|
||||||
import { useLoginActions } from '@/hooks/useLoginActions.js';
|
import { useLoginActions } from '@/hooks/useLoginActions.js';
|
||||||
import { cn } from '@/lib/utils.js';
|
import { cn } from '@/lib/utils.js';
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
// It is important that all functionality in this file is preserved, and should only be modified if explicitly requested.
|
// It is important that all functionality in this file is preserved, and should only be modified if explicitly requested.
|
||||||
|
|
||||||
import React, { useState, useEffect, useRef } from 'react';
|
import React, { useState, useEffect, useRef } from 'react';
|
||||||
import { Download, Key, UserPlus, FileText, Shield, User, Sparkles, LogIn, Lock, CheckCircle, Upload, Globe, FileSignature, Wand2 } from 'lucide-react';
|
import { Download, Key, UserPlus, FileText, Shield, User, Sparkles, LogIn, CheckCircle, Upload, Globe } from 'lucide-react';
|
||||||
import { Button } from '@/components/ui/button.jsx';
|
import { Button } from '@/components/ui/button.js';
|
||||||
import { Input } from '@/components/ui/input.jsx';
|
import { Input } from '@/components/ui/input.js';
|
||||||
import { Textarea } from '@/components/ui/textarea.jsx';
|
import { Textarea } from '@/components/ui/textarea.js';
|
||||||
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from "@/components/ui/dialog.jsx";
|
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog.js";
|
||||||
import { Card, CardContent } from '@/components/ui/card.jsx';
|
import { Card, CardContent } from '@/components/ui/card.js';
|
||||||
import { toast } from '@/hooks/useToast.js';
|
import { toast } from '@/hooks/useToast.js';
|
||||||
import { useLoginActions } from '@/hooks/useLoginActions.js';
|
import { useLoginActions } from '@/hooks/useLoginActions.js';
|
||||||
import { useNostrPublish } from '@/hooks/useNostrPublish.js';
|
import { useNostrPublish } from '@/hooks/useNostrPublish.js';
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ import { nip19 } from 'nostr-tools';
|
|||||||
import { useAuthor } from '@/hooks/useAuthor.js';
|
import { useAuthor } from '@/hooks/useAuthor.js';
|
||||||
import { useComments } from '@/hooks/useComments.js';
|
import { useComments } from '@/hooks/useComments.js';
|
||||||
import { CommentForm } from "./CommentForm.js";
|
import { CommentForm } from "./CommentForm.js";
|
||||||
import { NoteContent } from '@/components/NoteContent.jsx';
|
import { NoteContent } from '@/components/NoteContent.js';
|
||||||
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar.jsx';
|
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar.js';
|
||||||
import { Button } from '@/components/ui/button.jsx';
|
import { Button } from '@/components/ui/button.js';
|
||||||
import { Card, CardContent } from '@/components/ui/card.jsx';
|
import { Card, CardContent } from '@/components/ui/card.js';
|
||||||
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible.jsx';
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible.js';
|
||||||
import { DropdownMenu, DropdownMenuTrigger } from '@/components/ui/dropdown-menu.jsx';
|
import { DropdownMenu, DropdownMenuTrigger } from '@/components/ui/dropdown-menu.js';
|
||||||
import { MessageSquare, ChevronDown, ChevronRight, MoreHorizontal } from 'lucide-react';
|
import { MessageSquare, ChevronDown, ChevronRight, MoreHorizontal } from 'lucide-react';
|
||||||
import { formatDistanceToNow } from 'date-fns';
|
import { formatDistanceToNow } from 'date-fns';
|
||||||
import { genUserName } from '@/lib/genUserName.js';
|
import { genUserName } from '@/lib/genUserName.js';
|
||||||
@@ -26,10 +26,10 @@ interface CommentProps {
|
|||||||
export function Comment({ root, comment, depth = 0, maxDepth = 3, limit }: CommentProps) {
|
export function Comment({ root, comment, depth = 0, maxDepth = 3, limit }: CommentProps) {
|
||||||
const [showReplyForm, setShowReplyForm] = useState(false);
|
const [showReplyForm, setShowReplyForm] = useState(false);
|
||||||
const [showReplies, setShowReplies] = useState(depth < 2); // Auto-expand first 2 levels
|
const [showReplies, setShowReplies] = useState(depth < 2); // Auto-expand first 2 levels
|
||||||
|
|
||||||
const author = useAuthor(comment.pubkey);
|
const author = useAuthor(comment.pubkey);
|
||||||
const { data: commentsData } = useComments(root, limit);
|
const { data: commentsData } = useComments(root, limit);
|
||||||
|
|
||||||
const metadata = author.data?.metadata;
|
const metadata = author.data?.metadata;
|
||||||
const displayName = metadata?.name ?? genUserName(comment.pubkey)
|
const displayName = metadata?.name ?? genUserName(comment.pubkey)
|
||||||
const timeAgo = formatDistanceToNow(new Date(comment.created_at * 1000), { addSuffix: true });
|
const timeAgo = formatDistanceToNow(new Date(comment.created_at * 1000), { addSuffix: true });
|
||||||
@@ -55,7 +55,7 @@ export function Comment({ root, comment, depth = 0, maxDepth = 3, limit }: Comme
|
|||||||
</Avatar>
|
</Avatar>
|
||||||
</Link>
|
</Link>
|
||||||
<div>
|
<div>
|
||||||
<Link
|
<Link
|
||||||
to={`/${nip19.npubEncode(comment.pubkey)}`}
|
to={`/${nip19.npubEncode(comment.pubkey)}`}
|
||||||
className="font-medium text-sm hover:text-primary transition-colors"
|
className="font-medium text-sm hover:text-primary transition-colors"
|
||||||
>
|
>
|
||||||
@@ -83,7 +83,7 @@ export function Comment({ root, comment, depth = 0, maxDepth = 3, limit }: Comme
|
|||||||
<MessageSquare className="h-3 w-3 mr-1" />
|
<MessageSquare className="h-3 w-3 mr-1" />
|
||||||
Reply
|
Reply
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{hasReplies && (
|
{hasReplies && (
|
||||||
<Collapsible open={showReplies} onOpenChange={setShowReplies}>
|
<Collapsible open={showReplies} onOpenChange={setShowReplies}>
|
||||||
<CollapsibleTrigger asChild>
|
<CollapsibleTrigger asChild>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { Button } from '@/components/ui/button.jsx';
|
import { Button } from '@/components/ui/button.js';
|
||||||
import { Textarea } from '@/components/ui/textarea.jsx';
|
import { Textarea } from '@/components/ui/textarea.js';
|
||||||
import { Card, CardContent } from '@/components/ui/card.jsx';
|
import { Card, CardContent } from '@/components/ui/card.js';
|
||||||
import { useCurrentUser } from '@/hooks/useCurrentUser.js';
|
import { useCurrentUser } from '@/hooks/useCurrentUser.js';
|
||||||
import { usePostComment } from '@/hooks/usePostComment.js';
|
import { usePostComment } from '@/hooks/usePostComment.js';
|
||||||
import { LoginArea } from '@/components/auth/LoginArea.jsx';
|
import { LoginArea } from '@/components/auth/LoginArea.js';
|
||||||
import { NostrEvent } from '@nostrify/nostrify';
|
import { NostrEvent } from '@nostrify/nostrify';
|
||||||
import { MessageSquare, Send } from 'lucide-react';
|
import { MessageSquare, Send } from 'lucide-react';
|
||||||
|
|
||||||
@@ -19,9 +19,9 @@ interface CommentFormProps {
|
|||||||
export function CommentForm({
|
export function CommentForm({
|
||||||
root,
|
root,
|
||||||
reply,
|
reply,
|
||||||
onSuccess,
|
onSuccess,
|
||||||
placeholder = "Write a comment...",
|
placeholder = "Write a comment...",
|
||||||
compact = false
|
compact = false
|
||||||
}: CommentFormProps) {
|
}: CommentFormProps) {
|
||||||
const [content, setContent] = useState('');
|
const [content, setContent] = useState('');
|
||||||
const { user } = useCurrentUser();
|
const { user } = useCurrentUser();
|
||||||
@@ -29,7 +29,7 @@ export function CommentForm({
|
|||||||
|
|
||||||
const handleSubmit = (e: React.FormEvent) => {
|
const handleSubmit = (e: React.FormEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
if (!content.trim() || !user) return;
|
if (!content.trim() || !user) return;
|
||||||
|
|
||||||
postComment(
|
postComment(
|
||||||
@@ -74,8 +74,8 @@ export function CommentForm({
|
|||||||
<span className="text-sm text-muted-foreground">
|
<span className="text-sm text-muted-foreground">
|
||||||
{reply ? 'Replying to comment' : 'Adding to the discussion'}
|
{reply ? 'Replying to comment' : 'Adding to the discussion'}
|
||||||
</span>
|
</span>
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={!content.trim() || isPending}
|
disabled={!content.trim() || isPending}
|
||||||
size={compact ? "sm" : "default"}
|
size={compact ? "sm" : "default"}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useComments } from '@/hooks/useComments.js';
|
import { useComments } from '@/hooks/useComments.js';
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card.jsx';
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card.js';
|
||||||
import { Skeleton } from '@/components/ui/skeleton.jsx';
|
import { Skeleton } from '@/components/ui/skeleton.js';
|
||||||
import { MessageSquare } from 'lucide-react';
|
import { MessageSquare } from 'lucide-react';
|
||||||
import { cn } from '@/lib/utils.js';
|
import { cn } from '@/lib/utils.js';
|
||||||
import type { NostrEvent } from '@nostrify/nostrify';
|
import type { NostrEvent } from '@nostrify/nostrify';
|
||||||
@@ -16,7 +16,7 @@ interface CommentsSectionProps {
|
|||||||
limit?: number;
|
limit?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function CommentsSection({
|
export function CommentsSection({
|
||||||
root,
|
root,
|
||||||
title = "Comments",
|
title = "Comments",
|
||||||
emptyStateMessage = "No comments yet",
|
emptyStateMessage = "No comments yet",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import useEmblaCarousel, {
|
|||||||
import { ArrowLeft, ArrowRight } from "lucide-react"
|
import { ArrowLeft, ArrowRight } from "lucide-react"
|
||||||
|
|
||||||
import { cn } from "@/lib/utils.js"
|
import { cn } from "@/lib/utils.js"
|
||||||
import { Button } from "@/components/ui/button.jsx"
|
import { Button } from "@/components/ui/button.js"
|
||||||
|
|
||||||
type CarouselApi = UseEmblaCarouselType[1]
|
type CarouselApi = UseEmblaCarouselType[1]
|
||||||
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
|
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { Command as CommandPrimitive } from "cmdk"
|
|||||||
import { Search } from "lucide-react"
|
import { Search } from "lucide-react"
|
||||||
|
|
||||||
import { cn } from "@/lib/utils.js"
|
import { cn } from "@/lib/utils.js"
|
||||||
import { Dialog, DialogContent } from "@/components/ui/dialog.jsx"
|
import { Dialog, DialogContent } from "@/components/ui/dialog.js"
|
||||||
|
|
||||||
const Command = React.forwardRef<
|
const Command = React.forwardRef<
|
||||||
React.ElementRef<typeof CommandPrimitive>,
|
React.ElementRef<typeof CommandPrimitive>,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
} from "react-hook-form"
|
} from "react-hook-form"
|
||||||
|
|
||||||
import { cn } from "@/lib/utils.js"
|
import { cn } from "@/lib/utils.js"
|
||||||
import { Label } from "@/components/ui/label.jsx"
|
import { Label } from "@/components/ui/label.js"
|
||||||
import { FormFieldContext, FormItemContext, useFormField } from "./form-utils.js"
|
import { FormFieldContext, FormItemContext, useFormField } from "./form-utils.js"
|
||||||
|
|
||||||
const Form = FormProvider
|
const Form = FormProvider
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import * as React from "react"
|
|||||||
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"
|
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"
|
||||||
|
|
||||||
import { cn } from "@/lib/utils.js"
|
import { cn } from "@/lib/utils.js"
|
||||||
import { ButtonProps } from "@/components/ui/button.jsx"
|
import { ButtonProps } from "@/components/ui/button.js"
|
||||||
import { buttonVariants } from "@/components/ui/button-variants.js"
|
import { buttonVariants } from "@/components/ui/button-variants.js"
|
||||||
|
|
||||||
const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
|
const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
|
||||||
|
|||||||
@@ -5,17 +5,17 @@ import { PanelLeft } from "lucide-react"
|
|||||||
|
|
||||||
import { useIsMobile } from "@/hooks/useIsMobile.js"
|
import { useIsMobile } from "@/hooks/useIsMobile.js"
|
||||||
import { cn } from "@/lib/utils.js"
|
import { cn } from "@/lib/utils.js"
|
||||||
import { Button } from "@/components/ui/button.jsx"
|
import { Button } from "@/components/ui/button.js"
|
||||||
import { Input } from "@/components/ui/input.jsx"
|
import { Input } from "@/components/ui/input.js"
|
||||||
import { Separator } from "@/components/ui/separator.jsx"
|
import { Separator } from "@/components/ui/separator.js"
|
||||||
import { Sheet, SheetContent } from "@/components/ui/sheet.jsx"
|
import { Sheet, SheetContent } from "@/components/ui/sheet.js"
|
||||||
import { Skeleton } from "@/components/ui/skeleton.jsx"
|
import { Skeleton } from "@/components/ui/skeleton.js"
|
||||||
import {
|
import {
|
||||||
Tooltip,
|
Tooltip,
|
||||||
TooltipContent,
|
TooltipContent,
|
||||||
TooltipProvider,
|
TooltipProvider,
|
||||||
TooltipTrigger,
|
TooltipTrigger,
|
||||||
} from "@/components/ui/tooltip.jsx"
|
} from "@/components/ui/tooltip.js"
|
||||||
import {
|
import {
|
||||||
SIDEBAR_COOKIE_NAME,
|
SIDEBAR_COOKIE_NAME,
|
||||||
SIDEBAR_COOKIE_MAX_AGE,
|
SIDEBAR_COOKIE_MAX_AGE,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
ToastProvider,
|
ToastProvider,
|
||||||
ToastTitle,
|
ToastTitle,
|
||||||
ToastViewport,
|
ToastViewport,
|
||||||
} from "@/components/ui/toast.jsx"
|
} from "@/components/ui/toast.js"
|
||||||
|
|
||||||
export function Toaster() {
|
export function Toaster() {
|
||||||
const { toasts } = useToast()
|
const { toasts } = useToast()
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import * as React from "react"
|
|||||||
import type {
|
import type {
|
||||||
ToastActionElement,
|
ToastActionElement,
|
||||||
ToastProps,
|
ToastProps,
|
||||||
} from "@/components/ui/toast.jsx"
|
} from "@/components/ui/toast.js"
|
||||||
|
|
||||||
const TOAST_LIMIT = 1
|
const TOAST_LIMIT = 1
|
||||||
const TOAST_REMOVE_DELAY = 1000000
|
const TOAST_REMOVE_DELAY = 1000000
|
||||||
|
|||||||
+2
-2
@@ -3,8 +3,8 @@ import { createRoot } from 'react-dom/client';
|
|||||||
// Import polyfills first
|
// Import polyfills first
|
||||||
import "./lib/polyfills.js";
|
import "./lib/polyfills.js";
|
||||||
|
|
||||||
import { ErrorBoundary } from '@/components/ErrorBoundary.jsx';
|
import { ErrorBoundary } from '@/components/ErrorBoundary.js';
|
||||||
import App from "./App.jsx";
|
import App from "./App.js";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
// FIXME: a custom font should be used. Eg:
|
// FIXME: a custom font should be used. Eg:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { render, screen } from '@testing-library/react';
|
import { render, screen } from '@testing-library/react';
|
||||||
import { describe, it, expect, vi } from 'vitest';
|
import { describe, it, expect, vi } from 'vitest';
|
||||||
import { ErrorBoundary } from '@/components/ErrorBoundary.jsx';
|
import { ErrorBoundary } from '@/components/ErrorBoundary.js';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|||||||
import { createHead, UnheadProvider } from '@unhead/react/client';
|
import { createHead, UnheadProvider } from '@unhead/react/client';
|
||||||
import { BrowserRouter } from 'react-router-dom';
|
import { BrowserRouter } from 'react-router-dom';
|
||||||
import { NostrLoginProvider } from '@nostrify/react/login';
|
import { NostrLoginProvider } from '@nostrify/react/login';
|
||||||
import NostrProvider from '@/components/NostrProvider.jsx';
|
import NostrProvider from '@/components/NostrProvider.js';
|
||||||
import { AppProvider } from '@/components/AppProvider.jsx';
|
import { AppProvider } from '@/components/AppProvider.js';
|
||||||
import { NWCProvider } from '@/contexts/NWCContext.jsx';
|
import { NWCProvider } from '@/contexts/NWCContext.js';
|
||||||
import { AppConfig } from '@/contexts/AppContext.jsx';
|
import { AppConfig } from '@/contexts/AppContext.js';
|
||||||
|
|
||||||
interface TestAppProps {
|
interface TestAppProps {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
"module": "nodenext",
|
"module": "nodenext",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
|
|
||||||
/* Bundler mode */
|
/* NodeNext mode */
|
||||||
"moduleResolution": "nodenext",
|
"moduleResolution": "nodenext",
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"moduleDetection": "force",
|
"moduleDetection": "force",
|
||||||
|
|||||||
Reference in new issue
Block a user