mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-27 12:07:43 +02:00
remove astral link
This commit is contained in:
@@ -1,12 +1,10 @@
|
|||||||
import { createIcon, IconProps } from "@chakra-ui/icons";
|
import { createIcon, IconProps } from "@chakra-ui/icons";
|
||||||
|
|
||||||
import astralIcon from "./icons/astral.png";
|
|
||||||
import nostrGuruIcon from "./icons/nostr-guru.jpg";
|
import nostrGuruIcon from "./icons/nostr-guru.jpg";
|
||||||
import brbIcon from "./icons/brb.png";
|
import brbIcon from "./icons/brb.png";
|
||||||
import snortSocialIcon from "./icons/snort-social.png";
|
import snortSocialIcon from "./icons/snort-social.png";
|
||||||
|
|
||||||
export const IMAGE_ICONS = {
|
export const IMAGE_ICONS = {
|
||||||
astralIcon,
|
|
||||||
nostrGuruIcon,
|
nostrGuruIcon,
|
||||||
brbIcon,
|
brbIcon,
|
||||||
snortSocialIcon,
|
snortSocialIcon,
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 12 KiB |
@@ -38,14 +38,6 @@ export const NoteMenu = ({ event }: { event: NostrEvent }) => {
|
|||||||
>
|
>
|
||||||
Open in Nostr.guru
|
Open in Nostr.guru
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
|
||||||
as="a"
|
|
||||||
icon={<Avatar src={IMAGE_ICONS.astralIcon} size="xs" />}
|
|
||||||
href={`https://astral.ninja/${noteId}`}
|
|
||||||
target="_blank"
|
|
||||||
>
|
|
||||||
Open in astral
|
|
||||||
</MenuItem>
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
as="a"
|
as="a"
|
||||||
icon={<Avatar src={IMAGE_ICONS.brbIcon} size="xs" />}
|
icon={<Avatar src={IMAGE_ICONS.brbIcon} size="xs" />}
|
||||||
|
@@ -1,24 +1,5 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import {
|
import { Avatar, Button, Container, Flex, Heading, IconButton, LinkOverlay, Text, VStack } from "@chakra-ui/react";
|
||||||
Avatar,
|
|
||||||
Button,
|
|
||||||
Container,
|
|
||||||
Flex,
|
|
||||||
Heading,
|
|
||||||
IconButton,
|
|
||||||
LinkOverlay,
|
|
||||||
Text,
|
|
||||||
VStack,
|
|
||||||
Menu,
|
|
||||||
MenuButton,
|
|
||||||
MenuList,
|
|
||||||
MenuItem,
|
|
||||||
MenuItemOption,
|
|
||||||
MenuGroup,
|
|
||||||
MenuOptionGroup,
|
|
||||||
MenuDivider,
|
|
||||||
Box,
|
|
||||||
} from "@chakra-ui/react";
|
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { Link, useNavigate } from "react-router-dom";
|
||||||
import { FeedIcon, LogoutIcon, NotificationIcon, ProfileIcon, SettingsIcon } from "./icons";
|
import { FeedIcon, LogoutIcon, NotificationIcon, ProfileIcon, SettingsIcon } from "./icons";
|
||||||
import { ErrorBoundary } from "./error-boundary";
|
import { ErrorBoundary } from "./error-boundary";
|
||||||
@@ -31,28 +12,15 @@ import { ReloadPrompt } from "./reload-prompt";
|
|||||||
import { PostModalProvider } from "../providers/post-modal-provider";
|
import { PostModalProvider } from "../providers/post-modal-provider";
|
||||||
import { useReadonlyMode } from "../hooks/use-readonly-mode";
|
import { useReadonlyMode } from "../hooks/use-readonly-mode";
|
||||||
import { ProfileButton } from "./profile-button";
|
import { ProfileButton } from "./profile-button";
|
||||||
import { UserAvatar } from "./user-avatar";
|
|
||||||
import useSubject from "../hooks/use-subject";
|
import useSubject from "../hooks/use-subject";
|
||||||
|
import { UserAvatarLink } from "./user-avatar-link";
|
||||||
|
|
||||||
const MobileProfileHeader = () => {
|
const MobileProfileHeader = () => {
|
||||||
const navigate = useNavigate();
|
|
||||||
const pubkey = useSubject(identity.pubkey);
|
const pubkey = useSubject(identity.pubkey);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex justifyContent="space-between" px="2" pt="2">
|
<Flex justifyContent="space-between" px="2" pt="2">
|
||||||
<Menu>
|
<UserAvatarLink pubkey={pubkey} size="sm" />
|
||||||
<MenuButton as={Box}>
|
|
||||||
<UserAvatar pubkey={pubkey} size="sm" />
|
|
||||||
</MenuButton>
|
|
||||||
<MenuList>
|
|
||||||
<MenuItem icon={<ProfileIcon />} as={Link} to={`/u/${pubkey}`}>
|
|
||||||
Profile
|
|
||||||
</MenuItem>
|
|
||||||
<MenuItem icon={<LogoutIcon />} onClick={() => identity.logout()}>
|
|
||||||
Logout
|
|
||||||
</MenuItem>
|
|
||||||
</MenuList>
|
|
||||||
</Menu>
|
|
||||||
<IconButton
|
<IconButton
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
icon={<NotificationIcon />}
|
icon={<NotificationIcon />}
|
||||||
|
@@ -30,7 +30,7 @@ import settings from "../../services/settings";
|
|||||||
import { clearCacheData, deleteDatabase } from "../../services/db";
|
import { clearCacheData, deleteDatabase } from "../../services/db";
|
||||||
import { RelayUrlInput } from "../../components/relay-url-input";
|
import { RelayUrlInput } from "../../components/relay-url-input";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useAsyncFn } from "react-use";
|
import identity from "../../services/identity";
|
||||||
|
|
||||||
export const SettingsView = () => {
|
export const SettingsView = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@@ -210,6 +210,9 @@ export const SettingsView = () => {
|
|||||||
</AccordionPanel>
|
</AccordionPanel>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
<Flex gap="2">
|
||||||
|
<Button onClick={() => identity.logout()}>Logout</Button>
|
||||||
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@@ -31,14 +31,6 @@ export const UserProfileMenu = ({ pubkey, ...props }: { pubkey: string } & Omit<
|
|||||||
>
|
>
|
||||||
Open in Nostr.guru
|
Open in Nostr.guru
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
|
||||||
as="a"
|
|
||||||
icon={<Avatar src={IMAGE_ICONS.astralIcon} size="xs" />}
|
|
||||||
href={`https://astral.ninja/${npub}`}
|
|
||||||
target="_blank"
|
|
||||||
>
|
|
||||||
Open in astral
|
|
||||||
</MenuItem>
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
as="a"
|
as="a"
|
||||||
icon={<Avatar src={IMAGE_ICONS.brbIcon} size="xs" />}
|
icon={<Avatar src={IMAGE_ICONS.brbIcon} size="xs" />}
|
||||||
|
@@ -24,8 +24,9 @@ import { UserTipButton } from "../../components/user-tip-button";
|
|||||||
import { UserDnsIdentityIcon } from "../../components/user-dns-identity";
|
import { UserDnsIdentityIcon } from "../../components/user-dns-identity";
|
||||||
import { truncatedId } from "../../helpers/nostr-event";
|
import { truncatedId } from "../../helpers/nostr-event";
|
||||||
import { Bech32Prefix, normalizeToBech32 } from "../../helpers/nip-19";
|
import { Bech32Prefix, normalizeToBech32 } from "../../helpers/nip-19";
|
||||||
import { KeyIcon } from "../../components/icons";
|
import { KeyIcon, SettingsIcon } from "../../components/icons";
|
||||||
import { CopyIconButton } from "../../components/copy-icon-button";
|
import { CopyIconButton } from "../../components/copy-icon-button";
|
||||||
|
import identity from "../../services/identity";
|
||||||
|
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{ label: "Notes", path: "notes" },
|
{ label: "Notes", path: "notes" },
|
||||||
@@ -47,6 +48,7 @@ const UserView = () => {
|
|||||||
|
|
||||||
const metadata = useUserMetadata(pubkey, [], true);
|
const metadata = useUserMetadata(pubkey, [], true);
|
||||||
const npub = normalizeToBech32(pubkey, Bech32Prefix.Pubkey);
|
const npub = normalizeToBech32(pubkey, Bech32Prefix.Pubkey);
|
||||||
|
const isSelf = pubkey === identity.pubkey.value;
|
||||||
|
|
||||||
const header = (
|
const header = (
|
||||||
<Flex direction="column" gap="2" px="2" pt="2">
|
<Flex direction="column" gap="2" px="2" pt="2">
|
||||||
@@ -58,15 +60,15 @@ const UserView = () => {
|
|||||||
<Heading size={isMobile ? "md" : "lg"}>{getUserDisplayName(metadata, pubkey)}</Heading>
|
<Heading size={isMobile ? "md" : "lg"}>{getUserDisplayName(metadata, pubkey)}</Heading>
|
||||||
<UserDnsIdentityIcon pubkey={pubkey} />
|
<UserDnsIdentityIcon pubkey={pubkey} />
|
||||||
</Flex>
|
</Flex>
|
||||||
<ButtonGroup>
|
<Flex gap="2">
|
||||||
<UserTipButton pubkey={pubkey} size="xs" />
|
<UserTipButton pubkey={pubkey} size="xs" />
|
||||||
<UserProfileMenu pubkey={pubkey} />
|
<UserProfileMenu pubkey={pubkey} />
|
||||||
</ButtonGroup>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
{!metadata ? <SkeletonText /> : <Text>{metadata?.about}</Text>}
|
{!metadata ? <SkeletonText /> : <Text>{metadata?.about}</Text>}
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Flex wrap="wrap" gap={isMobile ? "0" : "4"}>
|
<Flex wrap="wrap" gap="2">
|
||||||
{metadata?.website && (
|
{metadata?.website && (
|
||||||
<Text>
|
<Text>
|
||||||
<LinkIcon />{" "}
|
<LinkIcon />{" "}
|
||||||
@@ -79,11 +81,20 @@ const UserView = () => {
|
|||||||
<KeyIcon /> {truncatedId(npub ?? "", 10)}{" "}
|
<KeyIcon /> {truncatedId(npub ?? "", 10)}{" "}
|
||||||
<CopyIconButton text={npub ?? ""} title="Copy npub" aria-label="Copy npub" />
|
<CopyIconButton text={npub ?? ""} title="Copy npub" aria-label="Copy npub" />
|
||||||
</Text>
|
</Text>
|
||||||
<ButtonGroup ml="auto">
|
<Flex gap="2" ml="auto">
|
||||||
|
{isMobile && isSelf && (
|
||||||
|
<IconButton
|
||||||
|
icon={<SettingsIcon />}
|
||||||
|
aria-label="Settings"
|
||||||
|
title="Settings"
|
||||||
|
size="sm"
|
||||||
|
onClick={() => navigate("/settings")}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<Button colorScheme="brand" size="sm">
|
<Button colorScheme="brand" size="sm">
|
||||||
Follow
|
Follow
|
||||||
</Button>
|
</Button>
|
||||||
</ButtonGroup>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
@@ -101,7 +112,7 @@ const UserView = () => {
|
|||||||
index={activeTab}
|
index={activeTab}
|
||||||
onChange={(v) => navigate(tabs[v].path)}
|
onChange={(v) => navigate(tabs[v].path)}
|
||||||
>
|
>
|
||||||
<TabList overflowY="auto">
|
<TabList overflowX="auto" overflowY="hidden" flexShrink={0}>
|
||||||
{tabs.map(({ label }) => (
|
{tabs.map(({ label }) => (
|
||||||
<Tab key={label}>{label}</Tab>
|
<Tab key={label}>{label}</Tab>
|
||||||
))}
|
))}
|
||||||
|
Reference in New Issue
Block a user