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