mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2025-12-18 14:54:26 +01:00
remove: recommended tags in preparation for select redesign
This commit is contained in:
@@ -6,10 +6,9 @@ import {
|
||||
Show,
|
||||
Switch
|
||||
} from "solid-js";
|
||||
import { Dynamic } from "solid-js/web";
|
||||
|
||||
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 { useMegaStore } from "~/state/megaStore";
|
||||
import { fetchZaps, getHexpubFromNpub } from "~/utils";
|
||||
@@ -154,36 +153,10 @@ export function NostrActivity() {
|
||||
</div>
|
||||
<Show when={zap.content}>
|
||||
<hr class="my-2 border-m-grey-750" />
|
||||
<TinyText>
|
||||
<Dynamic
|
||||
component={
|
||||
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>
|
||||
<p
|
||||
class="truncate text-center text-sm font-light text-neutral-200"
|
||||
textContent={zap.content}
|
||||
/>
|
||||
</Show>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -2,9 +2,8 @@ import { createOptions, Select } from "@thisbeyond/solid-select";
|
||||
|
||||
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 { MutinyTagItem, sortByLastUsed } from "~/utils";
|
||||
|
||||
@@ -65,12 +64,8 @@ export function TagEditor(props: {
|
||||
}
|
||||
};
|
||||
|
||||
const onTagTap = (tag: MutinyTagItem) => {
|
||||
props.setSelectedValues([...props.selectedValues!, tag]);
|
||||
};
|
||||
|
||||
return (
|
||||
<div class="flex flex-1 flex-shrink flex-col gap-2">
|
||||
<>
|
||||
<Select
|
||||
multiple
|
||||
initialValue={props.selectedValues}
|
||||
@@ -78,24 +73,6 @@ export function TagEditor(props: {
|
||||
onChange={onChange}
|
||||
{...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>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -258,7 +258,6 @@ 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 () => {
|
||||
@@ -273,7 +272,6 @@ export const TinyButton: ParentComponent<{
|
||||
return (
|
||||
<button
|
||||
class="rounded-lg bg-white/10 px-2 py-1"
|
||||
classList={{ hidden: props.hidden }}
|
||||
onClick={() => props.onClick()}
|
||||
style={{ background: bg() }}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user