note creation file reordering
This commit is contained in:
@ -10,7 +10,7 @@ import { removeRelay } from "@/Login";
|
|||||||
import useLogin from "@/Hooks/useLogin";
|
import useLogin from "@/Hooks/useLogin";
|
||||||
import useEventPublisher from "@/Hooks/useEventPublisher";
|
import useEventPublisher from "@/Hooks/useEventPublisher";
|
||||||
import { saveRelays } from "@/Pages/settings/Relays";
|
import { saveRelays } from "@/Pages/settings/Relays";
|
||||||
import { sendEventToRelays } from "@/Element/Event/NoteBroadcaster/util";
|
import { sendEventToRelays } from "@/Element/Event/Create/util";
|
||||||
|
|
||||||
export function NoteBroadcaster({
|
export function NoteBroadcaster({
|
||||||
evs,
|
evs,
|
@ -1,6 +1,6 @@
|
|||||||
import "./NoteCreator.css";
|
import "./NoteCreator.css";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
import { EventKind, NostrPrefix, TaggedNostrEvent, EventBuilder, tryParseNostrLink, NostrLink } from "@snort/system";
|
import { EventBuilder, EventKind, NostrLink, NostrPrefix, TaggedNostrEvent, tryParseNostrLink } from "@snort/system";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import { TagsInput } from "react-tag-input-component";
|
import { TagsInput } from "react-tag-input-component";
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ import ProfileImage from "@/Element/User/ProfileImage";
|
|||||||
import useFileUpload from "@/Upload";
|
import useFileUpload from "@/Upload";
|
||||||
import Note from "@/Element/Event/Note";
|
import Note from "@/Element/Event/Note";
|
||||||
|
|
||||||
import { ClipboardEventHandler, DragEvent, useEffect, useState } from "react";
|
import { ClipboardEventHandler, DragEvent } from "react";
|
||||||
import useLogin from "@/Hooks/useLogin";
|
import useLogin from "@/Hooks/useLogin";
|
||||||
import { GetPowWorker } from "@/index";
|
import { GetPowWorker } from "@/index";
|
||||||
import AsyncButton from "@/Element/AsyncButton";
|
import AsyncButton from "@/Element/AsyncButton";
|
||||||
@ -21,12 +21,11 @@ import { AsyncIcon } from "@/Element/AsyncIcon";
|
|||||||
import { fetchNip05Pubkey } from "@snort/shared";
|
import { fetchNip05Pubkey } from "@snort/shared";
|
||||||
import { ZapTarget } from "@/Zapper";
|
import { ZapTarget } from "@/Zapper";
|
||||||
import { useNoteCreator } from "@/State/NoteCreator";
|
import { useNoteCreator } from "@/State/NoteCreator";
|
||||||
import { NoteBroadcaster } from "./NoteBroadcaster/NoteBroadcaster";
|
import { NoteBroadcaster } from "@/Element/Event/Create/NoteBroadcaster";
|
||||||
import FileUploadProgress from "./FileUpload";
|
import FileUploadProgress from "../FileUpload";
|
||||||
import { ToggleSwitch } from "@/Icons/Toggle";
|
import { ToggleSwitch } from "@/Icons/Toggle";
|
||||||
import NostrBandApi from "@/External/NostrBand";
|
import { sendEventToRelays } from "@/Element/Event/Create/util";
|
||||||
import { useLocale } from "@/IntlProvider";
|
import { TrendingHashTagsLine } from "@/Element/Event/Create/TrendingHashTagsLine";
|
||||||
import { sendEventToRelays } from "@/Element/Event/NoteBroadcaster/util";
|
|
||||||
|
|
||||||
export function NoteCreator() {
|
export function NoteCreator() {
|
||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
@ -656,34 +655,3 @@ export function NoteCreator() {
|
|||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function TrendingHashTagsLine(props: { onClick: (tag: string) => void }) {
|
|
||||||
const [hashtags, setHashtags] = useState<Array<{ hashtag: string; posts: number }>>();
|
|
||||||
const { lang } = useLocale();
|
|
||||||
|
|
||||||
async function loadTrendingHashtags() {
|
|
||||||
const api = new NostrBandApi();
|
|
||||||
const rsp = await api.trendingHashtags(lang);
|
|
||||||
setHashtags(rsp.hashtags);
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
loadTrendingHashtags().catch(console.error);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
if (!hashtags || hashtags.length === 0) return;
|
|
||||||
return (
|
|
||||||
<div className="flex flex-col g4">
|
|
||||||
<small>
|
|
||||||
<FormattedMessage defaultMessage="Popular Hashtags" id="ddd3JX" />
|
|
||||||
</small>
|
|
||||||
<div className="flex g4 flex-wrap">
|
|
||||||
{hashtags.slice(0, 5).map(a => (
|
|
||||||
<span className="px-2 py-1 bg-dark rounded-full pointer nowrap" onClick={() => props.onClick(a.hashtag)}>
|
|
||||||
#{a.hashtag}
|
|
||||||
</span>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
@ -0,0 +1,35 @@
|
|||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import { useLocale } from "@/IntlProvider";
|
||||||
|
import NostrBandApi from "@/External/NostrBand";
|
||||||
|
import { FormattedMessage } from "react-intl";
|
||||||
|
|
||||||
|
export function TrendingHashTagsLine(props: { onClick: (tag: string) => void }) {
|
||||||
|
const [hashtags, setHashtags] = useState<Array<{ hashtag: string; posts: number }>>();
|
||||||
|
const { lang } = useLocale();
|
||||||
|
|
||||||
|
async function loadTrendingHashtags() {
|
||||||
|
const api = new NostrBandApi();
|
||||||
|
const rsp = await api.trendingHashtags(lang);
|
||||||
|
setHashtags(rsp.hashtags);
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
loadTrendingHashtags().catch(console.error);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
if (!hashtags || hashtags.length === 0) return;
|
||||||
|
return (
|
||||||
|
<div className="flex flex-col g4">
|
||||||
|
<small>
|
||||||
|
<FormattedMessage defaultMessage="Popular Hashtags" id="ddd3JX" />
|
||||||
|
</small>
|
||||||
|
<div className="flex g4 flex-wrap">
|
||||||
|
{hashtags.slice(0, 5).map(a => (
|
||||||
|
<span className="px-2 py-1 bg-dark rounded-full pointer nowrap" onClick={() => props.onClick(a.hashtag)}>
|
||||||
|
#{a.hashtag}
|
||||||
|
</span>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
@ -5,7 +5,7 @@ import { ProfileLink } from "../../Element/User/ProfileLink";
|
|||||||
import Avatar from "../../Element/User/Avatar";
|
import Avatar from "../../Element/User/Avatar";
|
||||||
import useLogin from "../../Hooks/useLogin";
|
import useLogin from "../../Hooks/useLogin";
|
||||||
import { useUserProfile } from "@snort/system-react";
|
import { useUserProfile } from "@snort/system-react";
|
||||||
import { NoteCreatorButton } from "../../Element/Event/NoteCreatorButton";
|
import { NoteCreatorButton } from "../../Element/Event/Create/NoteCreatorButton";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import { HasNotificationsMarker } from "@/Pages/Layout/AccountHeader";
|
import { HasNotificationsMarker } from "@/Pages/Layout/AccountHeader";
|
||||||
|
@ -11,7 +11,7 @@ import { useLoginRelays } from "@/Hooks/useLoginRelays";
|
|||||||
import { LoginUnlock } from "@/Element/PinPrompt";
|
import { LoginUnlock } from "@/Element/PinPrompt";
|
||||||
import useKeyboardShortcut from "@/Hooks/useKeyboardShortcut";
|
import useKeyboardShortcut from "@/Hooks/useKeyboardShortcut";
|
||||||
import { LoginStore } from "@/Login";
|
import { LoginStore } from "@/Login";
|
||||||
import { NoteCreatorButton } from "@/Element/Event/NoteCreatorButton";
|
import { NoteCreatorButton } from "@/Element/Event/Create/NoteCreatorButton";
|
||||||
import NavSidebar from "./NavSidebar";
|
import NavSidebar from "./NavSidebar";
|
||||||
import AccountHeader from "./AccountHeader";
|
import AccountHeader from "./AccountHeader";
|
||||||
import RightColumn from "./RightColumn";
|
import RightColumn from "./RightColumn";
|
||||||
|
Reference in New Issue
Block a user