diff --git a/.changeset/afraid-apricots-fix.md b/.changeset/afraid-apricots-fix.md new file mode 100644 index 000000000..4d8cd0744 --- /dev/null +++ b/.changeset/afraid-apricots-fix.md @@ -0,0 +1,5 @@ +--- +"nostrudel": minor +--- + +Add option to hide usernames diff --git a/src/components/embed-event/event-types/embedded-article.tsx b/src/components/embed-event/event-types/embedded-article.tsx index 87d51804c..46204fccb 100644 --- a/src/components/embed-event/event-types/embedded-article.tsx +++ b/src/components/embed-event/event-types/embedded-article.tsx @@ -10,7 +10,7 @@ import { NostrEvent } from "../../../types/nostr-event"; import { buildAppSelectUrl } from "../../../helpers/nostr/apps"; import { getSharableEventAddress } from "../../../helpers/nip19"; import UserAvatarLink from "../../user-avatar-link"; -import { UserLink } from "../../user-link"; +import UserLink from "../../user-link"; import Timestamp from "../../timestamp"; export default function EmbeddedArticle({ article, ...props }: Omit & { article: NostrEvent }) { diff --git a/src/components/embed-event/event-types/embedded-badge.tsx b/src/components/embed-event/event-types/embedded-badge.tsx index 8b5f338df..bce7fcf6c 100644 --- a/src/components/embed-event/event-types/embedded-badge.tsx +++ b/src/components/embed-event/event-types/embedded-badge.tsx @@ -13,7 +13,7 @@ import { } from "@chakra-ui/react"; import UserAvatarLink from "../../../components/user-avatar-link"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import { getSharableEventAddress } from "../../../helpers/nip19"; import { NostrEvent } from "../../../types/nostr-event"; import { getBadgeDescription, getBadgeImage, getBadgeName } from "../../../helpers/nostr/badges"; diff --git a/src/components/embed-event/event-types/embedded-channel.tsx b/src/components/embed-event/event-types/embedded-channel.tsx index 217a02e1a..b0a3b12e8 100644 --- a/src/components/embed-event/event-types/embedded-channel.tsx +++ b/src/components/embed-event/event-types/embedded-channel.tsx @@ -3,7 +3,7 @@ import { Box, Card, CardBody, CardFooter, CardHeader, CardProps, Flex, Heading, import { nip19 } from "nostr-tools"; import UserAvatarLink from "../../user-avatar-link"; -import { UserLink } from "../../user-link"; +import UserLink from "../../user-link"; import { NostrEvent } from "../../../types/nostr-event"; import useChannelMetadata from "../../../hooks/use-channel-metadata"; import HoverLinkOverlay from "../../hover-link-overlay"; diff --git a/src/components/embed-event/event-types/embedded-community.tsx b/src/components/embed-event/event-types/embedded-community.tsx index 5dbe543b3..99d9d2e23 100644 --- a/src/components/embed-event/event-types/embedded-community.tsx +++ b/src/components/embed-event/event-types/embedded-community.tsx @@ -3,7 +3,7 @@ import { Card, CardFooter, CardHeader, CardProps, Heading, LinkBox, LinkOverlay, import { nip19 } from "nostr-tools"; import UserAvatarLink from "../../../components/user-avatar-link"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import { NostrEvent } from "../../../types/nostr-event"; import { getCommunityImage, getCommunityName } from "../../../helpers/nostr/communities"; diff --git a/src/components/embed-event/event-types/embedded-dm.tsx b/src/components/embed-event/event-types/embedded-dm.tsx index 49767ff70..a01d3a668 100644 --- a/src/components/embed-event/event-types/embedded-dm.tsx +++ b/src/components/embed-event/event-types/embedded-dm.tsx @@ -3,7 +3,7 @@ import { Card, CardBody, CardHeader, CardProps, LinkBox, Spacer, Text } from "@c import { NostrEvent } from "../../../types/nostr-event"; import { TrustProvider } from "../../../providers/trust"; import UserAvatarLink from "../../user-avatar-link"; -import { UserLink } from "../../user-link"; +import UserLink from "../../user-link"; import Timestamp from "../../timestamp"; import DecryptPlaceholder from "../../../views/messages/decrypt-placeholder"; import { MessageContent } from "../../../views/messages/message"; diff --git a/src/components/embed-event/event-types/embedded-emoji-pack.tsx b/src/components/embed-event/event-types/embedded-emoji-pack.tsx index c3df62663..bbf6b75f4 100644 --- a/src/components/embed-event/event-types/embedded-emoji-pack.tsx +++ b/src/components/embed-event/event-types/embedded-emoji-pack.tsx @@ -16,7 +16,7 @@ import { Link as RouterLink } from "react-router-dom"; import { getSharableEventAddress } from "../../../helpers/nip19"; import { getEmojisFromPack, getPackName } from "../../../helpers/nostr/emoji-packs"; import UserAvatarLink from "../../user-avatar-link"; -import { UserLink } from "../../user-link"; +import UserLink from "../../user-link"; import EmojiPackFavoriteButton from "../../../views/emoji-packs/components/emoji-pack-favorite-button"; import EmojiPackMenu from "../../../views/emoji-packs/components/emoji-pack-menu"; import { NostrEvent } from "../../../types/nostr-event"; diff --git a/src/components/embed-event/event-types/embedded-goal.tsx b/src/components/embed-event/event-types/embedded-goal.tsx index f69251590..d9b207fe2 100644 --- a/src/components/embed-event/event-types/embedded-goal.tsx +++ b/src/components/embed-event/event-types/embedded-goal.tsx @@ -5,7 +5,7 @@ import { getSharableEventAddress } from "../../../helpers/nip19"; import { NostrEvent } from "../../../types/nostr-event"; import { getGoalName } from "../../../helpers/nostr/goal"; import UserAvatarLink from "../../user-avatar-link"; -import { UserLink } from "../../user-link"; +import UserLink from "../../user-link"; import GoalProgress from "../../../views/goals/components/goal-progress"; import GoalZapButton from "../../../views/goals/components/goal-zap-button"; import GoalTopZappers from "../../../views/goals/components/goal-top-zappers"; diff --git a/src/components/embed-event/event-types/embedded-list.tsx b/src/components/embed-event/event-types/embedded-list.tsx index ba839ddfe..981a87f3e 100644 --- a/src/components/embed-event/event-types/embedded-list.tsx +++ b/src/components/embed-event/event-types/embedded-list.tsx @@ -6,7 +6,7 @@ import { getListDescription, getListName, isSpecialListKind } from "../../../hel import { createCoordinate } from "../../../services/replaceable-event-requester"; import { getSharableEventAddress } from "../../../helpers/nip19"; import UserAvatarLink from "../../user-avatar-link"; -import { UserLink } from "../../user-link"; +import UserLink from "../../user-link"; import ListFeedButton from "../../../views/lists/components/list-feed-button"; import { ListCardContent } from "../../../views/lists/components/list-card"; diff --git a/src/components/embed-event/event-types/embedded-note.tsx b/src/components/embed-event/event-types/embedded-note.tsx index 6167c5baa..807aeed32 100644 --- a/src/components/embed-event/event-types/embedded-note.tsx +++ b/src/components/embed-event/event-types/embedded-note.tsx @@ -4,7 +4,7 @@ import { Link as RouterLink } from "react-router-dom"; import { NostrEvent } from "../../../types/nostr-event"; import UserAvatarLink from "../../user-avatar-link"; -import { UserLink } from "../../user-link"; +import UserLink from "../../user-link"; import { UserDnsIdentityIcon } from "../../user-dns-identity-icon"; import useSubject from "../../../hooks/use-subject"; import appSettings from "../../../services/settings/app-settings"; diff --git a/src/components/embed-event/event-types/embedded-reaction.tsx b/src/components/embed-event/event-types/embedded-reaction.tsx index 4b34e33cb..6cd3eea81 100644 --- a/src/components/embed-event/event-types/embedded-reaction.tsx +++ b/src/components/embed-event/event-types/embedded-reaction.tsx @@ -3,7 +3,7 @@ import { Card, CardProps, Flex, LinkBox, Spacer, Text } from "@chakra-ui/react"; import { NostrEvent } from "../../../types/nostr-event"; import { TrustProvider } from "../../../providers/trust"; import UserAvatarLink from "../../user-avatar-link"; -import { UserLink } from "../../user-link"; +import UserLink from "../../user-link"; import Timestamp from "../../timestamp"; import ReactionIcon from "../../event-reactions/reaction-icon"; import { NoteLink } from "../../note-link"; diff --git a/src/components/embed-event/event-types/embedded-stemstr-track.tsx b/src/components/embed-event/event-types/embedded-stemstr-track.tsx index 66006b9c2..5cb92c0c1 100644 --- a/src/components/embed-event/event-types/embedded-stemstr-track.tsx +++ b/src/components/embed-event/event-types/embedded-stemstr-track.tsx @@ -17,7 +17,7 @@ import { import { NostrEvent } from "../../../types/nostr-event"; import UserAvatarLink from "../../user-avatar-link"; -import { UserLink } from "../../user-link"; +import UserLink from "../../user-link"; import { CompactNoteContent } from "../../compact-note-content"; import { getDownloadURL, getHashtags, getStreamURL } from "../../../helpers/nostr/stemstr"; import { DownloadIcon, ReplyIcon } from "../../icons"; diff --git a/src/components/embed-event/event-types/embedded-stream-message.tsx b/src/components/embed-event/event-types/embedded-stream-message.tsx index d5bcad5dd..2e83ddcdb 100644 --- a/src/components/embed-event/event-types/embedded-stream-message.tsx +++ b/src/components/embed-event/event-types/embedded-stream-message.tsx @@ -2,7 +2,7 @@ import { Box, Card, CardProps, Divider, Flex, Link, Text } from "@chakra-ui/reac import { Link as RouterLink } from "react-router-dom"; import { NostrEvent, isATag } from "../../../types/nostr-event"; -import { UserLink } from "../../user-link"; +import UserLink from "../../user-link"; import UserAvatar from "../../user-avatar"; import ChatMessageContent from "../../../views/streams/stream/stream-chat/chat-message-content"; import useReplaceableEvent from "../../../hooks/use-replaceable-event"; diff --git a/src/components/embed-event/event-types/embedded-stream.tsx b/src/components/embed-event/event-types/embedded-stream.tsx index f43f83b59..d9a8b024f 100644 --- a/src/components/embed-event/event-types/embedded-stream.tsx +++ b/src/components/embed-event/event-types/embedded-stream.tsx @@ -4,7 +4,7 @@ import { Link as RouterLink, useNavigate } from "react-router-dom"; import { parseStreamEvent } from "../../../helpers/nostr/stream"; import { NostrEvent } from "../../../types/nostr-event"; import StreamStatusBadge from "../../../views/streams/components/status-badge"; -import { UserLink } from "../../user-link"; +import UserLink from "../../user-link"; import UserAvatar from "../../user-avatar"; import useEventNaddr from "../../../hooks/use-event-naddr"; import Timestamp from "../../timestamp"; diff --git a/src/components/embed-event/event-types/embedded-torrent-comment.tsx b/src/components/embed-event/event-types/embedded-torrent-comment.tsx index d70d8decf..632dfcbd8 100644 --- a/src/components/embed-event/event-types/embedded-torrent-comment.tsx +++ b/src/components/embed-event/event-types/embedded-torrent-comment.tsx @@ -3,7 +3,7 @@ import { Link as RouterLink } from "react-router-dom"; import { NostrEvent } from "../../../types/nostr-event"; import UserAvatarLink from "../../user-avatar-link"; -import { UserLink } from "../../user-link"; +import UserLink from "../../user-link"; import useSubject from "../../../hooks/use-subject"; import appSettings from "../../../services/settings/app-settings"; import EventVerificationIcon from "../../event-verification-icon"; diff --git a/src/components/embed-event/event-types/embedded-torrent.tsx b/src/components/embed-event/event-types/embedded-torrent.tsx index 5a3f1fc20..3ff5c20b1 100644 --- a/src/components/embed-event/event-types/embedded-torrent.tsx +++ b/src/components/embed-event/event-types/embedded-torrent.tsx @@ -18,7 +18,7 @@ import { Link as RouterLink } from "react-router-dom"; import { getSharableEventAddress } from "../../../helpers/nip19"; import UserAvatarLink from "../../user-avatar-link"; -import { UserLink } from "../../user-link"; +import UserLink from "../../user-link"; import { NostrEvent } from "../../../types/nostr-event"; import Timestamp from "../../timestamp"; import Magnet from "../../icons/magnet"; diff --git a/src/components/embed-event/event-types/embedded-unknown.tsx b/src/components/embed-event/event-types/embedded-unknown.tsx index 5c3b4a464..d115ca9f7 100644 --- a/src/components/embed-event/event-types/embedded-unknown.tsx +++ b/src/components/embed-event/event-types/embedded-unknown.tsx @@ -3,7 +3,7 @@ import { Box, Button, Card, CardBody, CardHeader, CardProps, Flex, Link, Text, u import { getSharableEventAddress } from "../../../helpers/nip19"; import { NostrEvent } from "../../../types/nostr-event"; import UserAvatarLink from "../../user-avatar-link"; -import { UserLink } from "../../user-link"; +import UserLink from "../../user-link"; import { truncatedId } from "../../../helpers/nostr/events"; import { buildAppSelectUrl } from "../../../helpers/nostr/apps"; import { UserDnsIdentityIcon } from "../../user-dns-identity-icon"; diff --git a/src/components/embed-types/nostr.tsx b/src/components/embed-types/nostr.tsx index ba221db4c..30a9372a5 100644 --- a/src/components/embed-types/nostr.tsx +++ b/src/components/embed-types/nostr.tsx @@ -3,7 +3,7 @@ import { Link as RouterLink } from "react-router-dom"; import { EmbedableContent, embedJSX } from "../../helpers/embeds"; import { DraftNostrEvent, NostrEvent } from "../../types/nostr-event"; -import { UserLink } from "../user-link"; +import UserLink from "../user-link"; import { getMatchHashtag, getMatchNostrLink, stripInvisibleChar } from "../../helpers/regexp"; import { safeDecode } from "../../helpers/nip19"; import { EmbedEventPointer } from "../embed-event"; diff --git a/src/components/event-interactions-modal/index.tsx b/src/components/event-interactions-modal/index.tsx index f229749ad..fb27ed8ef 100644 --- a/src/components/event-interactions-modal/index.tsx +++ b/src/components/event-interactions-modal/index.tsx @@ -16,7 +16,7 @@ import { import { NostrEvent } from "../../types/nostr-event"; import UserAvatarLink from "../user-avatar-link"; -import { UserLink } from "../user-link"; +import UserLink from "../user-link"; import { LightningIcon } from "../icons"; import { ParsedZap } from "../../helpers/nostr/zaps"; import { readablizeSats } from "../../helpers/bolt11"; diff --git a/src/components/event-interactions-modal/reaction-details.tsx b/src/components/event-interactions-modal/reaction-details.tsx index 83c66cf9d..0d928e81f 100644 --- a/src/components/event-interactions-modal/reaction-details.tsx +++ b/src/components/event-interactions-modal/reaction-details.tsx @@ -4,7 +4,7 @@ import { useMemo } from "react"; import { NostrEvent } from "../../types/nostr-event"; import { groupReactions } from "../../helpers/nostr/reactions"; import UserAvatarLink from "../user-avatar-link"; -import { UserLink } from "../user-link"; +import UserLink from "../user-link"; import ReactionIcon from "../event-reactions/reaction-icon"; function ShowMoreGrid({ diff --git a/src/components/event-interactions-modal/repost-details.tsx b/src/components/event-interactions-modal/repost-details.tsx index 166559d47..bcbed8261 100644 --- a/src/components/event-interactions-modal/repost-details.tsx +++ b/src/components/event-interactions-modal/repost-details.tsx @@ -3,7 +3,7 @@ import { Kind } from "nostr-tools"; import { NostrEvent } from "../../types/nostr-event"; import UserAvatarLink from "../user-avatar-link"; -import { UserLink } from "../user-link"; +import UserLink from "../user-link"; import useTimelineLoader from "../../hooks/use-timeline-loader"; import { useReadRelayUrls } from "../../hooks/use-client-relays"; import useSubject from "../../hooks/use-subject"; diff --git a/src/components/event-zap-modal/index.tsx b/src/components/event-zap-modal/index.tsx index 368dce44e..78a2f05d4 100644 --- a/src/components/event-zap-modal/index.tsx +++ b/src/components/event-zap-modal/index.tsx @@ -28,7 +28,7 @@ import signingService from "../../services/signing"; import accountService from "../../services/account"; import PayStep from "./pay-step"; import { getInvoiceFromCallbackUrl } from "../../helpers/lnurl"; -import { UserLink } from "../user-link"; +import UserLink from "../user-link"; import relayHintService from "../../services/event-relay-hint"; export type PayRequest = { invoice?: string; pubkey: string; error?: any }; diff --git a/src/components/event-zap-modal/input-step.tsx b/src/components/event-zap-modal/input-step.tsx index ccd3d8f80..b708f8771 100644 --- a/src/components/event-zap-modal/input-step.tsx +++ b/src/components/event-zap-modal/input-step.tsx @@ -10,7 +10,7 @@ import { EmbedEvent, EmbedProps } from "../embed-event"; import useAppSettings from "../../hooks/use-app-settings"; import CustomZapAmountOptions from "./zap-options"; import UserAvatar from "../user-avatar"; -import { UserLink } from "../user-link"; +import UserLink from "../user-link"; function UserCard({ pubkey, percent }: { pubkey: string; percent?: number }) { const { address } = useUserLNURLMetadata(pubkey); diff --git a/src/components/event-zap-modal/pay-step.tsx b/src/components/event-zap-modal/pay-step.tsx index 5161bb60d..382a847bc 100644 --- a/src/components/event-zap-modal/pay-step.tsx +++ b/src/components/event-zap-modal/pay-step.tsx @@ -3,7 +3,7 @@ import { Alert, Box, Button, ButtonGroup, Flex, IconButton, Spacer, useDisclosur import { PayRequest } from "."; import UserAvatar from "../user-avatar"; -import { UserLink } from "../user-link"; +import UserLink from "../user-link"; import { ChevronDownIcon, ChevronUpIcon, CheckIcon, ErrorIcon, LightningIcon } from "../icons"; import { InvoiceModalContent } from "../invoice-modal"; import { PropsWithChildren, useEffect, useState } from "react"; diff --git a/src/components/layout/ghost-toolbar.tsx b/src/components/layout/ghost-toolbar.tsx index bc0566db3..875335830 100644 --- a/src/components/layout/ghost-toolbar.tsx +++ b/src/components/layout/ghost-toolbar.tsx @@ -9,7 +9,7 @@ import useCurrentAccount from "../../hooks/use-current-account"; import useSubject from "../../hooks/use-subject"; import accountService from "../../services/account"; import UserAvatar from "../user-avatar"; -import { UserLink } from "../user-link"; +import UserLink from "../user-link"; import { GhostIcon } from "../icons"; import useTimelineLoader from "../../hooks/use-timeline-loader"; import { useReadRelayUrls } from "../../hooks/use-client-relays"; diff --git a/src/components/lightbox-provider.tsx b/src/components/lightbox-provider.tsx index 19b1deae9..cd3f60704 100644 --- a/src/components/lightbox-provider.tsx +++ b/src/components/lightbox-provider.tsx @@ -31,7 +31,7 @@ declare module "yet-another-react-lightbox" { import { NostrEvent } from "../types/nostr-event"; import UserAvatarLink from "./user-avatar-link"; -import { UserLink } from "./user-link"; +import UserLink from "./user-link"; import { UserDnsIdentityIcon } from "./user-dns-identity-icon"; import styled from "@emotion/styled"; import { getSharableEventAddress } from "../helpers/nip19"; diff --git a/src/components/note-translation-modal/index.tsx b/src/components/note-translation-modal/index.tsx index 14c5e7354..78d73c5e7 100644 --- a/src/components/note-translation-modal/index.tsx +++ b/src/components/note-translation-modal/index.tsx @@ -31,7 +31,7 @@ import { getEventUID } from "../../helpers/nostr/events"; import { useReadRelayUrls } from "../../hooks/use-client-relays"; import useSubject from "../../hooks/use-subject"; import UserAvatarLink from "../user-avatar-link"; -import { UserLink } from "../user-link"; +import UserLink from "../user-link"; import { useSigningContext } from "../../providers/signing-provider"; import relayScoreboardService from "../../services/relay-scoreboard"; import NostrPublishAction from "../../classes/nostr-publish-action"; diff --git a/src/components/note/index.tsx b/src/components/note/index.tsx index dd2872269..a6a750bbf 100644 --- a/src/components/note/index.tsx +++ b/src/components/note/index.tsx @@ -20,7 +20,7 @@ import { Link as RouterLink } from "react-router-dom"; import NoteMenu from "./note-menu"; import { EventRelays } from "./note-relays"; -import { UserLink } from "../user-link"; +import UserLink from "../user-link"; import { UserDnsIdentityIcon } from "../user-dns-identity-icon"; import NoteZapButton from "./note-zap-button"; import { ExpandProvider } from "../../providers/expanded"; diff --git a/src/components/post-modal/zap-split-creator.tsx b/src/components/post-modal/zap-split-creator.tsx index 61a81a039..ddf6e211d 100644 --- a/src/components/post-modal/zap-split-creator.tsx +++ b/src/components/post-modal/zap-split-creator.tsx @@ -17,7 +17,7 @@ import { EventSplit } from "../../helpers/nostr/zaps"; import { AddIcon } from "../icons"; import { normalizeToHex } from "../../helpers/nip19"; import UserAvatar from "../user-avatar"; -import { UserLink } from "../user-link"; +import UserLink from "../user-link"; import NpubAutocomplete from "../npub-autocomplete"; function getRemainingPercent(split: EventSplit) { diff --git a/src/components/timeline-page/generic-note-timeline/relay-recommendation.tsx b/src/components/timeline-page/generic-note-timeline/relay-recommendation.tsx index 320643c2d..fd7ef3c4a 100644 --- a/src/components/timeline-page/generic-note-timeline/relay-recommendation.tsx +++ b/src/components/timeline-page/generic-note-timeline/relay-recommendation.tsx @@ -3,7 +3,7 @@ import { Flex, Text } from "@chakra-ui/react"; import { NostrEvent } from "../../../types/nostr-event"; import UserAvatar from "../../user-avatar"; -import { UserLink } from "../../user-link"; +import UserLink from "../../user-link"; import RelayCard from "../../../views/relays/components/relay-card"; import { safeRelayUrl } from "../../../helpers/url"; import { useRegisterIntersectionEntity } from "../../../providers/intersection-observer"; diff --git a/src/components/timeline-page/generic-note-timeline/repost-note.tsx b/src/components/timeline-page/generic-note-timeline/repost-note.tsx index 92f0d7661..de8979146 100644 --- a/src/components/timeline-page/generic-note-timeline/repost-note.tsx +++ b/src/components/timeline-page/generic-note-timeline/repost-note.tsx @@ -8,7 +8,7 @@ import { Note } from "../../note"; import NoteMenu from "../../note/note-menu"; import UserAvatar from "../../user-avatar"; import { UserDnsIdentityIcon } from "../../user-dns-identity-icon"; -import { UserLink } from "../../user-link"; +import UserLink from "../../user-link"; import { TrustProvider } from "../../../providers/trust"; import { useReadRelayUrls } from "../../../hooks/use-client-relays"; import { useRegisterIntersectionEntity } from "../../../providers/intersection-observer"; diff --git a/src/components/timeline-page/generic-note-timeline/stream-note.tsx b/src/components/timeline-page/generic-note-timeline/stream-note.tsx index f7196136c..588dbfd45 100644 --- a/src/components/timeline-page/generic-note-timeline/stream-note.tsx +++ b/src/components/timeline-page/generic-note-timeline/stream-note.tsx @@ -21,7 +21,7 @@ import { parseStreamEvent } from "../../../helpers/nostr/stream"; import useEventNaddr from "../../../hooks/use-event-naddr"; import { useRegisterIntersectionEntity } from "../../../providers/intersection-observer"; import UserAvatar from "../../user-avatar"; -import { UserLink } from "../../user-link"; +import UserLink from "../../user-link"; import StreamStatusBadge from "../../../views/streams/components/status-badge"; import { EventRelays } from "../../note/note-relays"; import { useAsync } from "react-use"; diff --git a/src/components/user-avatar.tsx b/src/components/user-avatar.tsx index b2b14dd27..52ec68a52 100644 --- a/src/components/user-avatar.tsx +++ b/src/components/user-avatar.tsx @@ -5,9 +5,9 @@ import { useAsync } from "react-use"; import { getIdenticon } from "../helpers/identicon"; import { safeUrl } from "../helpers/parse"; -import appSettings from "../services/settings/app-settings"; -import useSubject from "../hooks/use-subject"; import { getUserDisplayName } from "../helpers/user-metadata"; +import useAppSettings from "../hooks/use-app-settings"; +import useCurrentAccount from "../hooks/use-current-account"; export const UserIdenticon = memo(({ pubkey }: { pubkey: string }) => { const { value: identicon } = useAsync(() => getIdenticon(pubkey), [pubkey]); @@ -21,9 +21,11 @@ export type UserAvatarProps = Omit & { noProxy?: boolean; }; export const UserAvatar = forwardRef(({ pubkey, noProxy, relay, ...props }, ref) => { - const { imageProxy, proxyUserMedia } = useSubject(appSettings); + const { imageProxy, proxyUserMedia, hideUsernames } = useAppSettings(); + const account = useCurrentAccount(); const metadata = useUserMetadata(pubkey, relay ? [relay] : undefined); const picture = useMemo(() => { + if (hideUsernames && pubkey !== account?.pubkey) return undefined; if (metadata?.picture) { const src = safeUrl(metadata?.picture); if (!noProxy) { @@ -36,7 +38,7 @@ export const UserAvatar = forwardRef(({ pubkey, } return src; } - }, [metadata?.picture, imageProxy]); + }, [metadata?.picture, imageProxy, hideUsernames, account]); return ( { +export default function UserLink({ pubkey, showAt, tab, ...props }: UserLinkProps) { const metadata = useUserMetadata(pubkey); + const account = useCurrentAccount(); + const { hideUsernames } = useAppSettings(); return ( {showAt && "@"} - {getUserDisplayName(metadata, pubkey)} + {hideUsernames && pubkey !== account?.pubkey ? "Anon" : getUserDisplayName(metadata, pubkey)} ); -}; +} diff --git a/src/components/user-name.tsx b/src/components/user-name.tsx index 45c279911..ad4dfc483 100644 --- a/src/components/user-name.tsx +++ b/src/components/user-name.tsx @@ -2,13 +2,15 @@ import { Text, TextProps } from "@chakra-ui/react"; import { getUserDisplayName } from "../helpers/user-metadata"; import { useUserMetadata } from "../hooks/use-user-metadata"; +import useAppSettings from "../hooks/use-app-settings"; export default function UserName({ pubkey, ...props }: Omit & { pubkey: string }) { const metadata = useUserMetadata(pubkey); + const { hideUsernames } = useAppSettings(); return ( - {getUserDisplayName(metadata, pubkey)} + {hideUsernames ? "Anon" : getUserDisplayName(metadata, pubkey)} ); } diff --git a/src/providers/dycryption-provider.tsx b/src/providers/dycryption-provider.tsx index 4fa509a7b..a6653a2b0 100644 --- a/src/providers/dycryption-provider.tsx +++ b/src/providers/dycryption-provider.tsx @@ -37,8 +37,8 @@ const DecryptionContext = createContext({ getQueue: () => [], }); -export function useDecryptionContext(){ - return useContext(DecryptionContext) +export function useDecryptionContext() { + return useContext(DecryptionContext); } export function useDecryptionContainer(pubkey: string, data: string) { const { getOrCreateContainer, addToQueue, startQueue } = useContext(DecryptionContext); diff --git a/src/providers/mute-modal-provider.tsx b/src/providers/mute-modal-provider.tsx index de5ba731a..805bd1f30 100644 --- a/src/providers/mute-modal-provider.tsx +++ b/src/providers/mute-modal-provider.tsx @@ -39,7 +39,7 @@ import replaceableEventLoaderService from "../services/replaceable-event-request import useUserMuteList from "../hooks/use-user-mute-list"; import { DraftNostrEvent } from "../types/nostr-event"; import UserAvatar from "../components/user-avatar"; -import { UserLink } from "../components/user-link"; +import UserLink from "../components/user-link"; import { ChevronDownIcon } from "../components/icons"; type MuteModalContextType = { diff --git a/src/services/account.ts b/src/services/account.ts index c411b1d24..138e5b587 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -8,7 +8,7 @@ export type Account = { relays?: string[]; secKey?: ArrayBuffer; iv?: Uint8Array; - connectionType?: 'extension'|'serial'; + connectionType?: "extension" | "serial"; localSettings?: AppSettings; }; diff --git a/src/services/settings/migrations.ts b/src/services/settings/migrations.ts index fec5b5370..a758084a9 100644 --- a/src/services/settings/migrations.ts +++ b/src/services/settings/migrations.ts @@ -30,6 +30,7 @@ export type AppSettingsV1 = Omit & { export type AppSettingsV2 = Omit & { version: 2; theme: string }; export type AppSettingsV3 = Omit & { version: 3; quickReactions: string[] }; export type AppSettingsV4 = Omit & { version: 4; loadOpenGraphData: boolean }; +export type AppSettingsV5 = Omit & { version: 5; hideUsernames: boolean }; export function isV0(settings: { version: number }): settings is AppSettingsV0 { return settings.version === undefined || settings.version === 0; @@ -46,15 +47,20 @@ export function isV3(settings: { version: number }): settings is AppSettingsV3 { export function isV4(settings: { version: number }): settings is AppSettingsV4 { return settings.version === 4; } +export function isV5(settings: { version: number }): settings is AppSettingsV5 { + return settings.version === 5; +} -export type AppSettings = AppSettingsV4; +export type AppSettings = AppSettingsV5; export const defaultSettings: AppSettings = { - version: 4, + version: 5, theme: "default", colorMode: "system", maxPageWidth: "none", blurImages: true, + // nostr:nevent1qqsxvkjgpc6zhydj4rxjpl0frev7hmgynruq027mujdgy2hwjypaqfspzpmhxue69uhkummnw3ezuamfdejszythwden5te0dehhxarjw4jjucm0d5sfntd0 + hideUsernames: false, autoShowMedia: true, proxyUserMedia: false, loadOpenGraphData: true, @@ -76,11 +82,12 @@ export const defaultSettings: AppSettings = { }; export function upgradeSettings(settings: { version: number }): AppSettings | null { - if (isV0(settings)) return { ...defaultSettings, ...settings, version: 4 }; - if (isV1(settings)) return { ...defaultSettings, ...settings, version: 4 }; - if (isV2(settings)) return { ...defaultSettings, ...settings, version: 4 }; - if (isV3(settings)) return { ...defaultSettings, ...settings, version: 4 }; - if (isV4(settings)) return settings; + if (isV0(settings)) return { ...defaultSettings, ...settings, version: 5 }; + if (isV1(settings)) return { ...defaultSettings, ...settings, version: 5 }; + if (isV2(settings)) return { ...defaultSettings, ...settings, version: 5 }; + if (isV3(settings)) return { ...defaultSettings, ...settings, version: 5 }; + if (isV4(settings)) return { ...defaultSettings, ...settings, version: 5 }; + if (isV5(settings)) return settings; return null; } diff --git a/src/views/badges/badge-details.tsx b/src/views/badges/badge-details.tsx index 14f4e7346..48d9e3b15 100644 --- a/src/views/badges/badge-details.tsx +++ b/src/views/badges/badge-details.tsx @@ -29,7 +29,7 @@ import useSubject from "../../hooks/use-subject"; import { NostrEvent } from "../../types/nostr-event"; import { getEventCoordinate } from "../../helpers/nostr/events"; import UserAvatarLink from "../../components/user-avatar-link"; -import { UserLink } from "../../components/user-link"; +import UserLink from "../../components/user-link"; import Timestamp from "../../components/timestamp"; import VerticalPageLayout from "../../components/vertical-page-layout"; import BadgeAwardCard from "./components/badge-award-card"; diff --git a/src/views/badges/components/badge-award-card.tsx b/src/views/badges/components/badge-award-card.tsx index c8ca9b3f9..3f30781a8 100644 --- a/src/views/badges/components/badge-award-card.tsx +++ b/src/views/badges/components/badge-award-card.tsx @@ -8,7 +8,7 @@ import { NostrEvent } from "../../../types/nostr-event"; import { useRegisterIntersectionEntity } from "../../../providers/intersection-observer"; import { getEventUID } from "../../../helpers/nostr/events"; import { getSharableEventAddress } from "../../../helpers/nip19"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import Timestamp from "../../../components/timestamp"; import UserAvatarLink from "../../../components/user-avatar-link"; diff --git a/src/views/badges/components/badge-card.tsx b/src/views/badges/components/badge-card.tsx index 7987223dd..61f78abdb 100644 --- a/src/views/badges/components/badge-card.tsx +++ b/src/views/badges/components/badge-card.tsx @@ -3,7 +3,7 @@ import { Link as RouterLink, useNavigate } from "react-router-dom"; import { ButtonGroup, Card, CardBody, CardHeader, CardProps, Flex, Heading, Image, Link, Text } from "@chakra-ui/react"; import UserAvatarLink from "../../../components/user-avatar-link"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import { getSharableEventAddress } from "../../../helpers/nip19"; import { NostrEvent } from "../../../types/nostr-event"; import { useRegisterIntersectionEntity } from "../../../providers/intersection-observer"; diff --git a/src/views/channels/components/channel-card.tsx b/src/views/channels/components/channel-card.tsx index f93368905..31baaa503 100644 --- a/src/views/channels/components/channel-card.tsx +++ b/src/views/channels/components/channel-card.tsx @@ -21,7 +21,7 @@ import { NostrEvent } from "../../../types/nostr-event"; import { useRegisterIntersectionEntity } from "../../../providers/intersection-observer"; import HoverLinkOverlay from "../../../components/hover-link-overlay"; import UserAvatarLink from "../../../components/user-avatar-link"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import useSingleEvent from "../../../hooks/use-single-event"; import { useReadRelayUrls } from "../../../hooks/use-client-relays"; import singleEventService from "../../../services/single-event"; diff --git a/src/views/channels/components/channel-chat-message.tsx b/src/views/channels/components/channel-chat-message.tsx index e577f7f26..625ec26b7 100644 --- a/src/views/channels/components/channel-chat-message.tsx +++ b/src/views/channels/components/channel-chat-message.tsx @@ -3,7 +3,7 @@ import { NostrEvent } from "../../../types/nostr-event"; import { useRegisterIntersectionEntity } from "../../../providers/intersection-observer"; import { TrustProvider } from "../../../providers/trust"; import UserAvatar from "../../../components/user-avatar"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import { memo, useMemo, useRef } from "react"; import { EmbedableContent, embedUrls } from "../../../helpers/embeds"; import { diff --git a/src/views/channels/components/channel-metadata-drawer.tsx b/src/views/channels/components/channel-metadata-drawer.tsx index 34d273f63..cf9ed81f4 100644 --- a/src/views/channels/components/channel-metadata-drawer.tsx +++ b/src/views/channels/components/channel-metadata-drawer.tsx @@ -22,7 +22,7 @@ import useTimelineLoader from "../../../hooks/use-timeline-loader"; import useSubject from "../../../hooks/use-subject"; import { useTimelineCurserIntersectionCallback } from "../../../hooks/use-timeline-cursor-intersection-callback"; import IntersectionObserverProvider from "../../../providers/intersection-observer"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import HoverLinkOverlay from "../../../components/hover-link-overlay"; import UserAvatar from "../../../components/user-avatar"; import { useRelaySelectionContext } from "../../../providers/relay-selection-provider"; diff --git a/src/views/communities/components/community-card.tsx b/src/views/communities/components/community-card.tsx index 43d535d02..96a64aa3b 100644 --- a/src/views/communities/components/community-card.tsx +++ b/src/views/communities/components/community-card.tsx @@ -20,7 +20,7 @@ import { useRegisterIntersectionEntity } from "../../../providers/intersection-o import { getEventUID } from "../../../helpers/nostr/events"; import { getCommunityImage, getCommunityName } from "../../../helpers/nostr/communities"; import UserAvatarLink from "../../../components/user-avatar-link"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import useCountCommunityMembers from "../../../hooks/use-count-community-members"; import { readablizeSats } from "../../../helpers/bolt11"; import User01 from "../../../components/icons/user-01"; diff --git a/src/views/communities/components/community-create-modal.tsx b/src/views/communities/components/community-create-modal.tsx index 6ac9b79d1..a432ab4c2 100644 --- a/src/views/communities/components/community-create-modal.tsx +++ b/src/views/communities/components/community-create-modal.tsx @@ -30,7 +30,7 @@ import { SubmitHandler, useForm } from "react-hook-form"; import useCurrentAccount from "../../../hooks/use-current-account"; import UserAvatar from "../../../components/user-avatar"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import { TrashIcon } from "../../../components/icons"; import Upload01 from "../../../components/icons/upload-01"; import { nostrBuildUploadImage } from "../../../helpers/nostr-build"; diff --git a/src/views/community/community-home.tsx b/src/views/community/community-home.tsx index 955c191dc..c7e8b02ec 100644 --- a/src/views/community/community-home.tsx +++ b/src/views/community/community-home.tsx @@ -14,7 +14,7 @@ import { import { NostrEvent } from "../../types/nostr-event"; import VerticalPageLayout from "../../components/vertical-page-layout"; import UserAvatarLink from "../../components/user-avatar-link"; -import { UserLink } from "../../components/user-link"; +import UserLink from "../../components/user-link"; import { AdditionalRelayProvider } from "../../providers/additional-relay-context"; import TrendUp01 from "../../components/icons/trend-up-01"; diff --git a/src/views/community/components/community-members-modal.tsx b/src/views/community/components/community-members-modal.tsx index 3d88f1b2c..32c41d926 100644 --- a/src/views/community/components/community-members-modal.tsx +++ b/src/views/community/components/community-members-modal.tsx @@ -22,7 +22,7 @@ import IntersectionObserverProvider from "../../../providers/intersection-observ import useSubject from "../../../hooks/use-subject"; import { useTimelineCurserIntersectionCallback } from "../../../hooks/use-timeline-cursor-intersection-callback"; import TimelineActionAndStatus from "../../../components/timeline-page/timeline-action-and-status"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import { UserDnsIdentityIcon } from "../../../components/user-dns-identity-icon"; import UserAvatarLink from "../../../components/user-avatar-link"; diff --git a/src/views/community/components/community-post.tsx b/src/views/community/components/community-post.tsx index 70f5789f2..1c6f629dd 100644 --- a/src/views/community/components/community-post.tsx +++ b/src/views/community/components/community-post.tsx @@ -24,7 +24,7 @@ import HoverLinkOverlay from "../../../components/hover-link-overlay"; import { CompactNoteContent } from "../../../components/compact-note-content"; import { useRegisterIntersectionEntity } from "../../../providers/intersection-observer"; import { getEventUID, parseHardcodedNoteContent } from "../../../helpers/nostr/events"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import UserAvatarLink from "../../../components/user-avatar-link"; import useUserMuteFilter from "../../../hooks/use-user-mute-filter"; import { useReadRelayUrls } from "../../../hooks/use-client-relays"; diff --git a/src/views/community/components/horizonal-community-details.tsx b/src/views/community/components/horizonal-community-details.tsx index 7a6829081..acfdcf1e9 100644 --- a/src/views/community/components/horizonal-community-details.tsx +++ b/src/views/community/components/horizonal-community-details.tsx @@ -23,7 +23,7 @@ import { } from "../../../helpers/nostr/communities"; import CommunityDescription from "../../communities/components/community-description"; import UserAvatarLink from "../../../components/user-avatar-link"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import { NostrEvent } from "../../../types/nostr-event"; import CommunityJoinButton from "../../communities/components/community-join-button"; import CommunityMenu from "./community-menu"; diff --git a/src/views/community/components/vertical-community-details.tsx b/src/views/community/components/vertical-community-details.tsx index 923eb6852..2b23d9534 100644 --- a/src/views/community/components/vertical-community-details.tsx +++ b/src/views/community/components/vertical-community-details.tsx @@ -10,7 +10,7 @@ import { } from "../../../helpers/nostr/communities"; import CommunityDescription from "../../communities/components/community-description"; import UserAvatarLink from "../../../components/user-avatar-link"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import { NostrEvent } from "../../../types/nostr-event"; import CommunityJoinButton from "../../communities/components/community-join-button"; import CommunityMenu from "./community-menu"; diff --git a/src/views/emoji-packs/components/emoji-pack-card.tsx b/src/views/emoji-packs/components/emoji-pack-card.tsx index 73f859eb0..c4067731c 100644 --- a/src/views/emoji-packs/components/emoji-pack-card.tsx +++ b/src/views/emoji-packs/components/emoji-pack-card.tsx @@ -14,7 +14,7 @@ import { } from "@chakra-ui/react"; import UserAvatarLink from "../../../components/user-avatar-link"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import { getSharableEventAddress } from "../../../helpers/nip19"; import { NostrEvent } from "../../../types/nostr-event"; import { useRegisterIntersectionEntity } from "../../../providers/intersection-observer"; diff --git a/src/views/emoji-packs/emoji-pack.tsx b/src/views/emoji-packs/emoji-pack.tsx index 5d74fdad9..bce8268fb 100644 --- a/src/views/emoji-packs/emoji-pack.tsx +++ b/src/views/emoji-packs/emoji-pack.tsx @@ -21,7 +21,7 @@ import { Text, } from "@chakra-ui/react"; -import { UserLink } from "../../components/user-link"; +import UserLink from "../../components/user-link"; import { ChevronLeftIcon } from "../../components/icons"; import useCurrentAccount from "../../hooks/use-current-account"; import { useDeleteEventContext } from "../../providers/delete-event-provider"; diff --git a/src/views/goals/components/goal-card.tsx b/src/views/goals/components/goal-card.tsx index fb357520c..a30d111bb 100644 --- a/src/views/goals/components/goal-card.tsx +++ b/src/views/goals/components/goal-card.tsx @@ -3,7 +3,7 @@ import { Link as RouterLink } from "react-router-dom"; import { ButtonGroup, Card, CardBody, CardHeader, CardProps, Flex, Heading, Link, Text } from "@chakra-ui/react"; import UserAvatarLink from "../../../components/user-avatar-link"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import { getSharableEventAddress } from "../../../helpers/nip19"; import { NostrEvent } from "../../../types/nostr-event"; import { useRegisterIntersectionEntity } from "../../../providers/intersection-observer"; diff --git a/src/views/goals/components/goal-top-zappers.tsx b/src/views/goals/components/goal-top-zappers.tsx index 3970e5077..e329fc09b 100644 --- a/src/views/goals/components/goal-top-zappers.tsx +++ b/src/views/goals/components/goal-top-zappers.tsx @@ -5,7 +5,7 @@ import { getGoalRelays } from "../../../helpers/nostr/goal"; import useEventZaps from "../../../hooks/use-event-zaps"; import { NostrEvent } from "../../../types/nostr-event"; import UserAvatarLink from "../../../components/user-avatar-link"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import { readablizeSats } from "../../../helpers/bolt11"; import { LightningIcon } from "../../../components/icons"; diff --git a/src/views/goals/components/goal-zap-list.tsx b/src/views/goals/components/goal-zap-list.tsx index c4cf88989..9c1071ef4 100644 --- a/src/views/goals/components/goal-zap-list.tsx +++ b/src/views/goals/components/goal-zap-list.tsx @@ -4,7 +4,7 @@ import { getGoalRelays } from "../../../helpers/nostr/goal"; import useEventZaps from "../../../hooks/use-event-zaps"; import { NostrEvent } from "../../../types/nostr-event"; import UserAvatarLink from "../../../components/user-avatar-link"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import { readablizeSats } from "../../../helpers/bolt11"; import { LightningIcon } from "../../../components/icons"; import Timestamp from "../../../components/timestamp"; diff --git a/src/views/goals/goal-details.tsx b/src/views/goals/goal-details.tsx index 3bc39f720..13b68a5bb 100644 --- a/src/views/goals/goal-details.tsx +++ b/src/views/goals/goal-details.tsx @@ -10,7 +10,7 @@ import useSingleEvent from "../../hooks/use-single-event"; import { isHexKey } from "../../helpers/nip19"; import { EventPointer } from "nostr-tools/lib/types/nip19"; import UserAvatar from "../../components/user-avatar"; -import { UserLink } from "../../components/user-link"; +import UserLink from "../../components/user-link"; import GoalContents from "./components/goal-contents"; import GoalZapList from "./components/goal-zap-list"; import { readablizeSats } from "../../helpers/bolt11"; diff --git a/src/views/lists/components/list-card.tsx b/src/views/lists/components/list-card.tsx index d4ad68492..abdc86d20 100644 --- a/src/views/lists/components/list-card.tsx +++ b/src/views/lists/components/list-card.tsx @@ -16,7 +16,7 @@ import { import { Kind } from "nostr-tools"; import UserAvatarLink from "../../../components/user-avatar-link"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import { getEventsFromList, getListDescription, diff --git a/src/views/lists/components/list-favorite-button.tsx b/src/views/lists/components/list-favorite-button.tsx index f9c7115e0..46bde396e 100644 --- a/src/views/lists/components/list-favorite-button.tsx +++ b/src/views/lists/components/list-favorite-button.tsx @@ -10,7 +10,12 @@ import NostrPublishAction from "../../../classes/nostr-publish-action"; import clientRelaysService from "../../../services/client-relays"; import replaceableEventLoaderService from "../../../services/replaceable-event-requester"; import useFavoriteLists, { FAVORITE_LISTS_IDENTIFIER } from "../../../hooks/use-favorite-lists"; -import { NOTE_LIST_KIND, isSpecialListKind, listAddCoordinate, listRemoveCoordinate } from "../../../helpers/nostr/lists"; +import { + NOTE_LIST_KIND, + isSpecialListKind, + listAddCoordinate, + listRemoveCoordinate, +} from "../../../helpers/nostr/lists"; export default function ListFavoriteButton({ list, diff --git a/src/views/lists/list-details.tsx b/src/views/lists/list-details.tsx index 9cbdf1daf..adf7047b9 100644 --- a/src/views/lists/list-details.tsx +++ b/src/views/lists/list-details.tsx @@ -1,7 +1,7 @@ import { useNavigate, useParams } from "react-router-dom"; import { Kind, nip19 } from "nostr-tools"; -import { UserLink } from "../../components/user-link"; +import UserLink from "../../components/user-link"; import { Box, Button, Flex, Heading, SimpleGrid, Spacer, Text } from "@chakra-ui/react"; import { ChevronLeftIcon } from "../../components/icons"; import useCurrentAccount from "../../hooks/use-current-account"; diff --git a/src/views/messages/chat.tsx b/src/views/messages/chat.tsx index e36e6f2d8..4488ccb52 100644 --- a/src/views/messages/chat.tsx +++ b/src/views/messages/chat.tsx @@ -6,7 +6,7 @@ import { useNavigate, useParams } from "react-router-dom"; import { ChevronLeftIcon } from "../../components/icons"; import UserAvatar from "../../components/user-avatar"; -import { UserLink } from "../../components/user-link"; +import UserLink from "../../components/user-link"; import { isHexKey } from "../../helpers/nip19"; import useSubject from "../../hooks/use-subject"; import { useSigningContext } from "../../providers/signing-provider"; diff --git a/src/views/messages/message.tsx b/src/views/messages/message.tsx index 6141ff2d3..cb933ad82 100644 --- a/src/views/messages/message.tsx +++ b/src/views/messages/message.tsx @@ -15,7 +15,7 @@ import { } from "../../components/embed-types"; import { useRegisterIntersectionEntity } from "../../providers/intersection-observer"; import UserAvatar from "../../components/user-avatar"; -import { UserLink } from "../../components/user-link"; +import UserLink from "../../components/user-link"; import { getEventUID } from "../../helpers/nostr/events"; import Timestamp from "../../components/timestamp"; diff --git a/src/views/note/components/thread-post.tsx b/src/views/note/components/thread-post.tsx index 716278be5..4cb6abc57 100644 --- a/src/views/note/components/thread-post.tsx +++ b/src/views/note/components/thread-post.tsx @@ -19,7 +19,7 @@ import { TrustProvider } from "../../../providers/trust"; import ReplyForm from "./reply-form"; import useClientSideMuteFilter from "../../../hooks/use-client-side-mute-filter"; import UserAvatarLink from "../../../components/user-avatar-link"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import Timestamp from "../../../components/timestamp"; import { NoteContents } from "../../../components/note/text-note-contents"; import Expand01 from "../../../components/icons/expand-01"; diff --git a/src/views/relays/components/add-custom-modal.tsx b/src/views/relays/components/add-custom-modal.tsx index ffda6fe50..1acd4a1ab 100644 --- a/src/views/relays/components/add-custom-modal.tsx +++ b/src/views/relays/components/add-custom-modal.tsx @@ -22,7 +22,7 @@ import { import { useState } from "react"; import { useRelayInfo } from "../../../hooks/use-relay-info"; import UserAvatar from "../../../components/user-avatar"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import { safeRelayUrl } from "../../../helpers/url"; import { useDebounce } from "react-use"; import { UserDnsIdentityIcon } from "../../../components/user-dns-identity-icon"; diff --git a/src/views/relays/components/relay-card.tsx b/src/views/relays/components/relay-card.tsx index 476aed6c1..7ee15de9d 100644 --- a/src/views/relays/components/relay-card.tsx +++ b/src/views/relays/components/relay-card.tsx @@ -29,7 +29,7 @@ import { Link as RouterLink } from "react-router-dom"; import { useRelayInfo } from "../../../hooks/use-relay-info"; import { RelayFavicon } from "../../../components/relay-favicon"; import { CodeIcon } from "../../../components/icons"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import UserAvatar from "../../../components/user-avatar"; import { useClientRelays } from "../../../hooks/use-client-relays"; import clientRelaysService from "../../../services/client-relays"; diff --git a/src/views/relays/components/relay-review-note.tsx b/src/views/relays/components/relay-review-note.tsx index fdde955c6..d68c9b2f4 100644 --- a/src/views/relays/components/relay-review-note.tsx +++ b/src/views/relays/components/relay-review-note.tsx @@ -3,7 +3,7 @@ import { Card, CardBody, CardHeader, Link } from "@chakra-ui/react"; import { Link as RouterLink } from "react-router-dom"; import UserAvatarLink from "../../../components/user-avatar-link"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import { UserDnsIdentityIcon } from "../../../components/user-dns-identity-icon"; import StarRating from "../../../components/star-rating"; import { safeJson } from "../../../helpers/parse"; diff --git a/src/views/search/profile-results.tsx b/src/views/search/profile-results.tsx index 44c8768e3..27e2fc2fa 100644 --- a/src/views/search/profile-results.tsx +++ b/src/views/search/profile-results.tsx @@ -9,7 +9,7 @@ import { EmbedableContent, embedUrls } from "../../helpers/embeds"; import UserAvatar from "../../components/user-avatar"; import { UserDnsIdentityIcon } from "../../components/user-dns-identity-icon"; import { embedNostrLinks, renderGenericUrl } from "../../components/embed-types"; -import { UserLink } from "../../components/user-link"; +import UserLink from "../../components/user-link"; import trustedUserStatsService, { NostrBandUserStats } from "../../services/trusted-user-stats"; import { useRelaySelectionRelays } from "../../providers/relay-selection-provider"; import useTimelineLoader from "../../hooks/use-timeline-loader"; diff --git a/src/views/settings/display-settings.tsx b/src/views/settings/display-settings.tsx index 3315cfb50..8c730e697 100644 --- a/src/views/settings/display-settings.tsx +++ b/src/views/settings/display-settings.tsx @@ -1,5 +1,6 @@ import { useMemo, useState } from "react"; -import { UseControllerProps, useController, useFormContext } from "react-hook-form"; +import { useFormContext } from "react-hook-form"; +import { Link as RouterLink } from "react-router-dom"; import { Flex, FormControl, @@ -21,6 +22,7 @@ import { useDisclosure, IconButton, Button, + Link, } from "@chakra-ui/react"; import { matchSorter } from "match-sorter"; @@ -173,6 +175,26 @@ export default function DisplaySettings() { Enabled: blur media from people you aren't following + + + + Hide Usernames (anon mode) + + + + + + Enabled: hides usernames and pictures.{" "} + + Details + + + + diff --git a/src/views/signup/finished-step.tsx b/src/views/signup/finished-step.tsx index 90ed57367..ae0334f8b 100644 --- a/src/views/signup/finished-step.tsx +++ b/src/views/signup/finished-step.tsx @@ -3,7 +3,7 @@ import { Link as RouterLink } from "react-router-dom"; import { useAsync } from "react-use"; import UserAvatarLink from "../../components/user-avatar-link"; -import { UserLink } from "../../components/user-link"; +import UserLink from "../../components/user-link"; import { containerProps } from "./common"; import { UserFollowButton } from "../../components/user-follow-button"; import { Kind0ParsedContent } from "../../helpers/user-metadata"; diff --git a/src/views/streams/components/stream-card.tsx b/src/views/streams/components/stream-card.tsx index ebce9aa21..7fae2f306 100644 --- a/src/views/streams/components/stream-card.tsx +++ b/src/views/streams/components/stream-card.tsx @@ -4,7 +4,7 @@ import { Box, Card, CardBody, CardProps, Flex, Heading, LinkBox, LinkOverlay, Te import { ParsedStream } from "../../../helpers/nostr/stream"; import { Link as RouterLink } from "react-router-dom"; import UserAvatar from "../../../components/user-avatar"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import StreamStatusBadge from "./status-badge"; import { useRegisterIntersectionEntity } from "../../../providers/intersection-observer"; import useEventNaddr from "../../../hooks/use-event-naddr"; diff --git a/src/views/streams/components/top-zappers.tsx b/src/views/streams/components/top-zappers.tsx index 42978a721..4f8586ac0 100644 --- a/src/views/streams/components/top-zappers.tsx +++ b/src/views/streams/components/top-zappers.tsx @@ -2,7 +2,7 @@ import { useMemo } from "react"; import { Flex, FlexProps, Text } from "@chakra-ui/react"; import { parseZapEvent } from "../../../helpers/nostr/zaps"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import { LightningIcon } from "../../../components/icons"; import { readablizeSats } from "../../../helpers/bolt11"; import useStreamChatTimeline from "../stream/stream-chat/use-stream-chat-timeline"; diff --git a/src/views/streams/stream/index.tsx b/src/views/streams/stream/index.tsx index 9817f0d7a..6a02eda73 100644 --- a/src/views/streams/stream/index.tsx +++ b/src/views/streams/stream/index.tsx @@ -26,7 +26,7 @@ import { unique } from "../../../helpers/array"; import { LiveVideoPlayer } from "../../../components/live-video-player"; import StreamChat, { ChatDisplayMode } from "./stream-chat"; import UserAvatarLink from "../../../components/user-avatar-link"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import StreamSummaryContent from "../components/stream-summary-content"; import { ChevronLeftIcon, ExternalLinkIcon } from "../../../components/icons"; import useSetColorMode from "../../../hooks/use-set-color-mode"; diff --git a/src/views/streams/stream/stream-chat/chat-message.tsx b/src/views/streams/stream/stream-chat/chat-message.tsx index 59a8146ed..5f269d8be 100644 --- a/src/views/streams/stream/stream-chat/chat-message.tsx +++ b/src/views/streams/stream/stream-chat/chat-message.tsx @@ -3,7 +3,7 @@ import { Box, Text } from "@chakra-ui/react"; import { ParsedStream } from "../../../../helpers/nostr/stream"; import UserAvatar from "../../../../components/user-avatar"; -import { UserLink } from "../../../../components/user-link"; +import UserLink from "../../../../components/user-link"; import { NostrEvent } from "../../../../types/nostr-event"; import { useRegisterIntersectionEntity } from "../../../../providers/intersection-observer"; import { TrustProvider } from "../../../../providers/trust"; diff --git a/src/views/streams/stream/stream-chat/zap-message.tsx b/src/views/streams/stream/stream-chat/zap-message.tsx index 90a33cd24..53996f363 100644 --- a/src/views/streams/stream/stream-chat/zap-message.tsx +++ b/src/views/streams/stream/stream-chat/zap-message.tsx @@ -3,7 +3,7 @@ import { Box, Flex, Text } from "@chakra-ui/react"; import { ParsedStream } from "../../../../helpers/nostr/stream"; import UserAvatar from "../../../../components/user-avatar"; -import { UserLink } from "../../../../components/user-link"; +import UserLink from "../../../../components/user-link"; import { NostrEvent } from "../../../../types/nostr-event"; import { useRegisterIntersectionEntity } from "../../../../providers/intersection-observer"; import { LightningIcon } from "../../../../components/icons"; diff --git a/src/views/tools/network.tsx b/src/views/tools/network.tsx index 13341c29c..1d612ee13 100644 --- a/src/views/tools/network.tsx +++ b/src/views/tools/network.tsx @@ -5,7 +5,7 @@ import useCurrentAccount from "../../hooks/use-current-account"; import RequireCurrentAccount from "../../providers/require-current-account"; import { useNetworkConnectionCount } from "../../hooks/use-user-network"; import UserAvatarLink from "../../components/user-avatar-link"; -import { UserLink } from "../../components/user-link"; +import UserLink from "../../components/user-link"; import { ChevronLeftIcon } from "../../components/icons"; import { useNavigate } from "react-router-dom"; import VerticalPageLayout from "../../components/vertical-page-layout"; diff --git a/src/views/tools/stream-moderation/users-card.tsx b/src/views/tools/stream-moderation/users-card.tsx index c1ca20773..36a5dab78 100644 --- a/src/views/tools/stream-moderation/users-card.tsx +++ b/src/views/tools/stream-moderation/users-card.tsx @@ -6,7 +6,7 @@ import useSubject from "../../../hooks/use-subject"; import useCurrentAccount from "../../../hooks/use-current-account"; import useStreamChatTimeline from "../../streams/stream/stream-chat/use-stream-chat-timeline"; import UserAvatar from "../../../components/user-avatar"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import useUserMuteFunctions from "../../../hooks/use-user-mute-functions"; import { useMuteModalContext } from "../../../providers/mute-modal-provider"; import useUserMuteList from "../../../hooks/use-user-mute-list"; diff --git a/src/views/torrents/components/torrent-table-row.tsx b/src/views/torrents/components/torrent-table-row.tsx index aeab3ce4f..de60507f4 100644 --- a/src/views/torrents/components/torrent-table-row.tsx +++ b/src/views/torrents/components/torrent-table-row.tsx @@ -5,7 +5,7 @@ import { Link as RouterLink, useLocation } from "react-router-dom"; import { getTorrentMagnetLink, getTorrentSize, getTorrentTitle } from "../../../helpers/nostr/torrents"; import { NostrEvent } from "../../../types/nostr-event"; import Timestamp from "../../../components/timestamp"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import Magnet from "../../../components/icons/magnet"; import { getNeventForEventId } from "../../../helpers/nip19"; import { useRegisterIntersectionEntity } from "../../../providers/intersection-observer"; diff --git a/src/views/torrents/components/torrents-comments.tsx b/src/views/torrents/components/torrents-comments.tsx index f867d35ad..1b76dd7de 100644 --- a/src/views/torrents/components/torrents-comments.tsx +++ b/src/views/torrents/components/torrents-comments.tsx @@ -21,7 +21,7 @@ import { } from "@chakra-ui/react"; import useClientSideMuteFilter from "../../../hooks/use-client-side-mute-filter"; import UserAvatarLink from "../../../components/user-avatar-link"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import { UserDnsIdentityIcon } from "../../../components/user-dns-identity-icon"; import Timestamp from "../../../components/timestamp"; import Minus from "../../../components/icons/minus"; diff --git a/src/views/torrents/torrent.tsx b/src/views/torrents/torrent.tsx index 1322f44f0..f7a32c187 100644 --- a/src/views/torrents/torrent.tsx +++ b/src/views/torrents/torrent.tsx @@ -27,7 +27,7 @@ import VerticalPageLayout from "../../components/vertical-page-layout"; import { NostrEvent } from "../../types/nostr-event"; import { ErrorBoundary } from "../../components/error-boundary"; import UserAvatarLink from "../../components/user-avatar-link"; -import { UserLink } from "../../components/user-link"; +import UserLink from "../../components/user-link"; import { TORRENT_COMMENT_KIND, getTorrentFiles, diff --git a/src/views/user/about/user-profile-badges.tsx b/src/views/user/about/user-profile-badges.tsx index e3b96613c..46428eaf4 100644 --- a/src/views/user/about/user-profile-badges.tsx +++ b/src/views/user/about/user-profile-badges.tsx @@ -24,7 +24,7 @@ import { getEventCoordinate } from "../../../helpers/nostr/events"; import { NostrEvent } from "../../../types/nostr-event"; import { getSharableEventAddress } from "../../../helpers/nip19"; import UserAvatarLink from "../../../components/user-avatar-link"; -import { UserLink } from "../../../components/user-link"; +import UserLink from "../../../components/user-link"; import Timestamp from "../../../components/timestamp"; import { useState } from "react"; diff --git a/src/views/user/dms.tsx b/src/views/user/dms.tsx index 9f27b63a7..760d89827 100644 --- a/src/views/user/dms.tsx +++ b/src/views/user/dms.tsx @@ -12,7 +12,7 @@ import VerticalPageLayout from "../../components/vertical-page-layout"; import TimelineActionAndStatus from "../../components/timeline-page/timeline-action-and-status"; import { NostrEvent, isPTag } from "../../types/nostr-event"; import UserAvatarLink from "../../components/user-avatar-link"; -import { UserLink } from "../../components/user-link"; +import UserLink from "../../components/user-link"; import ArrowRight from "../../components/icons/arrow-right"; import { AtIcon } from "../../components/icons"; import Timestamp from "../../components/timestamp"; diff --git a/src/views/user/followers.tsx b/src/views/user/followers.tsx index a882049bd..55cf586d6 100644 --- a/src/views/user/followers.tsx +++ b/src/views/user/followers.tsx @@ -10,7 +10,7 @@ import IntersectionObserverProvider, { useRegisterIntersectionEntity } from "../ import TimelineActionAndStatus from "../../components/timeline-page/timeline-action-and-status"; import { useMemo, useRef } from "react"; import { getEventUID } from "../../helpers/nostr/events"; -import { UserLink } from "../../components/user-link"; +import UserLink from "../../components/user-link"; import UserAvatarLink from "../../components/user-avatar-link"; function FollowerItem({ event }: { event: Event }) { diff --git a/src/views/user/muted-by.tsx b/src/views/user/muted-by.tsx index 1756056c2..378fd3ce5 100644 --- a/src/views/user/muted-by.tsx +++ b/src/views/user/muted-by.tsx @@ -3,7 +3,7 @@ import { Flex, Heading, Link, SimpleGrid } from "@chakra-ui/react"; import { Link as RouterLink, useOutletContext } from "react-router-dom"; import UserAvatarLink from "../../components/user-avatar-link"; -import { UserLink } from "../../components/user-link"; +import UserLink from "../../components/user-link"; import useTimelineLoader from "../../hooks/use-timeline-loader"; import { useReadRelayUrls } from "../../hooks/use-client-relays"; import { MUTE_LIST_KIND, PEOPLE_LIST_KIND, getListName, getPubkeysFromList } from "../../helpers/nostr/lists"; diff --git a/src/views/user/reactions.tsx b/src/views/user/reactions.tsx index e67296d4c..00830995f 100644 --- a/src/views/user/reactions.tsx +++ b/src/views/user/reactions.tsx @@ -13,7 +13,7 @@ import IntersectionObserverProvider, { useRegisterIntersectionEntity } from "../ import { useTimelineCurserIntersectionCallback } from "../../hooks/use-timeline-cursor-intersection-callback"; import { TrustProvider } from "../../providers/trust"; import UserAvatar from "../../components/user-avatar"; -import { UserLink } from "../../components/user-link"; +import UserLink from "../../components/user-link"; import NoteMenu from "../../components/note/note-menu"; import { EmbedEventPointer } from "../../components/embed-event"; import { embedEmoji } from "../../components/embed-types"; diff --git a/src/views/user/reports.tsx b/src/views/user/reports.tsx index 509ebb9b9..1372574a8 100644 --- a/src/views/user/reports.tsx +++ b/src/views/user/reports.tsx @@ -4,7 +4,7 @@ import { useOutletContext } from "react-router-dom"; import { Kind } from "nostr-tools"; import { NoteLink } from "../../components/note-link"; -import { UserLink } from "../../components/user-link"; +import UserLink from "../../components/user-link"; import { filterTagsByContentRefs, getEventUID } from "../../helpers/nostr/events"; import useTimelineLoader from "../../hooks/use-timeline-loader"; import { isETag, isPTag, NostrEvent } from "../../types/nostr-event"; diff --git a/src/views/user/zaps.tsx b/src/views/user/zaps.tsx index 07020c370..5e2404ce3 100644 --- a/src/views/user/zaps.tsx +++ b/src/views/user/zaps.tsx @@ -7,7 +7,7 @@ import { ErrorBoundary, ErrorFallback } from "../../components/error-boundary"; import { LightningIcon } from "../../components/icons"; import { NoteLink } from "../../components/note-link"; import UserAvatarLink from "../../components/user-avatar-link"; -import { UserLink } from "../../components/user-link"; +import UserLink from "../../components/user-link"; import { readablizeSats } from "../../helpers/bolt11"; import { isProfileZap, isNoteZap, parseZapEvent, totalZaps } from "../../helpers/nostr/zaps"; import useTimelineLoader from "../../hooks/use-timeline-loader";