diff --git a/src/components/ContactViewer.tsx b/src/components/ContactViewer.tsx index d80e542..7012e48 100644 --- a/src/components/ContactViewer.tsx +++ b/src/components/ContactViewer.tsx @@ -56,6 +56,7 @@ export function ContactViewer(props: { showToast(result.error); return; } else { + result.value.privateTag = props.contact.name; if ( result.value?.address || result.value?.invoice || diff --git a/src/components/NostrActivity.tsx b/src/components/NostrActivity.tsx index 3395f1f..58d3488 100644 --- a/src/components/NostrActivity.tsx +++ b/src/components/NostrActivity.tsx @@ -6,9 +6,11 @@ import { Show, Switch } from "solid-js"; +import { Dynamic } from "solid-js/web"; import rightArrow from "~/assets/icons/right-arrow.svg"; -import { AmountSats, VStack } from "~/components"; +import { AmountSats, TinyText, VStack } from "~/components"; +import { useI18n } from "~/i18n/context"; import { useMegaStore } from "~/state/megaStore"; import { fetchZaps, getHexpubFromNpub } from "~/utils"; import { timeAgo } from "~/utils/prettyPrintTime"; @@ -31,6 +33,7 @@ function formatProfileLink(hexpub: string): string { } export function NostrActivity() { + const i18n = useI18n(); const [state, _actions] = useMegaStore(); const [data, { refetch }] = createResource(state.npub, fetchZaps); @@ -93,10 +96,10 @@ export function NostrActivity() { - Private + {i18n.t("activity.private")} - Anonymous + {i18n.t("activity.anonymous")} @@ -151,10 +154,36 @@ export function NostrActivity() {
-

+ + + {zap.content?.includes("From:") + ? `${i18n.t( + "activity.from" + )} ${zap.content?.split("nostr:")[1]}` + : zap.content} + + )} diff --git a/src/components/TagEditor.tsx b/src/components/TagEditor.tsx index e348be1..09372e5 100644 --- a/src/components/TagEditor.tsx +++ b/src/components/TagEditor.tsx @@ -16,6 +16,7 @@ export function TagEditor(props: { selectedValues: Partial[]; setSelectedValues: (value: Partial[]) => void; placeholder: string; + autoFillTag?: string | undefined; }) { const [_state, actions] = useMegaStore(); const [availableTags, setAvailableTags] = createSignal([]); @@ -28,12 +29,24 @@ export function TagEditor(props: { .filter((tag) => tag.kind === "Contact") .sort(sortByLastUsed) ); + if (props.autoFillTag && availableTags()) { + const tagToAutoSelect = availableTags().find( + (tag) => tag.name === props.autoFillTag + ); + if (tagToAutoSelect) { + props.setSelectedValues([ + ...props.selectedValues, + tagToAutoSelect + ]); + } + } } }); const selectProps = createMemo(() => { return createOptions(availableTags() || [], { key: "name", + disable: (value) => props.selectedValues.includes(value), filterable: true, // Default createable: createLabelValue }); @@ -42,8 +55,6 @@ export function TagEditor(props: { const onChange = (selected: MutinyTagItem[]) => { props.setSelectedValues(selected); - console.log(selected); - const lastValue = selected[selected.length - 1]; if ( lastValue && @@ -54,7 +65,6 @@ export function TagEditor(props: { } }; - // FIXME: eslint is mad about reactivity const onTagTap = (tag: MutinyTagItem) => { props.setSelectedValues([...props.selectedValues!, tag]); }; @@ -70,10 +80,16 @@ export function TagEditor(props: { />

0}> - + {(tag) => ( - // eslint-disable-next-line solid/reactivity - onTagTap(tag)}> + )} diff --git a/src/components/layout/Misc.tsx b/src/components/layout/Misc.tsx index 366ae52..2b9b670 100644 --- a/src/components/layout/Misc.tsx +++ b/src/components/layout/Misc.tsx @@ -258,6 +258,7 @@ export const TinyText: ParentComponent = (props) => { export const TinyButton: ParentComponent<{ onClick: () => void; tag?: MutinyTagItem; + hidden?: boolean; }> = (props) => { // TODO: don't need to run this if it's not a contact const [gradient] = createResource(async () => { @@ -272,6 +273,7 @@ export const TinyButton: ParentComponent<{ return (