Switch to nodenext, add file extensions to all imports

This commit is contained in:
Alex Gleason committed 2025-09-02 01:42:31 -05:00
1 parent b4a1a46430
commit 9741f440eb
84 files changed
+237 -234

No files matched your search

+8 -8
View File
@@ -9,7 +9,7 @@
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"@fontsource-variable/inter": "^5.2.6", "@fontsource-variable/inter": "^5.2.6",
"@getalby/sdk": "^5.1.1", "@getalby/sdk": "^6.0.0",
"@hookform/resolvers": "^3.9.0", "@hookform/resolvers": "^3.9.0",
"@nostrify/nostrify": "npm:@jsr/nostrify__nostrify@^0.46.4", "@nostrify/nostrify": "npm:@jsr/nostrify__nostrify@^0.46.4",
"@nostrify/react": "npm:@jsr/nostrify__react@^0.2.8", "@nostrify/react": "npm:@jsr/nostrify__react@^0.2.8",
@@ -953,9 +953,9 @@
} }
}, },
"node_modules/@getalby/lightning-tools": { "node_modules/@getalby/lightning-tools": {
"version": "5.2.0", "version": "5.2.1",
"resolved": "https://registry.npmjs.org/@getalby/lightning-tools/-/lightning-tools-5.2.0.tgz", "resolved": "https://registry.npmjs.org/@getalby/lightning-tools/-/lightning-tools-5.2.1.tgz",
"integrity": "sha512-8kBvENBTMh541VjGKhw3I29+549/C02gLSh3AQaMfoMNSZaMxfQW+7dcMcc7vbFaCKEcEe18ST5bUveTRBuXCQ==", "integrity": "sha512-dxOmJLJAh6qJ8rsbA5/Bwj7MSI9X3RkxxqmCedl5rfP+yKwNSdfu8i4EiCZN/tk2hNBJb8GHSCcPRNZfwfmEHg==",
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">=14" "node": ">=14"
@@ -966,12 +966,12 @@
} }
}, },
"node_modules/@getalby/sdk": { "node_modules/@getalby/sdk": {
"version": "5.1.1", "version": "6.0.0",
"resolved": "https://registry.npmjs.org/@getalby/sdk/-/sdk-5.1.1.tgz", "resolved": "https://registry.npmjs.org/@getalby/sdk/-/sdk-6.0.0.tgz",
"integrity": "sha512-t/kg2ljPx86qRYKqEVc5VYhDICFKtVPRlQKIz5cI/AqOLYVguLJz1AkQlDBaiOz2PW5FxoyGlLkTGmX7ONHH/Q==", "integrity": "sha512-ix2ZFcYwxBy3r4o11C1jC4Hwlu2s8C9pz7Y/NWYw8sSEutioPjG2e0k5Nx1nTs6luQ2LKUBFg9/6f1akZiwYcw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@getalby/lightning-tools": "^5.1.2", "@getalby/lightning-tools": "^5.2.0",
"nostr-tools": "2.15.0" "nostr-tools": "2.15.0"
}, },
"engines": { "engines": {
+2 -1
View File
@@ -7,11 +7,12 @@
"dev": "npm i && vite", "dev": "npm i && vite",
"build": "npm i && vite build && cp dist/index.html dist/404.html", "build": "npm i && vite build && cp dist/index.html dist/404.html",
"test": "npm i && tsc -p tsconfig.app.json --noEmit && eslint && vitest run && vite build", "test": "npm i && tsc -p tsconfig.app.json --noEmit && eslint && vitest run && vite build",
"check": "tsc -p tsconfig.app.json --noEmit",
"deploy": "npm run build && npx -y nostr-deploy-cli deploy --skip-setup" "deploy": "npm run build && npx -y nostr-deploy-cli deploy --skip-setup"
}, },
"dependencies": { "dependencies": {
"@fontsource-variable/inter": "^5.2.6", "@fontsource-variable/inter": "^5.2.6",
"@getalby/sdk": "^5.1.1", "@getalby/sdk": "^6.0.0",
"@hookform/resolvers": "^3.9.0", "@hookform/resolvers": "^3.9.0",
"@nostrify/nostrify": "npm:@jsr/nostrify__nostrify@^0.46.4", "@nostrify/nostrify": "npm:@jsr/nostrify__nostrify@^0.46.4",
"@nostrify/react": "npm:@jsr/nostrify__react@^0.2.8", "@nostrify/react": "npm:@jsr/nostrify__react@^0.2.8",
+1 -1
View File
@@ -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'; import App from "./App.jsx";
test('App', () => { test('App', () => {
render(<App />); render(<App />);
+7 -7
View File
@@ -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'; import NostrProvider from '@/components/NostrProvider.jsx';
import { Toaster } from "@/components/ui/toaster"; import { Toaster } from "@/components/ui/toaster.jsx";
import { TooltipProvider } from "@/components/ui/tooltip"; import { TooltipProvider } from "@/components/ui/tooltip.jsx";
import { NostrLoginProvider } from '@nostrify/react/login'; import { NostrLoginProvider } from '@nostrify/react/login';
import { AppProvider } from '@/components/AppProvider'; import { AppProvider } from '@/components/AppProvider.jsx';
import { NWCProvider } from '@/contexts/NWCContext'; import { NWCProvider } from '@/contexts/NWCContext.jsx';
import { AppConfig } from '@/contexts/AppContext'; import { AppConfig } from '@/contexts/AppContext.jsx';
import AppRouter from './AppRouter'; import AppRouter from "./AppRouter.jsx";
const head = createHead({ const head = createHead({
plugins: [ plugins: [
+4 -4
View File
@@ -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"; import { ScrollToTop } from "./components/ScrollToTop.jsx";
import Index from "./pages/Index"; import Index from "./pages/Index.jsx";
import { NIP19Page } from "./pages/NIP19Page"; import { NIP19Page } from "./pages/NIP19Page.jsx";
import NotFound from "./pages/NotFound"; import NotFound from "./pages/NotFound.jsx";
export function AppRouter() { export function AppRouter() {
return ( return (
+2 -2
View File
@@ -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'; import { useLocalStorage } from '@/hooks/useLocalStorage.js';
import { AppContext, type AppConfig, type AppContextType, type Theme } from '@/contexts/AppContext'; import { AppContext, type AppConfig, type AppContextType, type Theme } from '@/contexts/AppContext.jsx';
interface AppProviderProps { interface AppProviderProps {
children: ReactNode; children: ReactNode;
+9 -9
View File
@@ -1,10 +1,10 @@
import React, { useEffect, useRef } from 'react'; import React, { useEffect, useRef } from 'react';
import { useForm } from 'react-hook-form'; import { useForm } from 'react-hook-form';
import { zodResolver } from '@hookform/resolvers/zod'; import { zodResolver } from '@hookform/resolvers/zod';
import { useCurrentUser } from '@/hooks/useCurrentUser'; import { useCurrentUser } from '@/hooks/useCurrentUser.js';
import { useNostrPublish } from '@/hooks/useNostrPublish'; import { useNostrPublish } from '@/hooks/useNostrPublish.js';
import { useToast } from '@/hooks/useToast'; import { useToast } from '@/hooks/useToast.js';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button.jsx';
import { import {
Form, Form,
FormControl, FormControl,
@@ -13,14 +13,14 @@ import {
FormItem, FormItem,
FormLabel, FormLabel,
FormMessage, FormMessage,
} from '@/components/ui/form'; } from '@/components/ui/form.jsx';
import { Input } from '@/components/ui/input'; import { Input } from '@/components/ui/input.jsx';
import { Textarea } from '@/components/ui/textarea'; import { Textarea } from '@/components/ui/textarea.jsx';
import { Switch } from '@/components/ui/switch'; import { Switch } from '@/components/ui/switch.jsx';
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';
import { useUploadFile } from '@/hooks/useUploadFile'; import { useUploadFile } from '@/hooks/useUploadFile.js';
export const EditProfileForm: React.FC = () => { export const EditProfileForm: React.FC = () => {
const queryClient = useQueryClient(); const queryClient = useQueryClient();
+1 -1
View File
@@ -2,7 +2,7 @@ import React, { useEffect, useRef } from 'react';
import { NostrEvent, NPool, NRelay1 } from '@nostrify/nostrify'; import { NostrEvent, NPool, NRelay1 } from '@nostrify/nostrify';
import { NostrContext } from '@nostrify/react'; import { NostrContext } from '@nostrify/react';
import { useQueryClient } from '@tanstack/react-query'; import { useQueryClient } from '@tanstack/react-query';
import { useAppContext } from '@/hooks/useAppContext'; import { useAppContext } from '@/hooks/useAppContext.js';
interface NostrProviderProps { interface NostrProviderProps {
children: React.ReactNode; children: React.ReactNode;
+2 -2
View File
@@ -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'; import { TestApp } from '@/test/TestApp.jsx';
import { NoteContent } from './NoteContent'; import { NoteContent } from "./NoteContent.jsx";
import type { NostrEvent } from '@nostrify/nostrify'; import type { NostrEvent } from '@nostrify/nostrify';
describe('NoteContent', () => { describe('NoteContent', () => {
+3 -3
View File
@@ -2,9 +2,9 @@ import { useMemo } from 'react';
import { type NostrEvent } from '@nostrify/nostrify'; import { type NostrEvent } from '@nostrify/nostrify';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { nip19 } from 'nostr-tools'; import { nip19 } from 'nostr-tools';
import { useAuthor } from '@/hooks/useAuthor'; import { useAuthor } from '@/hooks/useAuthor.js';
import { genUserName } from '@/lib/genUserName'; import { genUserName } from '@/lib/genUserName.js';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils.js';
interface NoteContentProps { interface NoteContentProps {
event: NostrEvent; event: NostrEvent;
+5 -5
View File
@@ -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"; import { cn } from "@/lib/utils.js";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button.jsx";
import { import {
Command, Command,
CommandEmpty, CommandEmpty,
@@ -8,14 +8,14 @@ import {
CommandInput, CommandInput,
CommandItem, CommandItem,
CommandList, CommandList,
} from "@/components/ui/command"; } from "@/components/ui/command.jsx";
import { import {
Popover, Popover,
PopoverContent, PopoverContent,
PopoverTrigger, PopoverTrigger,
} from "@/components/ui/popover"; } from "@/components/ui/popover.jsx";
import { useState } from "react"; import { useState } from "react";
import { useAppContext } from "@/hooks/useAppContext"; import { useAppContext } from "@/hooks/useAppContext.js";
interface RelaySelectorProps { interface RelaySelectorProps {
className?: string; className?: string;
+13 -13
View File
@@ -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'; import { Button } from '@/components/ui/button.jsx';
import { import {
Dialog, Dialog,
DialogContent, DialogContent,
@@ -9,7 +9,7 @@ import {
DialogHeader, DialogHeader,
DialogTitle, DialogTitle,
DialogTrigger, DialogTrigger,
} from '@/components/ui/dialog'; } from '@/components/ui/dialog.jsx';
import { import {
Drawer, Drawer,
DrawerContent, DrawerContent,
@@ -18,17 +18,17 @@ import {
DrawerTitle, DrawerTitle,
DrawerTrigger, DrawerTrigger,
DrawerClose, DrawerClose,
} from '@/components/ui/drawer'; } from '@/components/ui/drawer.jsx';
import { Input } from '@/components/ui/input'; import { Input } from '@/components/ui/input.jsx';
import { Label } from '@/components/ui/label'; import { Label } from '@/components/ui/label.jsx';
import { Textarea } from '@/components/ui/textarea'; import { Textarea } from '@/components/ui/textarea.jsx';
import { Badge } from '@/components/ui/badge'; import { Badge } from '@/components/ui/badge.jsx';
import { Separator } from '@/components/ui/separator'; import { Separator } from '@/components/ui/separator.jsx';
import { useNWC } from '@/hooks/useNWCContext'; import { useNWC } from '@/hooks/useNWCContext.js';
import { useWallet } from '@/hooks/useWallet'; import { useWallet } from '@/hooks/useWallet.js';
import { useToast } from '@/hooks/useToast'; import { useToast } from '@/hooks/useToast.js';
import { useIsMobile } from '@/hooks/useIsMobile'; import { useIsMobile } from '@/hooks/useIsMobile.js';
import type { NWCConnection, NWCInfo } from '@/hooks/useNWC'; import type { NWCConnection, NWCInfo } from '@/hooks/useNWC.js';
interface WalletModalProps { interface WalletModalProps {
children?: React.ReactNode; children?: React.ReactNode;
+5 -5
View File
@@ -1,8 +1,8 @@
import { ZapDialog } from '@/components/ZapDialog'; import { ZapDialog } from '@/components/ZapDialog.jsx';
import { useZaps } from '@/hooks/useZaps'; import { useZaps } from '@/hooks/useZaps.js';
import { useWallet } from '@/hooks/useWallet'; import { useWallet } from '@/hooks/useWallet.js';
import { useCurrentUser } from '@/hooks/useCurrentUser'; import { useCurrentUser } from '@/hooks/useCurrentUser.js';
import { useAuthor } from '@/hooks/useAuthor'; import { useAuthor } from '@/hooks/useAuthor.js';
import { Zap } from 'lucide-react'; import { Zap } from 'lucide-react';
import type { Event } from 'nostr-tools'; import type { Event } from 'nostr-tools';
+16 -16
View File
@@ -1,7 +1,7 @@
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'; import { Button } from '@/components/ui/button.jsx';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils.js';
import { import {
Dialog, Dialog,
DialogContent, DialogContent,
@@ -9,7 +9,7 @@ import {
DialogHeader, DialogHeader,
DialogTitle, DialogTitle,
DialogTrigger, DialogTrigger,
} from '@/components/ui/dialog'; } from '@/components/ui/dialog.jsx';
import { import {
Drawer, Drawer,
DrawerContent, DrawerContent,
@@ -18,19 +18,19 @@ import {
DrawerTitle, DrawerTitle,
DrawerTrigger, DrawerTrigger,
DrawerClose, DrawerClose,
} from '@/components/ui/drawer'; } from '@/components/ui/drawer.jsx';
import { Input } from '@/components/ui/input'; import { Input } from '@/components/ui/input.jsx';
import { Label } from '@/components/ui/label'; import { Label } from '@/components/ui/label.jsx';
import { Textarea } from '@/components/ui/textarea'; import { Textarea } from '@/components/ui/textarea.jsx';
import { Card, CardContent } from '@/components/ui/card'; import { Card, CardContent } from '@/components/ui/card.jsx';
import { Separator } from '@/components/ui/separator'; import { Separator } from '@/components/ui/separator.jsx';
import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group'; import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group.jsx';
import { useCurrentUser } from '@/hooks/useCurrentUser'; import { useCurrentUser } from '@/hooks/useCurrentUser.js';
import { useAuthor } from '@/hooks/useAuthor'; import { useAuthor } from '@/hooks/useAuthor.js';
import { useToast } from '@/hooks/useToast'; import { useToast } from '@/hooks/useToast.js';
import { useZaps } from '@/hooks/useZaps'; import { useZaps } from '@/hooks/useZaps.js';
import { useWallet } from '@/hooks/useWallet'; import { useWallet } from '@/hooks/useWallet.js';
import { useIsMobile } from '@/hooks/useIsMobile'; import { useIsMobile } from '@/hooks/useIsMobile.js';
import type { Event } from 'nostr-tools'; import type { Event } from 'nostr-tools';
import QRCode from 'qrcode'; import QRCode from 'qrcode';
+6 -6
View File
@@ -8,12 +8,12 @@ import {
DropdownMenuItem, DropdownMenuItem,
DropdownMenuSeparator, DropdownMenuSeparator,
DropdownMenuTrigger, DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu.tsx'; } from '@/components/ui/dropdown-menu.jsx';
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar.tsx'; import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar.jsx';
import { RelaySelector } from '@/components/RelaySelector'; import { RelaySelector } from '@/components/RelaySelector.jsx';
import { WalletModal } from '@/components/WalletModal'; import { WalletModal } from '@/components/WalletModal.jsx';
import { useLoggedInAccounts, type Account } from '@/hooks/useLoggedInAccounts'; import { useLoggedInAccounts, type Account } from '@/hooks/useLoggedInAccounts.js';
import { genUserName } from '@/lib/genUserName'; import { genUserName } from '@/lib/genUserName.js';
interface AccountSwitcherProps { interface AccountSwitcherProps {
onAddAccountClick: () => void; onAddAccountClick: () => void;
+6 -6
View File
@@ -3,12 +3,12 @@
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.tsx'; import { Button } from '@/components/ui/button.jsx';
import LoginDialog from './LoginDialog'; import LoginDialog from "./LoginDialog.js";
import SignupDialog from './SignupDialog'; import SignupDialog from "./SignupDialog.js";
import { useLoggedInAccounts } from '@/hooks/useLoggedInAccounts'; import { useLoggedInAccounts } from '@/hooks/useLoggedInAccounts.js';
import { AccountSwitcher } from './AccountSwitcher'; import { AccountSwitcher } from "./AccountSwitcher.js";
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils.js';
export interface LoginAreaProps { export interface LoginAreaProps {
className?: string; className?: string;
+7 -7
View File
@@ -3,13 +3,13 @@
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'; import { Button } from '@/components/ui/button.jsx';
import { Input } from '@/components/ui/input'; import { Input } from '@/components/ui/input.jsx';
import { Dialog, DialogContent, DialogHeader, DialogDescription } from "@/components/ui/dialog"; import { Dialog, DialogContent, DialogHeader, DialogDescription } from "@/components/ui/dialog.jsx";
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs.jsx';
import { Alert, AlertDescription } from '@/components/ui/alert'; import { Alert, AlertDescription } from '@/components/ui/alert.jsx';
import { useLoginActions } from '@/hooks/useLoginActions'; import { useLoginActions } from '@/hooks/useLoginActions.js';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils.js';
interface LoginDialogProps { interface LoginDialogProps {
isOpen: boolean; isOpen: boolean;
+10 -10
View File
@@ -3,17 +3,17 @@
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, Lock, CheckCircle, Upload, Globe, FileSignature, Wand2 } from 'lucide-react';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button.jsx';
import { Input } from '@/components/ui/input'; import { Input } from '@/components/ui/input.jsx';
import { Textarea } from '@/components/ui/textarea'; import { Textarea } from '@/components/ui/textarea.jsx';
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from "@/components/ui/dialog"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from "@/components/ui/dialog.jsx";
import { Card, CardContent } from '@/components/ui/card'; import { Card, CardContent } from '@/components/ui/card.jsx';
import { toast } from '@/hooks/useToast'; import { toast } from '@/hooks/useToast.js';
import { useLoginActions } from '@/hooks/useLoginActions'; import { useLoginActions } from '@/hooks/useLoginActions.js';
import { useNostrPublish } from '@/hooks/useNostrPublish'; import { useNostrPublish } from '@/hooks/useNostrPublish.js';
import { useUploadFile } from '@/hooks/useUploadFile'; import { useUploadFile } from '@/hooks/useUploadFile.js';
import { generateSecretKey, nip19 } from 'nostr-tools'; import { generateSecretKey, nip19 } from 'nostr-tools';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils.js';
interface SignupDialogProps { interface SignupDialogProps {
isOpen: boolean; isOpen: boolean;
+10 -10
View File
@@ -2,18 +2,18 @@ import { useState } from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { NostrEvent } from '@nostrify/nostrify'; import { NostrEvent } from '@nostrify/nostrify';
import { nip19 } from 'nostr-tools'; import { nip19 } from 'nostr-tools';
import { useAuthor } from '@/hooks/useAuthor'; import { useAuthor } from '@/hooks/useAuthor.js';
import { useComments } from '@/hooks/useComments'; import { useComments } from '@/hooks/useComments.js';
import { CommentForm } from './CommentForm'; import { CommentForm } from "./CommentForm.js";
import { NoteContent } from '@/components/NoteContent'; import { NoteContent } from '@/components/NoteContent.jsx';
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar.jsx';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button.jsx';
import { Card, CardContent } from '@/components/ui/card'; import { Card, CardContent } from '@/components/ui/card.jsx';
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible'; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible.jsx';
import { DropdownMenu, DropdownMenuTrigger } from '@/components/ui/dropdown-menu'; import { DropdownMenu, DropdownMenuTrigger } from '@/components/ui/dropdown-menu.jsx';
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'; import { genUserName } from '@/lib/genUserName.js';
interface CommentProps { interface CommentProps {
root: NostrEvent | URL; root: NostrEvent | URL;
+6 -6
View File
@@ -1,10 +1,10 @@
import { useState } from 'react'; import { useState } from 'react';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button.jsx';
import { Textarea } from '@/components/ui/textarea'; import { Textarea } from '@/components/ui/textarea.jsx';
import { Card, CardContent } from '@/components/ui/card'; import { Card, CardContent } from '@/components/ui/card.jsx';
import { useCurrentUser } from '@/hooks/useCurrentUser'; import { useCurrentUser } from '@/hooks/useCurrentUser.js';
import { usePostComment } from '@/hooks/usePostComment'; import { usePostComment } from '@/hooks/usePostComment.js';
import { LoginArea } from '@/components/auth/LoginArea'; import { LoginArea } from '@/components/auth/LoginArea.jsx';
import { NostrEvent } from '@nostrify/nostrify'; import { NostrEvent } from '@nostrify/nostrify';
import { MessageSquare, Send } from 'lucide-react'; import { MessageSquare, Send } from 'lucide-react';
+6 -6
View File
@@ -1,11 +1,11 @@
import { useComments } from '@/hooks/useComments'; import { useComments } from '@/hooks/useComments.js';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card.jsx';
import { Skeleton } from '@/components/ui/skeleton'; import { Skeleton } from '@/components/ui/skeleton.jsx';
import { MessageSquare } from 'lucide-react'; import { MessageSquare } from 'lucide-react';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils.js';
import type { NostrEvent } from '@nostrify/nostrify'; import type { NostrEvent } from '@nostrify/nostrify';
import { CommentForm } from './CommentForm'; import { CommentForm } from "./CommentForm.js";
import { Comment } from './Comment'; import { Comment } from "./Comment.js";
interface CommentsSectionProps { interface CommentsSectionProps {
root: NostrEvent | URL; root: NostrEvent | URL;
+1 -1
View File
@@ -2,7 +2,7 @@ import * as React from "react"
import * as AccordionPrimitive from "@radix-ui/react-accordion" import * as AccordionPrimitive from "@radix-ui/react-accordion"
import { ChevronDown } from "lucide-react" import { ChevronDown } from "lucide-react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const Accordion = AccordionPrimitive.Root const Accordion = AccordionPrimitive.Root
+2 -2
View File
@@ -1,8 +1,8 @@
import * as React from "react" import * as React from "react"
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog" import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
import { buttonVariants } from "@/components/ui/button-variants" import { buttonVariants } from "@/components/ui/button-variants.js"
const AlertDialog = AlertDialogPrimitive.Root const AlertDialog = AlertDialogPrimitive.Root
+1 -1
View File
@@ -1,7 +1,7 @@
import * as React from "react" import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority" import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const alertVariants = cva( const alertVariants = cva(
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
+1 -1
View File
@@ -1,7 +1,7 @@
import * as React from "react" import * as React from "react"
import * as AvatarPrimitive from "@radix-ui/react-avatar" import * as AvatarPrimitive from "@radix-ui/react-avatar"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const Avatar = React.forwardRef< const Avatar = React.forwardRef<
React.ElementRef<typeof AvatarPrimitive.Root>, React.ElementRef<typeof AvatarPrimitive.Root>,
+2 -2
View File
@@ -1,8 +1,8 @@
import * as React from "react" import * as React from "react"
import { type VariantProps } from "class-variance-authority" import { type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
import { badgeVariants } from "./badge-variants" import { badgeVariants } from "./badge-variants.js"
export interface BadgeProps export interface BadgeProps
extends React.HTMLAttributes<HTMLDivElement>, extends React.HTMLAttributes<HTMLDivElement>,
+1 -1
View File
@@ -2,7 +2,7 @@ import * as React from "react"
import { Slot } from "@radix-ui/react-slot" import { Slot } from "@radix-ui/react-slot"
import { ChevronRight, MoreHorizontal } from "lucide-react" import { ChevronRight, MoreHorizontal } from "lucide-react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const Breadcrumb = React.forwardRef< const Breadcrumb = React.forwardRef<
HTMLElement, HTMLElement,
+2 -2
View File
@@ -2,8 +2,8 @@ import * as React from "react"
import { Slot } from "@radix-ui/react-slot" import { Slot } from "@radix-ui/react-slot"
import { type VariantProps } from "class-variance-authority" import { type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
import { buttonVariants } from "./button-variants" import { buttonVariants } from "./button-variants.js"
export interface ButtonProps export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>, extends React.ButtonHTMLAttributes<HTMLButtonElement>,
+2 -2
View File
@@ -2,8 +2,8 @@ import * as React from "react";
import { ChevronLeft, ChevronRight } from "lucide-react"; import { ChevronLeft, ChevronRight } from "lucide-react";
import { DayPicker } from "react-day-picker"; import { DayPicker } from "react-day-picker";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils.js";
import { buttonVariants } from "@/components/ui/button-variants"; import { buttonVariants } from "@/components/ui/button-variants.js";
export type CalendarProps = React.ComponentProps<typeof DayPicker>; export type CalendarProps = React.ComponentProps<typeof DayPicker>;
+1 -1
View File
@@ -1,6 +1,6 @@
import * as React from "react" import * as React from "react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const Card = React.forwardRef< const Card = React.forwardRef<
HTMLDivElement, HTMLDivElement,
+2 -2
View File
@@ -4,8 +4,8 @@ import useEmblaCarousel, {
} from "embla-carousel-react" } from "embla-carousel-react"
import { ArrowLeft, ArrowRight } from "lucide-react" import { ArrowLeft, ArrowRight } from "lucide-react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
import { Button } from "@/components/ui/button" import { Button } from "@/components/ui/button.jsx"
type CarouselApi = UseEmblaCarouselType[1] type CarouselApi = UseEmblaCarouselType[1]
type UseCarouselParameters = Parameters<typeof useEmblaCarousel> type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
+1 -1
View File
@@ -1,7 +1,7 @@
import * as React from "react" import * as React from "react"
import * as RechartsPrimitive from "recharts" import * as RechartsPrimitive from "recharts"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
// Format: { THEME_NAME: CSS_SELECTOR } // Format: { THEME_NAME: CSS_SELECTOR }
const THEMES = { light: "", dark: ".dark" } as const const THEMES = { light: "", dark: ".dark" } as const
+1 -1
View File
@@ -2,7 +2,7 @@ import * as React from "react"
import * as CheckboxPrimitive from "@radix-ui/react-checkbox" import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
import { Check } from "lucide-react" import { Check } from "lucide-react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const Checkbox = React.forwardRef< const Checkbox = React.forwardRef<
React.ElementRef<typeof CheckboxPrimitive.Root>, React.ElementRef<typeof CheckboxPrimitive.Root>,
+2 -2
View File
@@ -3,8 +3,8 @@ import { type DialogProps } from "@radix-ui/react-dialog"
import { Command as CommandPrimitive } from "cmdk" import { Command as CommandPrimitive } from "cmdk"
import { Search } from "lucide-react" import { Search } from "lucide-react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
import { Dialog, DialogContent } from "@/components/ui/dialog" import { Dialog, DialogContent } from "@/components/ui/dialog.jsx"
const Command = React.forwardRef< const Command = React.forwardRef<
React.ElementRef<typeof CommandPrimitive>, React.ElementRef<typeof CommandPrimitive>,
+1 -1
View File
@@ -2,7 +2,7 @@ import * as React from "react"
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu" import * as ContextMenuPrimitive from "@radix-ui/react-context-menu"
import { Check, ChevronRight, Circle } from "lucide-react" import { Check, ChevronRight, Circle } from "lucide-react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const ContextMenu = ContextMenuPrimitive.Root const ContextMenu = ContextMenuPrimitive.Root
+1 -1
View File
@@ -2,7 +2,7 @@ import * as React from "react"
import * as DialogPrimitive from "@radix-ui/react-dialog" import * as DialogPrimitive from "@radix-ui/react-dialog"
import { X } from "lucide-react" import { X } from "lucide-react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const Dialog = DialogPrimitive.Root const Dialog = DialogPrimitive.Root
+1 -1
View File
@@ -1,7 +1,7 @@
import * as React from "react" import * as React from "react"
import { Drawer as DrawerPrimitive } from "vaul" import { Drawer as DrawerPrimitive } from "vaul"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const Drawer = ({ const Drawer = ({
shouldScaleBackground = true, shouldScaleBackground = true,
+1 -1
View File
@@ -2,7 +2,7 @@ import * as React from "react"
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu" import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
import { Check, ChevronRight, Circle } from "lucide-react" import { Check, ChevronRight, Circle } from "lucide-react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const DropdownMenu = DropdownMenuPrimitive.Root const DropdownMenu = DropdownMenuPrimitive.Root
+3 -3
View File
@@ -9,9 +9,9 @@ import {
FormProvider, FormProvider,
} from "react-hook-form" } from "react-hook-form"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
import { Label } from "@/components/ui/label" import { Label } from "@/components/ui/label.jsx"
import { FormFieldContext, FormItemContext, useFormField } from "./form-utils" import { FormFieldContext, FormItemContext, useFormField } from "./form-utils.js"
const Form = FormProvider const Form = FormProvider
+1 -1
View File
@@ -1,7 +1,7 @@
import * as React from "react" import * as React from "react"
import * as HoverCardPrimitive from "@radix-ui/react-hover-card" import * as HoverCardPrimitive from "@radix-ui/react-hover-card"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const HoverCard = HoverCardPrimitive.Root const HoverCard = HoverCardPrimitive.Root
+1 -1
View File
@@ -2,7 +2,7 @@ import * as React from "react"
import { OTPInput, OTPInputContext } from "input-otp" import { OTPInput, OTPInputContext } from "input-otp"
import { Dot } from "lucide-react" import { Dot } from "lucide-react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const InputOTP = React.forwardRef< const InputOTP = React.forwardRef<
React.ElementRef<typeof OTPInput>, React.ElementRef<typeof OTPInput>,
+1 -1
View File
@@ -1,6 +1,6 @@
import * as React from "react" import * as React from "react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>( const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
({ className, type, ...props }, ref) => { ({ className, type, ...props }, ref) => {
+1 -1
View File
@@ -2,7 +2,7 @@ import * as React from "react"
import * as LabelPrimitive from "@radix-ui/react-label" import * as LabelPrimitive from "@radix-ui/react-label"
import { cva, type VariantProps } from "class-variance-authority" import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const labelVariants = cva( const labelVariants = cva(
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
+1 -1
View File
@@ -2,7 +2,7 @@ import * as React from "react"
import * as MenubarPrimitive from "@radix-ui/react-menubar" import * as MenubarPrimitive from "@radix-ui/react-menubar"
import { Check, ChevronRight, Circle } from "lucide-react" import { Check, ChevronRight, Circle } from "lucide-react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const MenubarMenu = MenubarPrimitive.Menu const MenubarMenu = MenubarPrimitive.Menu
+2 -2
View File
@@ -2,8 +2,8 @@ import * as React from "react"
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu" import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
import { ChevronDown } from "lucide-react" import { ChevronDown } from "lucide-react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
import { navigationMenuTriggerStyle } from "./navigation-menu-variants" import { navigationMenuTriggerStyle } from "./navigation-menu-variants.js"
const NavigationMenu = React.forwardRef< const NavigationMenu = React.forwardRef<
React.ElementRef<typeof NavigationMenuPrimitive.Root>, React.ElementRef<typeof NavigationMenuPrimitive.Root>,
+7 -5
View File
@@ -1,9 +1,9 @@
import * as React from "react" import * as React from "react"
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react" import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
import { ButtonProps } from "@/components/ui/button" import { ButtonProps } from "@/components/ui/button.jsx"
import { buttonVariants } from "@/components/ui/button-variants" import { buttonVariants } from "@/components/ui/button-variants.js"
const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => ( const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
<nav <nav
@@ -62,11 +62,12 @@ PaginationLink.displayName = "PaginationLink"
const PaginationPrevious = ({ const PaginationPrevious = ({
className, className,
size = "default",
...props ...props
}: React.ComponentProps<typeof PaginationLink>) => ( }: React.ComponentProps<typeof PaginationLink>) => (
<PaginationLink <PaginationLink
aria-label="Go to previous page" aria-label="Go to previous page"
size="default" size={size}
className={cn("gap-1 pl-2.5", className)} className={cn("gap-1 pl-2.5", className)}
{...props} {...props}
> >
@@ -78,11 +79,12 @@ PaginationPrevious.displayName = "PaginationPrevious"
const PaginationNext = ({ const PaginationNext = ({
className, className,
size = "default",
...props ...props
}: React.ComponentProps<typeof PaginationLink>) => ( }: React.ComponentProps<typeof PaginationLink>) => (
<PaginationLink <PaginationLink
aria-label="Go to next page" aria-label="Go to next page"
size="default" size={size}
className={cn("gap-1 pr-2.5", className)} className={cn("gap-1 pr-2.5", className)}
{...props} {...props}
> >
+1 -1
View File
@@ -1,7 +1,7 @@
import * as React from "react" import * as React from "react"
import * as PopoverPrimitive from "@radix-ui/react-popover" import * as PopoverPrimitive from "@radix-ui/react-popover"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const Popover = PopoverPrimitive.Root const Popover = PopoverPrimitive.Root
+1 -1
View File
@@ -1,7 +1,7 @@
import * as React from "react" import * as React from "react"
import * as ProgressPrimitive from "@radix-ui/react-progress" import * as ProgressPrimitive from "@radix-ui/react-progress"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const Progress = React.forwardRef< const Progress = React.forwardRef<
React.ElementRef<typeof ProgressPrimitive.Root>, React.ElementRef<typeof ProgressPrimitive.Root>,
+1 -1
View File
@@ -2,7 +2,7 @@ import * as React from "react"
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group" import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
import { Circle } from "lucide-react" import { Circle } from "lucide-react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const RadioGroup = React.forwardRef< const RadioGroup = React.forwardRef<
React.ElementRef<typeof RadioGroupPrimitive.Root>, React.ElementRef<typeof RadioGroupPrimitive.Root>,
+1 -1
View File
@@ -1,7 +1,7 @@
import { GripVertical } from "lucide-react" import { GripVertical } from "lucide-react"
import * as ResizablePrimitive from "react-resizable-panels" import * as ResizablePrimitive from "react-resizable-panels"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const ResizablePanelGroup = ({ const ResizablePanelGroup = ({
className, className,
+1 -1
View File
@@ -1,7 +1,7 @@
import * as React from "react" import * as React from "react"
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area" import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const ScrollArea = React.forwardRef< const ScrollArea = React.forwardRef<
React.ElementRef<typeof ScrollAreaPrimitive.Root>, React.ElementRef<typeof ScrollAreaPrimitive.Root>,
+1 -1
View File
@@ -2,7 +2,7 @@ import * as React from "react"
import * as SelectPrimitive from "@radix-ui/react-select" import * as SelectPrimitive from "@radix-ui/react-select"
import { Check, ChevronDown, ChevronUp } from "lucide-react" import { Check, ChevronDown, ChevronUp } from "lucide-react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const Select = SelectPrimitive.Root const Select = SelectPrimitive.Root
+1 -1
View File
@@ -1,7 +1,7 @@
import * as React from "react" import * as React from "react"
import * as SeparatorPrimitive from "@radix-ui/react-separator" import * as SeparatorPrimitive from "@radix-ui/react-separator"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const Separator = React.forwardRef< const Separator = React.forwardRef<
React.ElementRef<typeof SeparatorPrimitive.Root>, React.ElementRef<typeof SeparatorPrimitive.Root>,
+1 -1
View File
@@ -3,7 +3,7 @@ import { cva, type VariantProps } from "class-variance-authority"
import { X } from "lucide-react" import { X } from "lucide-react"
import * as React from "react" import * as React from "react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const Sheet = SheetPrimitive.Root const Sheet = SheetPrimitive.Root
+9 -9
View File
@@ -3,19 +3,19 @@ import { Slot } from "@radix-ui/react-slot"
import { VariantProps } from "class-variance-authority" import { VariantProps } from "class-variance-authority"
import { PanelLeft } from "lucide-react" import { PanelLeft } from "lucide-react"
import { useIsMobile } from "@/hooks/useIsMobile" import { useIsMobile } from "@/hooks/useIsMobile.js"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
import { Button } from "@/components/ui/button" import { Button } from "@/components/ui/button.jsx"
import { Input } from "@/components/ui/input" import { Input } from "@/components/ui/input.jsx"
import { Separator } from "@/components/ui/separator" import { Separator } from "@/components/ui/separator.jsx"
import { Sheet, SheetContent } from "@/components/ui/sheet" import { Sheet, SheetContent } from "@/components/ui/sheet.jsx"
import { Skeleton } from "@/components/ui/skeleton" import { Skeleton } from "@/components/ui/skeleton.jsx"
import { import {
Tooltip, Tooltip,
TooltipContent, TooltipContent,
TooltipProvider, TooltipProvider,
TooltipTrigger, TooltipTrigger,
} from "@/components/ui/tooltip" } from "@/components/ui/tooltip.jsx"
import { import {
SIDEBAR_COOKIE_NAME, SIDEBAR_COOKIE_NAME,
SIDEBAR_COOKIE_MAX_AGE, SIDEBAR_COOKIE_MAX_AGE,
@@ -27,7 +27,7 @@ import {
useSidebar, useSidebar,
sidebarMenuButtonVariants, sidebarMenuButtonVariants,
type SidebarContext as SidebarContextType, type SidebarContext as SidebarContextType,
} from "./sidebar-utils" } from "./sidebar-utils.js"
const SidebarProvider = React.forwardRef< const SidebarProvider = React.forwardRef<
HTMLDivElement, HTMLDivElement,
+1 -1
View File
@@ -1,4 +1,4 @@
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
function Skeleton({ function Skeleton({
className, className,
+1 -1
View File
@@ -1,7 +1,7 @@
import * as React from "react" import * as React from "react"
import * as SliderPrimitive from "@radix-ui/react-slider" import * as SliderPrimitive from "@radix-ui/react-slider"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const Slider = React.forwardRef< const Slider = React.forwardRef<
React.ElementRef<typeof SliderPrimitive.Root>, React.ElementRef<typeof SliderPrimitive.Root>,
+1 -1
View File
@@ -1,7 +1,7 @@
import * as React from "react" import * as React from "react"
import * as SwitchPrimitives from "@radix-ui/react-switch" import * as SwitchPrimitives from "@radix-ui/react-switch"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const Switch = React.forwardRef< const Switch = React.forwardRef<
React.ElementRef<typeof SwitchPrimitives.Root>, React.ElementRef<typeof SwitchPrimitives.Root>,
+1 -1
View File
@@ -1,6 +1,6 @@
import * as React from "react" import * as React from "react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const Table = React.forwardRef< const Table = React.forwardRef<
HTMLTableElement, HTMLTableElement,
+1 -1
View File
@@ -1,7 +1,7 @@
import * as React from "react" import * as React from "react"
import * as TabsPrimitive from "@radix-ui/react-tabs" import * as TabsPrimitive from "@radix-ui/react-tabs"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const Tabs = TabsPrimitive.Root const Tabs = TabsPrimitive.Root
+1 -1
View File
@@ -1,6 +1,6 @@
import * as React from "react" import * as React from "react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>
+1 -1
View File
@@ -3,7 +3,7 @@ import * as ToastPrimitives from "@radix-ui/react-toast"
import { cva, type VariantProps } from "class-variance-authority" import { cva, type VariantProps } from "class-variance-authority"
import { X } from "lucide-react" import { X } from "lucide-react"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const ToastProvider = ToastPrimitives.Provider const ToastProvider = ToastPrimitives.Provider
+2 -2
View File
@@ -1,4 +1,4 @@
import { useToast } from "@/hooks/useToast" import { useToast } from "@/hooks/useToast.js"
import { import {
Toast, Toast,
ToastClose, ToastClose,
@@ -6,7 +6,7 @@ import {
ToastProvider, ToastProvider,
ToastTitle, ToastTitle,
ToastViewport, ToastViewport,
} from "@/components/ui/toast" } from "@/components/ui/toast.jsx"
export function Toaster() { export function Toaster() {
const { toasts } = useToast() const { toasts } = useToast()
+4 -3
View File
@@ -2,8 +2,8 @@ import * as React from "react"
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group" import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"
import { type VariantProps } from "class-variance-authority" import { type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
import { toggleVariants } from "@/components/ui/toggle-variants" import { toggleVariants } from "./toggle-variants.js"
const ToggleGroupContext = React.createContext< const ToggleGroupContext = React.createContext<
VariantProps<typeof toggleVariants> VariantProps<typeof toggleVariants>
@@ -34,7 +34,7 @@ const ToggleGroupItem = React.forwardRef<
React.ElementRef<typeof ToggleGroupPrimitive.Item>, React.ElementRef<typeof ToggleGroupPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> & React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
VariantProps<typeof toggleVariants> VariantProps<typeof toggleVariants>
>(({ className, children, variant, size, ...props }, ref) => { >(({ className, children, variant, size, value, ...props }, ref) => {
const context = React.useContext(ToggleGroupContext) const context = React.useContext(ToggleGroupContext)
return ( return (
@@ -47,6 +47,7 @@ const ToggleGroupItem = React.forwardRef<
}), }),
className className
)} )}
value={value}
{...props} {...props}
> >
{children} {children}
+2 -2
View File
@@ -2,8 +2,8 @@ import * as React from "react"
import * as TogglePrimitive from "@radix-ui/react-toggle" import * as TogglePrimitive from "@radix-ui/react-toggle"
import { type VariantProps } from "class-variance-authority" import { type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
import { toggleVariants } from "./toggle-variants" import { toggleVariants } from "./toggle-variants.js"
const Toggle = React.forwardRef< const Toggle = React.forwardRef<
React.ElementRef<typeof TogglePrimitive.Root>, React.ElementRef<typeof TogglePrimitive.Root>,
+1 -1
View File
@@ -1,7 +1,7 @@
import * as React from "react" import * as React from "react"
import * as TooltipPrimitive from "@radix-ui/react-tooltip" import * as TooltipPrimitive from "@radix-ui/react-tooltip"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils.js"
const TooltipProvider = TooltipPrimitive.Provider const TooltipProvider = TooltipPrimitive.Provider
+2 -2
View File
@@ -1,6 +1,6 @@
import { ReactNode } from 'react'; import { ReactNode } from 'react';
import { useNWCInternal as useNWCHook } from '@/hooks/useNWC'; import { useNWCInternal as useNWCHook } from '@/hooks/useNWC.js';
import { NWCContext } from '@/hooks/useNWCContext'; import { NWCContext } from '@/hooks/useNWCContext.js';
export function NWCProvider({ children }: { children: ReactNode }) { export function NWCProvider({ children }: { children: ReactNode }) {
const nwc = useNWCHook(); const nwc = useNWCHook();
+1 -1
View File
@@ -1,5 +1,5 @@
import { useContext } from "react"; import { useContext } from "react";
import { AppContext, type AppContextType } from "@/contexts/AppContext"; import { AppContext, type AppContextType } from "@/contexts/AppContext.js";
/** /**
* Hook to access and update application configuration * Hook to access and update application configuration
+1 -1
View File
@@ -2,7 +2,7 @@ import { type NLoginType, NUser, useNostrLogin } from '@nostrify/react/login';
import { useNostr } from '@nostrify/react'; import { useNostr } from '@nostrify/react';
import { useCallback, useMemo } from 'react'; import { useCallback, useMemo } from 'react';
import { useAuthor } from './useAuthor.ts'; import { useAuthor } from "./useAuthor.js";
export function useCurrentUser() { export function useCurrentUser() {
const { nostr } = useNostr(); const { nostr } = useNostr();
+2 -2
View File
@@ -1,6 +1,6 @@
import { useState, useCallback } from 'react'; import { useState, useCallback } from 'react';
import { useLocalStorage } from '@/hooks/useLocalStorage'; import { useLocalStorage } from '@/hooks/useLocalStorage.js';
import { useToast } from '@/hooks/useToast'; import { useToast } from '@/hooks/useToast.js';
import { LN } from '@getalby/sdk'; import { LN } from '@getalby/sdk';
export interface NWCConnection { export interface NWCConnection {
+1 -1
View File
@@ -1,6 +1,6 @@
import { useContext } from 'react'; import { useContext } from 'react';
import { createContext } from 'react'; import { createContext } from 'react';
import { useNWCInternal } from '@/hooks/useNWC'; import { useNWCInternal } from '@/hooks/useNWC.js';
type NWCContextType = ReturnType<typeof useNWCInternal>; type NWCContextType = ReturnType<typeof useNWCInternal>;
+1 -1
View File
@@ -1,7 +1,7 @@
import { useNostr } from "@nostrify/react"; import { useNostr } from "@nostrify/react";
import { useMutation, type UseMutationResult } from "@tanstack/react-query"; import { useMutation, type UseMutationResult } from "@tanstack/react-query";
import { useCurrentUser } from "./useCurrentUser"; import { useCurrentUser } from "./useCurrentUser.js";
import type { NostrEvent } from "@nostrify/nostrify"; import type { NostrEvent } from "@nostrify/nostrify";
+1 -1
View File
@@ -1,5 +1,5 @@
import { useMutation, useQueryClient } from '@tanstack/react-query'; import { useMutation, useQueryClient } from '@tanstack/react-query';
import { useNostrPublish } from '@/hooks/useNostrPublish'; import { useNostrPublish } from '@/hooks/useNostrPublish.js';
import { NKinds, type NostrEvent } from '@nostrify/nostrify'; import { NKinds, type NostrEvent } from '@nostrify/nostrify';
interface PostCommentParams { interface PostCommentParams {
+2 -2
View File
@@ -1,5 +1,5 @@
import { type Theme } from "@/contexts/AppContext"; import { type Theme } from "@/contexts/AppContext.js";
import { useAppContext } from "@/hooks/useAppContext"; import { useAppContext } from "@/hooks/useAppContext.js";
/** /**
* Hook to get and set the active theme * Hook to get and set the active theme
+1 -1
View File
@@ -3,7 +3,7 @@ import * as React from "react"
import type { import type {
ToastActionElement, ToastActionElement,
ToastProps, ToastProps,
} from "@/components/ui/toast" } from "@/components/ui/toast.jsx"
const TOAST_LIMIT = 1 const TOAST_LIMIT = 1
const TOAST_REMOVE_DELAY = 1000000 const TOAST_REMOVE_DELAY = 1000000
+1 -1
View File
@@ -1,7 +1,7 @@
import { useMutation } from "@tanstack/react-query"; import { useMutation } from "@tanstack/react-query";
import { BlossomUploader } from '@nostrify/nostrify/uploaders'; import { BlossomUploader } from '@nostrify/nostrify/uploaders';
import { useCurrentUser } from "./useCurrentUser"; import { useCurrentUser } from "./useCurrentUser.js";
export function useUploadFile() { export function useUploadFile() {
const { user } = useCurrentUser(); const { user } = useCurrentUser();
+1 -1
View File
@@ -1,5 +1,5 @@
import { useState, useEffect, useCallback, useMemo } from 'react'; import { useState, useEffect, useCallback, useMemo } from 'react';
import { useNWC } from '@/hooks/useNWCContext'; import { useNWC } from '@/hooks/useNWCContext.js';
import type { WebLNProvider } from 'webln'; import type { WebLNProvider } from 'webln';
import { requestProvider } from 'webln'; import { requestProvider } from 'webln';
+6 -6
View File
@@ -1,10 +1,10 @@
import { useState, useMemo, useEffect, useCallback } from 'react'; import { useState, useMemo, useEffect, useCallback } from 'react';
import { useCurrentUser } from '@/hooks/useCurrentUser'; import { useCurrentUser } from '@/hooks/useCurrentUser.js';
import { useAuthor } from '@/hooks/useAuthor'; import { useAuthor } from '@/hooks/useAuthor.js';
import { useAppContext } from '@/hooks/useAppContext'; import { useAppContext } from '@/hooks/useAppContext.js';
import { useToast } from '@/hooks/useToast'; import { useToast } from '@/hooks/useToast.js';
import { useNWC } from '@/hooks/useNWCContext'; import { useNWC } from '@/hooks/useNWCContext.js';
import type { NWCConnection } from '@/hooks/useNWC'; import type { NWCConnection } from '@/hooks/useNWC.js';
import { nip57 } from 'nostr-tools'; import { nip57 } from 'nostr-tools';
import type { Event } from 'nostr-tools'; import type { Event } from 'nostr-tools';
import type { WebLNProvider } from 'webln'; import type { WebLNProvider } from 'webln';
+1 -1
View File
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest'; import { describe, it, expect } from 'vitest';
import { genUserName } from './genUserName'; import { genUserName } from "./genUserName.js";
describe('genUserName', () => { describe('genUserName', () => {
it('generates a deterministic name from a seed', () => { it('generates a deterministic name from a seed', () => {
+4 -4
View File
@@ -1,11 +1,11 @@
import { createRoot } from 'react-dom/client'; import { createRoot } from 'react-dom/client';
// Import polyfills first // Import polyfills first
import './lib/polyfills.ts'; import "./lib/polyfills.js";
import { ErrorBoundary } from '@/components/ErrorBoundary'; import { ErrorBoundary } from '@/components/ErrorBoundary.jsx';
import App from './App.tsx'; import App from "./App.jsx";
import './index.css'; import "./index.css";
// FIXME: a custom font should be used. Eg: // FIXME: a custom font should be used. Eg:
// import '@fontsource-variable/<font-name>'; // import '@fontsource-variable/<font-name>';
+1 -1
View File
@@ -1,6 +1,6 @@
import { nip19 } from 'nostr-tools'; import { nip19 } from 'nostr-tools';
import { useParams } from 'react-router-dom'; import { useParams } from 'react-router-dom';
import NotFound from './NotFound'; import NotFound from "./NotFound.js";
export function NIP19Page() { export function NIP19Page() {
const { nip19: identifier } = useParams<{ nip19: string }>(); const { nip19: identifier } = useParams<{ nip19: string }>();
+1 -1
View File
@@ -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'; import { ErrorBoundary } from '@/components/ErrorBoundary.jsx';
+4 -4
View File
@@ -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'; import NostrProvider from '@/components/NostrProvider.jsx';
import { AppProvider } from '@/components/AppProvider'; import { AppProvider } from '@/components/AppProvider.jsx';
import { NWCProvider } from '@/contexts/NWCContext'; import { NWCProvider } from '@/contexts/NWCContext.jsx';
import { AppConfig } from '@/contexts/AppContext'; import { AppConfig } from '@/contexts/AppContext.jsx';
interface TestAppProps { interface TestAppProps {
children: React.ReactNode; children: React.ReactNode;
+4 -5
View File
@@ -1,14 +1,13 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "ES2020", "target": "esnext",
"useDefineForClassFields": true, "useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"], "lib": ["esnext", "DOM", "DOM.Iterable"],
"module": "ESNext", "module": "nodenext",
"skipLibCheck": true, "skipLibCheck": true,
/* Bundler mode */ /* Bundler mode */
"moduleResolution": "bundler", "moduleResolution": "nodenext",
"allowImportingTsExtensions": true,
"isolatedModules": true, "isolatedModules": true,
"moduleDetection": "force", "moduleDetection": "force",
"noEmit": true, "noEmit": true,