final
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
useEffect,
|
||||
useState,
|
||||
} from "react";
|
||||
import { toast } from "sonner";
|
||||
|
||||
type ColumnContext = {
|
||||
columns: IColumn[];
|
||||
@@ -52,6 +53,11 @@ export function ColumnProvider({ children }: { children: ReactNode }) {
|
||||
}, []);
|
||||
|
||||
const removeColumn = useCallback(async (id: number) => {
|
||||
if (id === 9998 || id === 9999) {
|
||||
toast.info("You cannot remove default column");
|
||||
return;
|
||||
}
|
||||
|
||||
await storage.removeColumn(id);
|
||||
setColumns((prev) => prev.filter((t) => t.id !== id));
|
||||
}, []);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { NOSTR_MENTIONS } from "@lume/utils";
|
||||
import { nanoid } from "nanoid";
|
||||
import { nip19 } from "nostr-tools";
|
||||
import { ReactNode, useMemo } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
@@ -33,13 +34,10 @@ export function NoteChild({
|
||||
try {
|
||||
if (hashtags.length) {
|
||||
for (const hashtag of hashtags) {
|
||||
parsedContent = reactStringReplace(
|
||||
parsedContent,
|
||||
hashtag,
|
||||
(match, i) => {
|
||||
return <Hashtag key={match + i} tag={hashtag} />;
|
||||
},
|
||||
);
|
||||
const regex = new RegExp(`(|^)${hashtag}\\b`, "g");
|
||||
parsedContent = reactStringReplace(parsedContent, regex, () => {
|
||||
return <Hashtag key={nanoid()} tag={hashtag} />;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,15 +126,12 @@ export function NoteContent({
|
||||
|
||||
if (hashtags.length) {
|
||||
for (const hashtag of hashtags) {
|
||||
parsedContent = reactStringReplace(
|
||||
parsedContent,
|
||||
hashtag,
|
||||
(match, i) => {
|
||||
if (storage.settings.hashtag)
|
||||
return <Hashtag key={match + i} tag={hashtag} />;
|
||||
return null;
|
||||
},
|
||||
);
|
||||
const regex = new RegExp(`(|^)${hashtag}\\b`, "g");
|
||||
parsedContent = reactStringReplace(parsedContent, regex, () => {
|
||||
if (storage.settings.hashtag)
|
||||
return <Hashtag key={nanoid()} tag={hashtag} />;
|
||||
return null;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export function ImagePreview({ url }: { url: string }) {
|
||||
|
||||
const downloadDirPath = await downloadDir();
|
||||
const filename = url.substring(url.lastIndexOf("/") + 1);
|
||||
await download(url, downloadDirPath + `/${filename}`);
|
||||
await download(url, `${downloadDirPath}/${filename}`);
|
||||
|
||||
setDownloaded(true);
|
||||
} catch (e) {
|
||||
@@ -35,7 +35,7 @@ export function ImagePreview({ url }: { url: string }) {
|
||||
|
||||
return (
|
||||
// biome-ignore lint/a11y/useKeyWithClickEvents: <explanation>
|
||||
<div onClick={open} className="relative my-1 group">
|
||||
<div onClick={open} className="relative mt-1 mb-2.5 group">
|
||||
<img
|
||||
src={url}
|
||||
alt={url}
|
||||
@@ -43,7 +43,7 @@ export function ImagePreview({ url }: { url: string }) {
|
||||
decoding="async"
|
||||
style={{ contentVisibility: "auto" }}
|
||||
onError={fallback}
|
||||
className="object-cover w-full h-auto border rounded-lg border-neutral-200/50 dark:border-neutral-800/50"
|
||||
className="object-cover w-full h-auto border rounded-xl border-neutral-200/50 dark:border-neutral-800/50"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -11,7 +11,7 @@ export function LinkPreview({ url }: { url: string }) {
|
||||
|
||||
if (status === "pending") {
|
||||
return (
|
||||
<div className="flex flex-col w-full my-1 rounded-lg overflow-hidden bg-neutral-100 dark:bg-neutral-900 border border-black/5 dark:border-white/5">
|
||||
<div className="flex flex-col w-full mt-1 mb-2.5 rounded-xl overflow-hidden bg-neutral-100 dark:bg-neutral-900 border border-black/5 dark:border-white/5">
|
||||
<div className="w-full h-48 animate-pulse bg-neutral-300 dark:bg-neutral-700" />
|
||||
<div className="flex flex-col gap-2 px-3 py-3">
|
||||
<div className="w-2/3 h-3 rounded animate-pulse bg-neutral-300 dark:bg-neutral-700" />
|
||||
@@ -42,7 +42,7 @@ export function LinkPreview({ url }: { url: string }) {
|
||||
to={url}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="flex flex-col w-full my-1 overflow-hidden rounded-lg bg-neutral-100 dark:bg-neutral-900 border border-black/5 dark:border-white/5"
|
||||
className="flex flex-col w-full mt-1 mb-2.5 overflow-hidden rounded-xl bg-neutral-100 dark:bg-neutral-900 border border-black/5 dark:border-white/5"
|
||||
>
|
||||
{isImage(data.image) ? (
|
||||
<img
|
||||
@@ -53,8 +53,8 @@ export function LinkPreview({ url }: { url: string }) {
|
||||
className="object-cover w-full h-48 bg-white rounded-t-lg"
|
||||
/>
|
||||
) : null}
|
||||
<div className="flex flex-col items-start px-3 py-3">
|
||||
<div className="flex flex-col items-start gap-1 text-left">
|
||||
<div className="flex flex-col items-start p-3">
|
||||
<div className="flex flex-col items-start text-left">
|
||||
{data.title ? (
|
||||
<div className="text-base font-semibold break-p text-neutral-900 dark:text-neutral-100">
|
||||
{data.title}
|
||||
@@ -66,7 +66,7 @@ export function LinkPreview({ url }: { url: string }) {
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
<div className="text-sm break-all text-neutral-600 dark:text-neutral-400">
|
||||
<div className="text-sm break-all text-blue-500 font-semibold">
|
||||
{domain.hostname}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
|
||||
export function VideoPreview({ url }: { url: string }) {
|
||||
return (
|
||||
<div className="my-1 w-full rounded-lg overflow-hidden">
|
||||
<div className="mt-1 mb-2.5 w-full rounded-xl overflow-hidden">
|
||||
<MediaController>
|
||||
<video
|
||||
slot="media"
|
||||
|
||||
Reference in New Issue
Block a user