mirror of
https://github.com/logos-messaging/OpChan.git
synced 2026-01-04 05:43:10 +00:00
chore: improvements
This commit is contained in:
parent
1d86a43406
commit
1984de3281
@ -16,7 +16,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@opchan/react": "file:../packages/react",
|
"@opchan/react": "file:../packages/react",
|
||||||
"@opchan/core": "1.0.0",
|
"@opchan/core": "file:../packages/core",
|
||||||
"@hookform/resolvers": "^3.9.0",
|
"@hookform/resolvers": "^3.9.0",
|
||||||
"@noble/ed25519": "^2.2.3",
|
"@noble/ed25519": "^2.2.3",
|
||||||
"@noble/hashes": "^1.8.0",
|
"@noble/hashes": "^1.8.0",
|
||||||
@ -52,7 +52,6 @@
|
|||||||
"@reown/appkit-adapter-wagmi": "^1.7.17",
|
"@reown/appkit-adapter-wagmi": "^1.7.17",
|
||||||
"@reown/appkit-wallet-button": "^1.7.17",
|
"@reown/appkit-wallet-button": "^1.7.17",
|
||||||
"@tanstack/react-query": "^5.84.1",
|
"@tanstack/react-query": "^5.84.1",
|
||||||
"@waku/sdk": "^0.0.35-67a7287.0",
|
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
@ -62,7 +61,6 @@
|
|||||||
"input-otp": "^1.2.4",
|
"input-otp": "^1.2.4",
|
||||||
"lucide-react": "^0.462.0",
|
"lucide-react": "^0.462.0",
|
||||||
"next-themes": "^0.3.0",
|
"next-themes": "^0.3.0",
|
||||||
"ordiscan": "^1.3.0",
|
|
||||||
"re-resizable": "6.11.2",
|
"re-resizable": "6.11.2",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-day-picker": "^8.10.1",
|
"react-day-picker": "^8.10.1",
|
||||||
|
|||||||
@ -24,8 +24,8 @@ import {
|
|||||||
import { CypherImage } from './ui/CypherImage';
|
import { CypherImage } from './ui/CypherImage';
|
||||||
import { RelevanceIndicator } from './ui/relevance-indicator';
|
import { RelevanceIndicator } from './ui/relevance-indicator';
|
||||||
import { ModerationToggle } from './ui/moderation-toggle';
|
import { ModerationToggle } from './ui/moderation-toggle';
|
||||||
import { sortCells, SortOption } from '@opchan/core';
|
import { sortCells, SortOption } from '@/utils/sorting';
|
||||||
import { Cell } from '@opchan/core';
|
import type { Cell } from '@opchan/core';
|
||||||
import { useForum } from '@opchan/react';
|
import { useForum } from '@opchan/react';
|
||||||
import { ShareButton } from './ui/ShareButton';
|
import { ShareButton } from './ui/ShareButton';
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,7 @@ import {
|
|||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
} from '@/components/ui/dialog';
|
} from '@/components/ui/dialog';
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
import { urlLoads } from '@opchan/core';
|
import { urlLoads } from '@/utils';
|
||||||
|
|
||||||
const formSchema = z.object({
|
const formSchema = z.object({
|
||||||
title: z
|
title: z
|
||||||
|
|||||||
@ -61,19 +61,17 @@ const Header = () => {
|
|||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const forumContext = useForumContext();
|
const forumContext = useForumContext();
|
||||||
|
|
||||||
// Use AppKit hooks for multi-chain support
|
|
||||||
const bitcoinAccount = useAppKitAccount({ namespace: 'bip122' });
|
const bitcoinAccount = useAppKitAccount({ namespace: 'bip122' });
|
||||||
const ethereumAccount = useAppKitAccount({ namespace: 'eip155' });
|
const ethereumAccount = useAppKitAccount({ namespace: 'eip155' });
|
||||||
const { disconnect } = useDisconnect();
|
const { disconnect } = useDisconnect();
|
||||||
|
|
||||||
// Determine which account is connected
|
const isConnected = bitcoinAccount.isConnected || ethereumAccount.isConnected;
|
||||||
const isBitcoinConnected = bitcoinAccount.isConnected;
|
|
||||||
const isEthereumConnected = ethereumAccount.isConnected;
|
|
||||||
const isConnected = isBitcoinConnected || isEthereumConnected;
|
|
||||||
|
|
||||||
// Use currentUser address (which has ENS details) instead of raw AppKit address
|
// Use currentUser address (which has ENS details) instead of raw AppKit address
|
||||||
const address = currentUser?.address || (isConnected
|
const address = currentUser?.address || (isConnected
|
||||||
? isBitcoinConnected
|
? bitcoinAccount.isConnected
|
||||||
? bitcoinAccount.address
|
? bitcoinAccount.address
|
||||||
: ethereumAccount.address
|
: ethereumAccount.address
|
||||||
: undefined);
|
: undefined);
|
||||||
@ -81,12 +79,9 @@ const Header = () => {
|
|||||||
const [walletWizardOpen, setWalletWizardOpen] = useState(false);
|
const [walletWizardOpen, setWalletWizardOpen] = useState(false);
|
||||||
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
||||||
|
|
||||||
// ✅ Use UserIdentityService via useUserDisplay hook for centralized display logic
|
|
||||||
const { displayName, verificationLevel } = useUserDisplay(address || '');
|
const { displayName, verificationLevel } = useUserDisplay(address || '');
|
||||||
|
|
||||||
// ✅ Removed console.log to prevent spam during development
|
|
||||||
|
|
||||||
// Load delegation status
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
getDelegationStatus().then(setDelegationInfo).catch(console.error);
|
getDelegationStatus().then(setDelegationInfo).catch(console.error);
|
||||||
}, [getDelegationStatus]);
|
}, [getDelegationStatus]);
|
||||||
@ -158,7 +153,6 @@ const Header = () => {
|
|||||||
const getStatusIcon = () => {
|
const getStatusIcon = () => {
|
||||||
if (!isConnected) return <CircleSlash className="w-4 h-4" />;
|
if (!isConnected) return <CircleSlash className="w-4 h-4" />;
|
||||||
|
|
||||||
// Use verification level from UserIdentityService (central database store)
|
|
||||||
if (
|
if (
|
||||||
verificationLevel === EVerificationStatus.ENS_ORDINAL_VERIFIED &&
|
verificationLevel === EVerificationStatus.ENS_ORDINAL_VERIFIED &&
|
||||||
delegationInfo?.isValid
|
delegationInfo?.isValid
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { ArrowUp, ArrowDown, MessageSquare } from 'lucide-react';
|
import { ArrowUp, ArrowDown, MessageSquare } from 'lucide-react';
|
||||||
import { formatDistanceToNow } from 'date-fns';
|
import { formatDistanceToNow } from 'date-fns';
|
||||||
import { Post } from '@opchan/core';
|
import type { Post } from '@opchan/core';
|
||||||
// Removed unused imports
|
// Removed unused imports
|
||||||
import { RelevanceIndicator } from '@/components/ui/relevance-indicator';
|
import { RelevanceIndicator } from '@/components/ui/relevance-indicator';
|
||||||
import { AuthorDisplay } from '@/components/ui/author-display';
|
import { AuthorDisplay } from '@/components/ui/author-display';
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { cn } from '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
type CypherImageProps = {
|
type CypherImageProps = {
|
||||||
src?: string;
|
src?: string;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Share2 } from 'lucide-react';
|
import { Share2 } from 'lucide-react';
|
||||||
import { cn } from '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
import { useToast } from '../ui/use-toast';
|
import { useToast } from '../ui/use-toast';
|
||||||
|
|
||||||
interface ShareButtonProps {
|
interface ShareButtonProps {
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const Accordion = AccordionPrimitive.Root;
|
const Accordion = AccordionPrimitive.Root;
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
import { buttonVariants } from '@/components/ui/button-variants';
|
import { buttonVariants } from '@/components/ui/button-variants';
|
||||||
|
|
||||||
const AlertDialog = AlertDialogPrimitive.Root;
|
const AlertDialog = AlertDialogPrimitive.Root;
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
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,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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const Avatar = React.forwardRef<
|
const Avatar = React.forwardRef<
|
||||||
React.ElementRef<typeof AvatarPrimitive.Root>,
|
React.ElementRef<typeof AvatarPrimitive.Root>,
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const badgeVariants = cva(
|
const badgeVariants = cva(
|
||||||
'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
|
'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Bookmark, BookmarkCheck } from 'lucide-react';
|
import { Bookmark, BookmarkCheck } from 'lucide-react';
|
||||||
import { cn } from '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
interface BookmarkButtonProps {
|
interface BookmarkButtonProps {
|
||||||
isBookmarked: boolean;
|
isBookmarked: boolean;
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import {
|
|||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { Bookmark, BookmarkType } from '@opchan/core';
|
import { Bookmark, BookmarkType } from '@opchan/core';
|
||||||
import { useUserDisplay } from '@/hooks';
|
import { useUserDisplay } from '@/hooks';
|
||||||
import { cn } from '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
import { formatDistanceToNow } from 'date-fns';
|
import { formatDistanceToNow } from 'date-fns';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const Breadcrumb = React.forwardRef<
|
const Breadcrumb = React.forwardRef<
|
||||||
HTMLElement,
|
HTMLElement,
|
||||||
|
|||||||
@ -2,7 +2,7 @@ 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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
import { buttonVariants } from './button-variants';
|
import { buttonVariants } from './button-variants';
|
||||||
|
|
||||||
export interface ButtonProps
|
export interface ButtonProps
|
||||||
|
|||||||
@ -2,7 +2,7 @@ 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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
import { buttonVariants } from '@/components/ui/button-variants';
|
import { buttonVariants } from '@/components/ui/button-variants';
|
||||||
|
|
||||||
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
import { cn } from '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const Card = React.forwardRef<
|
const Card = React.forwardRef<
|
||||||
HTMLDivElement,
|
HTMLDivElement,
|
||||||
|
|||||||
@ -4,7 +4,7 @@ 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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
|
|
||||||
type CarouselApi = UseEmblaCarouselType[1];
|
type CarouselApi = UseEmblaCarouselType[1];
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
// Format: { THEME_NAME: CSS_SELECTOR }
|
// Format: { THEME_NAME: CSS_SELECTOR }
|
||||||
const THEMES = { light: '', dark: '.dark' } as const;
|
const THEMES = { light: '', dark: '.dark' } as const;
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const Checkbox = React.forwardRef<
|
const Checkbox = React.forwardRef<
|
||||||
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
||||||
|
|||||||
@ -3,7 +3,7 @@ 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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
import { Dialog, DialogContent } from '@/components/ui/dialog';
|
import { Dialog, DialogContent } from '@/components/ui/dialog';
|
||||||
|
|
||||||
const Command = React.forwardRef<
|
const Command = React.forwardRef<
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const ContextMenu = ContextMenuPrimitive.Root;
|
const ContextMenu = ContextMenuPrimitive.Root;
|
||||||
|
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const Dialog = DialogPrimitive.Root;
|
const Dialog = DialogPrimitive.Root;
|
||||||
|
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const Drawer = ({
|
const Drawer = ({
|
||||||
shouldScaleBackground = true,
|
shouldScaleBackground = true,
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const DropdownMenu = DropdownMenuPrimitive.Root;
|
const DropdownMenu = DropdownMenuPrimitive.Root;
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import {
|
|||||||
useFormContext,
|
useFormContext,
|
||||||
} from 'react-hook-form';
|
} from 'react-hook-form';
|
||||||
|
|
||||||
import { cn } from '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
|
|
||||||
const Form = FormProvider;
|
const Form = FormProvider;
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const HoverCard = HoverCardPrimitive.Root;
|
const HoverCard = HoverCardPrimitive.Root;
|
||||||
|
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const InputOTP = React.forwardRef<
|
const InputOTP = React.forwardRef<
|
||||||
React.ElementRef<typeof OTPInput>,
|
React.ElementRef<typeof OTPInput>,
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
import { cn } from '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<'input'>>(
|
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<'input'>>(
|
||||||
({ className, type, ...props }, ref) => {
|
({ className, type, ...props }, ref) => {
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
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'
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const MenubarMenu = MenubarPrimitive.Menu;
|
const MenubarMenu = MenubarPrimitive.Menu;
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|||||||
import { cva } from 'class-variance-authority';
|
import { cva } from 'class-variance-authority';
|
||||||
import { ChevronDown } from 'lucide-react';
|
import { ChevronDown } from 'lucide-react';
|
||||||
|
|
||||||
import { cn } from '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const NavigationMenu = React.forwardRef<
|
const NavigationMenu = React.forwardRef<
|
||||||
React.ElementRef<typeof NavigationMenuPrimitive.Root>,
|
React.ElementRef<typeof NavigationMenuPrimitive.Root>,
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
import { ButtonProps } from '@/components/ui/button';
|
import { ButtonProps } from '@/components/ui/button';
|
||||||
import { buttonVariants } from '@/components/ui/button-variants';
|
import { buttonVariants } from '@/components/ui/button-variants';
|
||||||
|
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const Popover = PopoverPrimitive.Root;
|
const Popover = PopoverPrimitive.Root;
|
||||||
|
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const Progress = React.forwardRef<
|
const Progress = React.forwardRef<
|
||||||
React.ElementRef<typeof ProgressPrimitive.Root>,
|
React.ElementRef<typeof ProgressPrimitive.Root>,
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const RadioGroup = React.forwardRef<
|
const RadioGroup = React.forwardRef<
|
||||||
React.ElementRef<typeof RadioGroupPrimitive.Root>,
|
React.ElementRef<typeof RadioGroupPrimitive.Root>,
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Resizable } from 're-resizable';
|
import { Resizable } from 're-resizable';
|
||||||
|
|
||||||
import { cn } from '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
import { Textarea } from '@/components/ui/textarea';
|
import { Textarea } from '@/components/ui/textarea';
|
||||||
|
|
||||||
type ResizableTextareaProps =
|
type ResizableTextareaProps =
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const ResizablePanelGroup = ({
|
const ResizablePanelGroup = ({
|
||||||
className,
|
className,
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const ScrollArea = React.forwardRef<
|
const ScrollArea = React.forwardRef<
|
||||||
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
|
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const Select = SelectPrimitive.Root;
|
const Select = SelectPrimitive.Root;
|
||||||
|
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const Separator = React.forwardRef<
|
const Separator = React.forwardRef<
|
||||||
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const Sheet = SheetPrimitive.Root;
|
const Sheet = SheetPrimitive.Root;
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { VariantProps, cva } from 'class-variance-authority';
|
|||||||
import { PanelLeft } from 'lucide-react';
|
import { PanelLeft } from 'lucide-react';
|
||||||
|
|
||||||
import { useIsMobile } from '@/hooks/use-mobile';
|
import { useIsMobile } from '@/hooks/use-mobile';
|
||||||
import { cn } from '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
import { Separator } from '@/components/ui/separator';
|
import { Separator } from '@/components/ui/separator';
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { cn } from '@opchan/core';
|
import { cn } from '../../utils';
|
||||||
|
|
||||||
function Skeleton({
|
function Skeleton({
|
||||||
className,
|
className,
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils';
|
||||||
|
|
||||||
const Slider = React.forwardRef<
|
const Slider = React.forwardRef<
|
||||||
React.ElementRef<typeof SliderPrimitive.Root>,
|
React.ElementRef<typeof SliderPrimitive.Root>,
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const Switch = React.forwardRef<
|
const Switch = React.forwardRef<
|
||||||
React.ElementRef<typeof SwitchPrimitives.Root>,
|
React.ElementRef<typeof SwitchPrimitives.Root>,
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
import { cn } from '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const Table = React.forwardRef<
|
const Table = React.forwardRef<
|
||||||
HTMLTableElement,
|
HTMLTableElement,
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const Tabs = TabsPrimitive.Root;
|
const Tabs = TabsPrimitive.Root;
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
import { cn } from '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const Textarea = React.forwardRef<
|
const Textarea = React.forwardRef<
|
||||||
HTMLTextAreaElement,
|
HTMLTextAreaElement,
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const ToastProvider = ToastPrimitives.Provider;
|
const ToastProvider = ToastPrimitives.Provider;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ 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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
import { toggleVariants } from '@/components/ui/toggle-variants';
|
import { toggleVariants } from '@/components/ui/toggle-variants';
|
||||||
|
|
||||||
const ToggleGroupContext = React.createContext<
|
const ToggleGroupContext = React.createContext<
|
||||||
|
|||||||
@ -2,7 +2,7 @@ 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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
import { toggleVariants } from './toggle-variants';
|
import { toggleVariants } from './toggle-variants';
|
||||||
|
|
||||||
const Toggle = React.forwardRef<
|
const Toggle = React.forwardRef<
|
||||||
|
|||||||
@ -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 '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
const TooltipProvider = TooltipPrimitive.Provider;
|
const TooltipProvider = TooltipPrimitive.Provider;
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { Wifi, WifiOff, AlertTriangle, CheckCircle } from 'lucide-react';
|
import { Wifi, WifiOff, CheckCircle } from 'lucide-react';
|
||||||
import { useNetworkStatus } from '@opchan/react';
|
import { useNetworkStatus } from '@opchan/react';
|
||||||
import { cn } from '@opchan/core';
|
import { cn } from '../../utils'
|
||||||
|
|
||||||
interface WakuHealthIndicatorProps {
|
interface WakuHealthIndicatorProps {
|
||||||
className?: string;
|
className?: string;
|
||||||
@ -24,12 +24,8 @@ export function WakuHealthIndicator({
|
|||||||
switch (connectionStatus) {
|
switch (connectionStatus) {
|
||||||
case 'connected':
|
case 'connected':
|
||||||
return <CheckCircle className="text-green-500" />;
|
return <CheckCircle className="text-green-500" />;
|
||||||
case 'connecting':
|
|
||||||
return <Wifi className="text-yellow-500 animate-pulse" />;
|
|
||||||
case 'disconnected':
|
case 'disconnected':
|
||||||
return <WifiOff className="text-red-500" />;
|
return <WifiOff className="text-red-500" />;
|
||||||
case 'error':
|
|
||||||
return <AlertTriangle className="text-red-500" />;
|
|
||||||
default:
|
default:
|
||||||
return <Wifi className="text-gray-500" />;
|
return <Wifi className="text-gray-500" />;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,8 +15,7 @@ import { ModerationToggle } from '@/components/ui/moderation-toggle';
|
|||||||
import { useForumData, useAuth } from '@/hooks';
|
import { useForumData, useAuth } from '@/hooks';
|
||||||
import { useForum } from '@opchan/react';
|
import { useForum } from '@opchan/react';
|
||||||
import { EVerificationStatus } from '@opchan/core';
|
import { EVerificationStatus } from '@opchan/core';
|
||||||
import { sortPosts, SortOption } from '@opchan/core';
|
import { sortPosts, SortOption } from '@/utils/sorting';
|
||||||
|
|
||||||
const FeedPage: React.FC = () => {
|
const FeedPage: React.FC = () => {
|
||||||
const forumData = useForumData();
|
const forumData = useForumData();
|
||||||
const { verificationStatus } = useAuth();
|
const { verificationStatus } = useAuth();
|
||||||
|
|||||||
9
app/src/utils/index.ts
Normal file
9
app/src/utils/index.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { clsx, type ClassValue } from 'clsx';
|
||||||
|
import { twMerge } from 'tailwind-merge';
|
||||||
|
|
||||||
|
|
||||||
|
export function cn(...inputs: ClassValue[]) {
|
||||||
|
return twMerge(clsx(inputs));
|
||||||
|
}
|
||||||
|
|
||||||
|
export { urlLoads } from './urlLoads';
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { Post, Comment, Cell } from '../../types/forum';
|
import { Post, Comment, Cell } from '../../../packages/core/src/types/forum';
|
||||||
|
|
||||||
export type SortOption = 'relevance' | 'time';
|
export type SortOption = 'relevance' | 'time';
|
||||||
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
|
|
||||||
}
|
|
||||||
4
package-lock.json
generated
4
package-lock.json
generated
@ -30,7 +30,7 @@
|
|||||||
"@hookform/resolvers": "^3.9.0",
|
"@hookform/resolvers": "^3.9.0",
|
||||||
"@noble/ed25519": "^2.2.3",
|
"@noble/ed25519": "^2.2.3",
|
||||||
"@noble/hashes": "^1.8.0",
|
"@noble/hashes": "^1.8.0",
|
||||||
"@opchan/core": "1.0.0",
|
"@opchan/core": "file:../packages/core",
|
||||||
"@opchan/react": "file:../packages/react",
|
"@opchan/react": "file:../packages/react",
|
||||||
"@radix-ui/react-accordion": "^1.2.0",
|
"@radix-ui/react-accordion": "^1.2.0",
|
||||||
"@radix-ui/react-alert-dialog": "^1.1.1",
|
"@radix-ui/react-alert-dialog": "^1.1.1",
|
||||||
@ -64,7 +64,6 @@
|
|||||||
"@reown/appkit-adapter-wagmi": "^1.7.17",
|
"@reown/appkit-adapter-wagmi": "^1.7.17",
|
||||||
"@reown/appkit-wallet-button": "^1.7.17",
|
"@reown/appkit-wallet-button": "^1.7.17",
|
||||||
"@tanstack/react-query": "^5.84.1",
|
"@tanstack/react-query": "^5.84.1",
|
||||||
"@waku/sdk": "^0.0.35-67a7287.0",
|
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
@ -74,7 +73,6 @@
|
|||||||
"input-otp": "^1.2.4",
|
"input-otp": "^1.2.4",
|
||||||
"lucide-react": "^0.462.0",
|
"lucide-react": "^0.462.0",
|
||||||
"next-themes": "^0.3.0",
|
"next-themes": "^0.3.0",
|
||||||
"ordiscan": "^1.3.0",
|
|
||||||
"re-resizable": "6.11.2",
|
"re-resizable": "6.11.2",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-day-picker": "^8.10.1",
|
"react-day-picker": "^8.10.1",
|
||||||
|
|||||||
@ -35,8 +35,6 @@ export { ordinals } from './lib/services/Ordinals';
|
|||||||
// Export utilities
|
// Export utilities
|
||||||
export * from './lib/utils';
|
export * from './lib/utils';
|
||||||
export { MessageValidator } from './lib/utils/MessageValidator';
|
export { MessageValidator } from './lib/utils/MessageValidator';
|
||||||
export * from './lib/utils/sorting';
|
|
||||||
export { urlLoads } from './lib/utils/urlLoads';
|
|
||||||
export { environment, type EnvironmentConfig } from './lib/utils/environment';
|
export { environment, type EnvironmentConfig } from './lib/utils/environment';
|
||||||
|
|
||||||
// Export Waku networking
|
// Export Waku networking
|
||||||
|
|||||||
@ -1,10 +1,3 @@
|
|||||||
import { clsx, type ClassValue } from 'clsx';
|
|
||||||
import { twMerge } from 'tailwind-merge';
|
|
||||||
|
|
||||||
export function cn(...inputs: ClassValue[]) {
|
|
||||||
return twMerge(clsx(inputs));
|
|
||||||
}
|
|
||||||
|
|
||||||
export function bytesToHex(bytes: Uint8Array): string {
|
export function bytesToHex(bytes: Uint8Array): string {
|
||||||
return Array.from(bytes)
|
return Array.from(bytes)
|
||||||
.map(b => b.toString(16).padStart(2, '0'))
|
.map(b => b.toString(16).padStart(2, '0'))
|
||||||
|
|||||||
@ -76,12 +76,10 @@ export function useNetworkStatus(): NetworkStatusData {
|
|||||||
try {
|
try {
|
||||||
const nowReady = Boolean(client?.messageManager?.isReady);
|
const nowReady = Boolean(client?.messageManager?.isReady);
|
||||||
setWakuReady(nowReady);
|
setWakuReady(nowReady);
|
||||||
console.debug('[useNetworkStatus] primed wakuReady from client', { nowReady });
|
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|
||||||
const off = client?.messageManager?.onHealthChange?.(
|
const off = client?.messageManager?.onHealthChange?.(
|
||||||
(ready: boolean) => {
|
(ready: boolean) => {
|
||||||
console.debug('[useNetworkStatus] onHealthChange -> wakuReady', { ready });
|
|
||||||
setWakuReady(Boolean(ready));
|
setWakuReady(Boolean(ready));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -119,18 +117,6 @@ export function useNetworkStatus(): NetworkStatusData {
|
|||||||
const lastSync = Date.now(); // This would come from actual sync tracking
|
const lastSync = Date.now(); // This would come from actual sync tracking
|
||||||
const syncAge = lastSync ? formatTimeAgo(lastSync) : null;
|
const syncAge = lastSync ? formatTimeAgo(lastSync) : null;
|
||||||
|
|
||||||
// Debug: surface the raw inputs to health computation
|
|
||||||
console.debug('[useNetworkStatus] health', {
|
|
||||||
forumIsNetworkConnected: isNetworkConnected,
|
|
||||||
fallbackConnected,
|
|
||||||
effectiveConnected,
|
|
||||||
isInitialLoading,
|
|
||||||
isRefreshing,
|
|
||||||
error,
|
|
||||||
delegationValid: delegationInfo?.isValid,
|
|
||||||
issues,
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isConnected: effectiveConnected,
|
isConnected: effectiveConnected,
|
||||||
isHealthy,
|
isHealthy,
|
||||||
@ -185,13 +171,6 @@ export function useNetworkStatus(): NetworkStatusData {
|
|||||||
// Helper methods
|
// Helper methods
|
||||||
const getStatusMessage = useMemo(() => {
|
const getStatusMessage = useMemo(() => {
|
||||||
return (): string => {
|
return (): string => {
|
||||||
console.debug('[useNetworkStatus] statusMessage inputs', {
|
|
||||||
isInitialLoading,
|
|
||||||
isRefreshing,
|
|
||||||
isNetworkConnected,
|
|
||||||
error,
|
|
||||||
issues: health.issues,
|
|
||||||
});
|
|
||||||
if (isInitialLoading) return 'Loading forum data...';
|
if (isInitialLoading) return 'Loading forum data...';
|
||||||
if (isRefreshing) return 'Refreshing data...';
|
if (isRefreshing) return 'Refreshing data...';
|
||||||
const fallbackConnected = Boolean(wakuReady);
|
const fallbackConnected = Boolean(wakuReady);
|
||||||
@ -213,12 +192,6 @@ export function useNetworkStatus(): NetworkStatusData {
|
|||||||
|
|
||||||
const getHealthColor = useMemo(() => {
|
const getHealthColor = useMemo(() => {
|
||||||
return (): 'green' | 'yellow' | 'red' => {
|
return (): 'green' | 'yellow' | 'red' => {
|
||||||
console.debug('[useNetworkStatus] healthColor inputs', {
|
|
||||||
isNetworkConnected,
|
|
||||||
error,
|
|
||||||
issues: health.issues,
|
|
||||||
delegationValid: delegationInfo?.isValid,
|
|
||||||
});
|
|
||||||
const fallbackConnected = Boolean(wakuReady);
|
const fallbackConnected = Boolean(wakuReady);
|
||||||
const effectiveConnected = isNetworkConnected || fallbackConnected;
|
const effectiveConnected = isNetworkConnected || fallbackConnected;
|
||||||
if (!effectiveConnected || error) return 'red';
|
if (!effectiveConnected || error) return 'red';
|
||||||
|
|||||||
@ -1,26 +1,9 @@
|
|||||||
// Providers only (context hooks are internal)
|
|
||||||
export * from './provider/OpChanProvider';
|
export * from './provider/OpChanProvider';
|
||||||
export { ClientProvider, useClient } from './contexts/ClientContext';
|
export { ClientProvider, useClient } from './contexts/ClientContext';
|
||||||
export { AuthProvider, useAuth } from './contexts/AuthContext';
|
export { AuthProvider, useAuth } from './contexts/AuthContext';
|
||||||
export { ForumProvider, useForum as useForumContext } from './contexts/ForumContext';
|
export { ForumProvider, useForum as useForumContext } from './contexts/ForumContext';
|
||||||
export { ModerationProvider, useModeration } from './contexts/ModerationContext';
|
export { ModerationProvider, useModeration } from './contexts/ModerationContext';
|
||||||
|
|
||||||
// Public hooks and types
|
|
||||||
export * from './hooks';
|
export * from './hooks';
|
||||||
export { useForumApi as useForum } from './hooks/useForum';
|
export { useForumApi as useForum } from './hooks/useForum';
|
||||||
|
|
||||||
// Re-export core types for convenience
|
|
||||||
export type {
|
|
||||||
User,
|
|
||||||
EVerificationStatus,
|
|
||||||
EDisplayPreference,
|
|
||||||
DelegationDuration,
|
|
||||||
Cell,
|
|
||||||
Post,
|
|
||||||
Comment,
|
|
||||||
Bookmark,
|
|
||||||
BookmarkType,
|
|
||||||
RelevanceScoreDetails,
|
|
||||||
} from '@opchan/core';
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,6 @@
|
|||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": ".tsbuildinfo"
|
"tsBuildInfoFile": ".tsbuildinfo"
|
||||||
},
|
},
|
||||||
"include": ["packages/*/src/**/*"],
|
"include": ["packages/*/src/**/*", "app/utils/urlLoads.test.ts", "app/utils/urlLoads.ts"],
|
||||||
"exclude": ["node_modules", "**/dist", "**/*.test.ts", "**/*.spec.ts"]
|
"exclude": ["node_modules", "**/dist", "**/*.test.ts", "**/*.spec.ts"]
|
||||||
}
|
}
|
||||||
8
vercel.json
Normal file
8
vercel.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"version": 2,
|
||||||
|
"installCommand": "npm ci --workspaces",
|
||||||
|
"buildCommand": "npm run -w packages/core build && npm run -w packages/react build && npm run -w app build",
|
||||||
|
"outputDirectory": "app/dist",
|
||||||
|
"rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user