diff --git a/.changeset/curvy-bears-smell.md b/.changeset/curvy-bears-smell.md
new file mode 100644
index 000000000..fb1efc196
--- /dev/null
+++ b/.changeset/curvy-bears-smell.md
@@ -0,0 +1,5 @@
+---
+"nostrudel": patch
+---
+
+Fix storage and clipboard use on http connection
diff --git a/README.md b/README.md
index bbc602d3b..1568d0087 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,7 @@
+
+
+
+
# noStrudel
> NOTE: This client is still in development and will have bugs
diff --git a/dockerfile b/dockerfile
index 07b51c58a..bc325c3f1 100644
--- a/dockerfile
+++ b/dockerfile
@@ -1,11 +1,13 @@
# syntax=docker/dockerfile:1
-FROM node:20
+FROM node:20 as builder
+
WORKDIR /app
COPY . /app/
+
ENV VITE_COMMIT_HASH=""
ENV VITE_APP_VERSION="custom"
RUN yarn install && yarn build
FROM nginx:stable-alpine-slim
EXPOSE 80
-COPY --from=0 /app/dist /usr/share/nginx/html
+COPY --from=builder /app/dist /usr/share/nginx/html
diff --git a/screenshots/icon.svg b/screenshots/icon.svg
new file mode 100644
index 000000000..515b5f592
--- /dev/null
+++ b/screenshots/icon.svg
@@ -0,0 +1,251 @@
+
+
+
+
diff --git a/src/components/common-menu-items/copy-embed-code.tsx b/src/components/common-menu-items/copy-embed-code.tsx
index fad23f13a..4646255a7 100644
--- a/src/components/common-menu-items/copy-embed-code.tsx
+++ b/src/components/common-menu-items/copy-embed-code.tsx
@@ -10,7 +10,7 @@ export default function CopyEmbedCodeMenuItem({ event }: { event: NostrEvent })
return (
address && (
)
);
diff --git a/src/components/common-menu-items/copy-share-link.tsx b/src/components/common-menu-items/copy-share-link.tsx
index 68219f5c1..bc902761b 100644
--- a/src/components/common-menu-items/copy-share-link.tsx
+++ b/src/components/common-menu-items/copy-share-link.tsx
@@ -1,19 +1,24 @@
-import { MenuItem } from "@chakra-ui/react";
+import { MenuItem, useToast } from "@chakra-ui/react";
import { NostrEvent } from "../../types/nostr-event";
import { getSharableEventAddress } from "../../helpers/nip19";
import { ShareIcon } from "../icons";
export default function CopyShareLinkMenuItem({ event }: { event: NostrEvent }) {
+ const toast = useToast();
const address = getSharableEventAddress(event);
return (
address && (
)
);
diff --git a/src/components/copy-icon-button.tsx b/src/components/copy-icon-button.tsx
index 11113b385..ccbbb4524 100644
--- a/src/components/copy-icon-button.tsx
+++ b/src/components/copy-icon-button.tsx
@@ -1,9 +1,10 @@
import { useState } from "react";
-import { IconButton, IconButtonProps } from "@chakra-ui/react";
+import { IconButton, IconButtonProps, useToast } from "@chakra-ui/react";
import { CheckIcon, CopyToClipboardIcon } from "./icons";
export const CopyIconButton = ({ text, ...props }: { text?: string } & Omit) => {
+ const toast = useToast();
const [copied, setCopied] = useState(false);
return (
@@ -14,7 +15,7 @@ export const CopyIconButton = ({ text, ...props }: { text?: string } & Omit setCopied(false), 2000);
- }
+ } else toast({ description: text, isClosable: true, duration: null });
}}
{...props}
/>
diff --git a/src/components/layout/account-switcher.tsx b/src/components/layout/account-switcher.tsx
index 6e074d848..f9b78048e 100644
--- a/src/components/layout/account-switcher.tsx
+++ b/src/components/layout/account-switcher.tsx
@@ -24,8 +24,10 @@ function AccountItem({ account, onClick }: { account: Account; onClick?: () => v
- {getUserDisplayName(metadata, pubkey)}
-
+
+ {getUserDisplayName(metadata, pubkey)}
+
+
}
diff --git a/src/components/version-button.tsx b/src/components/version-button.tsx
index ef119ae37..b38c06b4a 100644
--- a/src/components/version-button.tsx
+++ b/src/components/version-button.tsx
@@ -1,8 +1,9 @@
-import { Button, ButtonProps } from "@chakra-ui/react";
+import { Button, ButtonProps, useToast } from "@chakra-ui/react";
import { CheckIcon, CopyToClipboardIcon } from "./icons";
import { useState } from "react";
export default function VersionButton({ ...props }: Omit) {
+ const toast = useToast();
const [copied, setCopied] = useState(false);
const version = [import.meta.env.VITE_APP_VERSION, import.meta.env.VITE_COMMIT_HASH].filter(Boolean).join("-");
@@ -18,7 +19,7 @@ export default function VersionButton({ ...props }: Omit setCopied(false), 2000);
- }
+ } else toast({ description: version, isClosable: true, duration: null });
}}
{...props}
>
diff --git a/src/services/amber-signer.ts b/src/services/amber-signer.ts
index d92de22cc..8b4e85c4f 100644
--- a/src/services/amber-signer.ts
+++ b/src/services/amber-signer.ts
@@ -34,7 +34,7 @@ function rejectPending() {
function onVisibilityChange() {
if (document.visibilityState === "visible") {
- if (!pendingRequest) return;
+ if (!pendingRequest || !navigator.clipboard) return;
// read the result from the clipboard
setTimeout(() => {
@@ -92,7 +92,7 @@ async function nip04Decrypt(pubkey: string, data: string): Promise {
}
const amberSignerService = {
- supported: navigator.userAgent.includes("Android"),
+ supported: navigator.userAgent.includes("Android") && navigator.clipboard,
getPublicKey,
signEvent,
nip04Encrypt,
diff --git a/src/views/community/components/community-post-menu.tsx b/src/views/community/components/community-post-menu.tsx
index f16f5e1b9..abb1e61c3 100644
--- a/src/views/community/components/community-post-menu.tsx
+++ b/src/views/community/components/community-post-menu.tsx
@@ -1,4 +1,4 @@
-import { MenuItem, useDisclosure } from "@chakra-ui/react";
+import { MenuItem, useDisclosure, useToast } from "@chakra-ui/react";
import { nip19 } from "nostr-tools";
import { CustomMenuIconButton, MenuIconButtonProps } from "../../../components/menu-icon-button";
@@ -14,6 +14,7 @@ export default function CommunityPostMenu({
approvals,
...props
}: Omit & { event: NostrEvent; approvals: NostrEvent[] }) {
+ const toast = useToast();
const debugModal = useDisclosure();
return (
@@ -22,7 +23,11 @@ export default function CommunityPostMenu({
- copyToClipboard("nostr:" + sharableId)} icon={}>
+ {
+ const text = "https://njump.me/" + sharableId;
+ if (navigator.clipboard) navigator.clipboard?.writeText(text);
+ else toast({ description: text, isClosable: true, duration: null });
+ }}
+ icon={}
+ >
Copy share link
+ {
+ const text = "nostr:" + sharableId;
+ if (navigator.clipboard) navigator.clipboard?.writeText(text);
+ else toast({ description: text, isClosable: true, duration: null });
+ }}
+ icon={}
+ >
+ Copy Embed Code
+
}>
View Raw