remove: recommended tags in preparation for select redesign

This commit is contained in:
benalleng
2023-09-21 09:21:47 -04:00
committed by Paul Miller
parent fa1dab3eb4
commit 414671acce
3 changed files with 8 additions and 60 deletions

View File

@@ -6,10 +6,9 @@ import {
Show, Show,
Switch Switch
} from "solid-js"; } from "solid-js";
import { Dynamic } from "solid-js/web";
import rightArrow from "~/assets/icons/right-arrow.svg"; import rightArrow from "~/assets/icons/right-arrow.svg";
import { AmountSats, TinyText, VStack } from "~/components"; import { AmountSats, VStack } from "~/components";
import { useI18n } from "~/i18n/context"; import { useI18n } from "~/i18n/context";
import { useMegaStore } from "~/state/megaStore"; import { useMegaStore } from "~/state/megaStore";
import { fetchZaps, getHexpubFromNpub } from "~/utils"; import { fetchZaps, getHexpubFromNpub } from "~/utils";
@@ -154,36 +153,10 @@ export function NostrActivity() {
</div> </div>
<Show when={zap.content}> <Show when={zap.content}>
<hr class="my-2 border-m-grey-750" /> <hr class="my-2 border-m-grey-750" />
<TinyText> <p
<Dynamic class="truncate text-center text-sm font-light text-neutral-200"
component={ textContent={zap.content}
zap.content?.includes("From:") || />
zap.content?.includes("://")
? "a"
: "p"
}
href={
zap.content?.split("nostr:")[1]
? formatProfileLink(
getHexpubFromNpub(
zap.content?.split(
"nostr:"
)[1]
) ?? ""
)
: zap.content
}
class="block truncate text-center text-sm font-light text-neutral-200"
target="_blank"
rel="noopener noreferrer"
>
{zap.content?.includes("From:")
? `${i18n.t(
"activity.from"
)} ${zap.content?.split("nostr:")[1]}`
: zap.content}
</Dynamic>
</TinyText>
</Show> </Show>
</div> </div>
)} )}

View File

@@ -2,9 +2,8 @@ import { createOptions, Select } from "@thisbeyond/solid-select";
import "~/styles/solid-select.css"; import "~/styles/solid-select.css";
import { createMemo, createSignal, For, onMount, Show } from "solid-js"; import { createMemo, createSignal, onMount } from "solid-js";
import { TinyButton } from "~/components";
import { useMegaStore } from "~/state/megaStore"; import { useMegaStore } from "~/state/megaStore";
import { MutinyTagItem, sortByLastUsed } from "~/utils"; import { MutinyTagItem, sortByLastUsed } from "~/utils";
@@ -65,12 +64,8 @@ export function TagEditor(props: {
} }
}; };
const onTagTap = (tag: MutinyTagItem) => {
props.setSelectedValues([...props.selectedValues!, tag]);
};
return ( return (
<div class="flex flex-1 flex-shrink flex-col gap-2"> <>
<Select <Select
multiple multiple
initialValue={props.selectedValues} initialValue={props.selectedValues}
@@ -78,24 +73,6 @@ export function TagEditor(props: {
onChange={onChange} onChange={onChange}
{...selectProps()} {...selectProps()}
/> />
<div class="flex flex-wrap gap-2"> </>
<Show when={availableTags() && availableTags()!.length > 0}>
<For
each={availableTags()!.slice(0, 3).sort(sortByLastUsed)}
>
{(tag) => (
<TinyButton
hidden={props.selectedValues.includes(tag)}
tag={tag}
// eslint-disable-next-line solid/reactivity
onClick={() => onTagTap(tag)}
>
{tag.name}
</TinyButton>
)}
</For>
</Show>
</div>
</div>
); );
} }

View File

@@ -258,7 +258,6 @@ export const TinyText: ParentComponent = (props) => {
export const TinyButton: ParentComponent<{ export const TinyButton: ParentComponent<{
onClick: () => void; onClick: () => void;
tag?: MutinyTagItem; tag?: MutinyTagItem;
hidden?: boolean;
}> = (props) => { }> = (props) => {
// TODO: don't need to run this if it's not a contact // TODO: don't need to run this if it's not a contact
const [gradient] = createResource(async () => { const [gradient] = createResource(async () => {
@@ -273,7 +272,6 @@ export const TinyButton: ParentComponent<{
return ( return (
<button <button
class="rounded-lg bg-white/10 px-2 py-1" class="rounded-lg bg-white/10 px-2 py-1"
classList={{ hidden: props.hidden }}
onClick={() => props.onClick()} onClick={() => props.onClick()}
style={{ background: bg() }} style={{ background: bg() }}
> >