diff --git a/packages/app/src/Element/Event/NoteCreatorButton.tsx b/packages/app/src/Element/Event/NoteCreatorButton.tsx index fef8c184..f044ae03 100644 --- a/packages/app/src/Element/Event/NoteCreatorButton.tsx +++ b/packages/app/src/Element/Event/NoteCreatorButton.tsx @@ -10,7 +10,7 @@ import Icon from "@/Icons/Icon"; import { useNoteCreator } from "@/State/NoteCreator"; import { NoteCreator } from "./NoteCreator"; -export const NoteCreatorButton = ({ className, alwaysShow }: { className?: string, alwaysShow?: boolean }) => { +export const NoteCreatorButton = ({ className, alwaysShow }: { className?: string; alwaysShow?: boolean }) => { const buttonRef = useRef(null); const location = useLocation(); const { readonly } = useLogin(s => ({ readonly: s.readonly })); diff --git a/packages/app/src/Element/TrendingHashtags.tsx b/packages/app/src/Element/TrendingHashtags.tsx index 7d8692f8..dfce3eca 100644 --- a/packages/app/src/Element/TrendingHashtags.tsx +++ b/packages/app/src/Element/TrendingHashtags.tsx @@ -6,7 +6,7 @@ import { ErrorOrOffline } from "./ErrorOrOffline"; import { HashTagHeader } from "@/Pages/HashTagsPage"; import { useLocale } from "@/IntlProvider"; -export default function TrendingHashtags({ title }: { title?: ReactNode }) { +export default function TrendingHashtags({ title, count = 5 }: { title?: ReactNode; count?: number }) { const [hashtags, setHashtags] = useState>(); const [error, setError] = useState(); const { lang } = useLocale(); @@ -14,7 +14,7 @@ export default function TrendingHashtags({ title }: { title?: ReactNode }) { async function loadTrendingHashtags() { const api = new NostrBandApi(); const rsp = await api.trendingHashtags(lang); - setHashtags(rsp.hashtags); + setHashtags(rsp.hashtags.slice(0, count)); // Limit the number of hashtags to the count } useEffect(() => { diff --git a/packages/app/src/Element/TrendingPosts.tsx b/packages/app/src/Element/TrendingPosts.tsx index 7e42b7c0..90e170d0 100644 --- a/packages/app/src/Element/TrendingPosts.tsx +++ b/packages/app/src/Element/TrendingPosts.tsx @@ -9,7 +9,8 @@ import { ErrorOrOffline } from "@/Element/ErrorOrOffline"; import { useLocale } from "@/IntlProvider"; import useModeration from "@/Hooks/useModeration"; -export default function TrendingNotes() { +export default function TrendingNotes({ count = Infinity }) { + // Added count prop with a default value const [posts, setPosts] = useState>(); const [error, setError] = useState(); const { lang } = useLocale(); @@ -37,6 +38,7 @@ export default function TrendingNotes() { <> {posts .filter(a => !isEventMuted(a)) + .slice(0, count) // Limit the number of posts displayed .map(e => ( ))} diff --git a/packages/app/src/Element/TrendingUsers.tsx b/packages/app/src/Element/TrendingUsers.tsx index 011c7bb4..86579469 100644 --- a/packages/app/src/Element/TrendingUsers.tsx +++ b/packages/app/src/Element/TrendingUsers.tsx @@ -6,14 +6,14 @@ import PageSpinner from "@/Element/PageSpinner"; import NostrBandApi from "@/External/NostrBand"; import { ErrorOrOffline } from "./ErrorOrOffline"; -export default function TrendingUsers({ title }: { title?: ReactNode }) { +export default function TrendingUsers({ title, count = 5 }: { title?: ReactNode; count?: number }) { const [userList, setUserList] = useState(); const [error, setError] = useState(); async function loadTrendingUsers() { const api = new NostrBandApi(); const users = await api.trendingProfiles(); - const keys = users.profiles.map(a => a.pubkey); + const keys = users.profiles.map(a => a.pubkey).slice(0, count); // Limit the user list to the count setUserList(keys); } diff --git a/packages/app/src/Pages/Layout/NavSidebar.tsx b/packages/app/src/Pages/Layout/NavSidebar.tsx index 32b85ae7..cb1ecbc5 100644 --- a/packages/app/src/Pages/Layout/NavSidebar.tsx +++ b/packages/app/src/Pages/Layout/NavSidebar.tsx @@ -1,12 +1,12 @@ import { LogoHeader } from "./LogoHeader"; -import {Link, useNavigate} from "react-router-dom"; +import { Link, useNavigate } from "react-router-dom"; import Icon from "@/Icons/Icon"; -import {ProfileLink} from "../../Element/User/ProfileLink"; +import { ProfileLink } from "../../Element/User/ProfileLink"; import Avatar from "../../Element/User/Avatar"; import useLogin from "../../Hooks/useLogin"; -import {useUserProfile} from "@snort/system-react"; -import {NoteCreatorButton} from "../../Element/Event/NoteCreatorButton"; -import {FormattedMessage} from "react-intl"; +import { useUserProfile } from "@snort/system-react"; +import { NoteCreatorButton } from "../../Element/Event/NoteCreatorButton"; +import { FormattedMessage } from "react-intl"; const MENU_ITEMS = [ { @@ -49,7 +49,7 @@ export default function NavSidebar() {
{MENU_ITEMS.map(item => { if (!item.nonLoggedIn && !publicKey) { - return ''; + return ""; } return ( - ) : ''} + ) : ( + "" + )}
); } diff --git a/packages/app/src/Pages/Layout/RightColumn.tsx b/packages/app/src/Pages/Layout/RightColumn.tsx index 04eecaae..c9172f45 100644 --- a/packages/app/src/Pages/Layout/RightColumn.tsx +++ b/packages/app/src/Pages/Layout/RightColumn.tsx @@ -1,11 +1,33 @@ -import SearchBox from "../../Element/SearchBox"; +import SearchBox from "@/Element/SearchBox"; +import TrendingUsers from "@/Element/TrendingUsers"; +import TrendingHashtags from "@/Element/TrendingHashtags"; +import TrendingNotes from "@/Element/TrendingPosts"; +import { FormattedMessage } from "react-intl"; export default function RightColumn() { return ( -
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
); } diff --git a/packages/app/src/Pages/settings/Root.tsx b/packages/app/src/Pages/settings/Root.tsx index df16e332..cd4dd022 100644 --- a/packages/app/src/Pages/settings/Root.tsx +++ b/packages/app/src/Pages/settings/Root.tsx @@ -16,9 +16,12 @@ const SettingsIndex = () => { const pageWidth = usePageWidth(); const sub = getCurrentSubscription(LoginStore.allSubscriptions()); - const handleNavigate = useCallback((path) => { - navigate(path); - }, [navigate]); + const handleNavigate = useCallback( + path => { + navigate(path); + }, + [navigate], + ); const handleLogout = useCallback(() => { logout(login.id); @@ -31,7 +34,10 @@ const SettingsIndex = () => { } }, [location, navigate, pageWidth]); - const [hideMenu, hideContent] = [location.pathname !== "/settings" && pageWidth < 768, location.pathname === "/settings" && pageWidth < 768]; + const [hideMenu, hideContent] = [ + location.pathname !== "/settings" && pageWidth < 768, + location.pathname === "/settings" && pageWidth < 768, + ]; const menuItems = [ { icon: "profile", message: messages.Profile, path: "profile" }, @@ -43,7 +49,7 @@ const SettingsIndex = () => { { icon: "wallet", message: "Wallet", id: "3yk8fB", path: "wallet" }, { icon: "heart", message: messages.Donate, path: "/donate" }, { icon: "hard-drive", message: "Cache", id: "DBiVK1", path: "cache" }, - { icon: "profile", message: messages.SocialGraph, path: "/graph" } + { icon: "profile", message: messages.SocialGraph, path: "/graph" }, ]; if (CONFIG.features.subscriptions) { diff --git a/packages/app/src/lang.json b/packages/app/src/lang.json index 6182470c..9bda7c2a 100644 --- a/packages/app/src/lang.json +++ b/packages/app/src/lang.json @@ -57,9 +57,6 @@ "00LcfG": { "defaultMessage": "Load more" }, - "08zn6O": { - "defaultMessage": "Export Keys" - }, "0Azlrb": { "defaultMessage": "Manage" }, @@ -159,9 +156,6 @@ "3tVy+Z": { "defaultMessage": "{n} Followers" }, - "3yk8fB": { - "defaultMessage": "Wallet" - }, "450Fty": { "defaultMessage": "None" }, @@ -234,6 +228,9 @@ "6ewQqw": { "defaultMessage": "Likes ({n})" }, + "6k7xfM": { + "defaultMessage": "Trending notes" + }, "6uMqL1": { "defaultMessage": "Unpaid" }, @@ -243,9 +240,6 @@ "712i26": { "defaultMessage": "Proxy uses HODL invoices to forward the payment, which hides the pubkey of your node" }, - "7BX/yC": { - "defaultMessage": "Account Switcher" - }, "7UOvbT": { "defaultMessage": "Offline" }, @@ -261,6 +255,9 @@ "8ED/4u": { "defaultMessage": "Reply To" }, + "8HJxXG": { + "defaultMessage": "Sign up" + }, "8QDesP": { "defaultMessage": "Zap {n} sats" }, @@ -368,6 +365,9 @@ "CVWeJ6": { "defaultMessage": "Trending People" }, + "CbM2hK": { + "defaultMessage": "Trending hashtags" + }, "CmZ9ls": { "defaultMessage": "{n} Muted" }, @@ -729,9 +729,6 @@ "Qxv0B2": { "defaultMessage": "You currently have {number} sats in your zap pool." }, - "R/6nsx": { - "defaultMessage": "Subscription" - }, "R81upa": { "defaultMessage": "People you follow" }, @@ -940,6 +937,9 @@ "aWpBzj": { "defaultMessage": "Show more" }, + "arZnG2": { + "defaultMessage": "Trending users" + }, "b12Goz": { "defaultMessage": "Mnemonic" }, @@ -1458,9 +1458,6 @@ "wih7iJ": { "defaultMessage": "name is blocked" }, - "wofVHy": { - "defaultMessage": "Moderation" - }, "wqyN/i": { "defaultMessage": "Find out more info about {service} at {link}" }, diff --git a/packages/app/src/translations/en.json b/packages/app/src/translations/en.json index 1d8a8cb7..ae58caaf 100644 --- a/packages/app/src/translations/en.json +++ b/packages/app/src/translations/en.json @@ -18,7 +18,6 @@ "/d6vEc": "Make your profile easier to find and share", "/n5KSF": "{n} ms", "00LcfG": "Load more", - "08zn6O": "Export Keys", "0Azlrb": "Manage", "0BUTMv": "Search...", "0HFX0T": "Use Exact Location", @@ -52,7 +51,6 @@ "3qnJlS": "You are voting with {amount} sats", "3t3kok": "{n,plural,=1{{n} new note} other{{n} new notes}}", "3tVy+Z": "{n} Followers", - "3yk8fB": "Wallet", "450Fty": "None", "47FYwb": "Cancel", "4IPzdn": "Primary Developers", @@ -77,15 +75,16 @@ "6TfgXX": "{site} is an open source project built by passionate people in their free time", "6bgpn+": "Not all clients support this, you may still receive some zaps as if zap splits was not configured", "6ewQqw": "Likes ({n})", + "6k7xfM": "Trending notes", "6uMqL1": "Unpaid", "7+Domh": "Notes", "712i26": "Proxy uses HODL invoices to forward the payment, which hides the pubkey of your node", - "7BX/yC": "Account Switcher", "7UOvbT": "Offline", "7hp70g": "NIP-05", "8/vBbP": "Reposts ({n})", "89q5wc": "Confirm Reposts", "8ED/4u": "Reply To", + "8HJxXG": "Sign up", "8QDesP": "Zap {n} sats", "8Rkoyb": "Recipient", "8Y6bZQ": "Invalid zap split: {input}", @@ -121,6 +120,7 @@ "C8HhVE": "Suggested Follows", "CHTbO3": "Failed to load invoice", "CVWeJ6": "Trending People", + "CbM2hK": "Trending hashtags", "CmZ9ls": "{n} Muted", "CsCUYo": "{n} sats", "Cu/K85": "Translated from {lang}", @@ -240,7 +240,6 @@ "QDFTjG": "{n} Relays", "QWhotP": "Zap Pool only works if you use one of the supported wallet connections (WebLN, LNC, LNDHub or Nostr Wallet Connect)", "Qxv0B2": "You currently have {number} sats in your zap pool.", - "R/6nsx": "Subscription", "R81upa": "People you follow", "RSr2uB": "Username must only contain lowercase letters and numbers", "RahCRH": "Expired", @@ -309,6 +308,7 @@ "aHje0o": "Name or nym", "aMaLBK": "Supported Extensions", "aWpBzj": "Show more", + "arZnG2": "Trending users", "b12Goz": "Mnemonic", "b5vAk0": "Your handle will act like a lightning address and will redirect to your chosen LNURL or Lightning address", "bLZL5a": "Get Address", @@ -480,7 +480,6 @@ "wSZR47": "Submit", "wWLwvh": "Anon", "wih7iJ": "name is blocked", - "wofVHy": "Moderation", "wqyN/i": "Find out more info about {service} at {link}", "wtLjP6": "Copy ID", "x/Fx2P": "Fund the services that you use by splitting a portion of all your zaps into a pool of funds!",