mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-18 19:41:48 +02:00
add error boundary to community home
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { memo, useRef } from "react";
|
||||
import { nip19 } from "nostr-tools";
|
||||
import { Link as RouterLink } from "react-router-dom";
|
||||
import { Box, Card, CardProps, Center, Flex, Heading, LinkBox, LinkOverlay, Text } from "@chakra-ui/react";
|
||||
|
||||
@@ -9,7 +10,6 @@ import { useRegisterIntersectionEntity } from "../../../providers/intersection-o
|
||||
import { getEventUID } from "../../../helpers/nostr/events";
|
||||
import { getCommunityImage, getCommunityName } from "../../../helpers/nostr/communities";
|
||||
import CommunityDescription from "./community-description";
|
||||
import { nip19 } from "nostr-tools";
|
||||
import CommunityModList from "./community-mod-list";
|
||||
|
||||
function CommunityCard({ community, ...props }: Omit<CardProps, "children"> & { community: NostrEvent }) {
|
||||
|
@@ -15,6 +15,7 @@ import RelaySelectionProvider, { useRelaySelectionContext } from "../../provider
|
||||
import { COMMUNITY_DEFINITION_KIND, validateCommunity } from "../../helpers/nostr/communities";
|
||||
import { NostrEvent } from "../../types/nostr-event";
|
||||
import { NostrQuery } from "../../types/nostr-query";
|
||||
import { ErrorBoundary } from "../../components/error-boundary";
|
||||
|
||||
function CommunitiesHomePage() {
|
||||
const { filter, listId } = usePeopleListContext();
|
||||
@@ -47,7 +48,9 @@ function CommunitiesHomePage() {
|
||||
</Flex>
|
||||
<SimpleGrid spacing="2" columns={{ base: 1, lg: 2 }}>
|
||||
{communities.map((event) => (
|
||||
<CommunityCard key={getEventUID(event)} community={event} />
|
||||
<ErrorBoundary>
|
||||
<CommunityCard key={getEventUID(event)} community={event} />
|
||||
</ErrorBoundary>
|
||||
))}
|
||||
</SimpleGrid>
|
||||
</VerticalPageLayout>
|
||||
|
Reference in New Issue
Block a user