From bfadf4ebfeb4309499b882ea956d60854067c55d Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 21 Oct 2023 21:51:23 -0400 Subject: [PATCH] Addressing PR comments. --- joinlemmy-translations | 2 +- lemmy-docs | 2 +- lemmy-translations | 2 +- recommended-instances.json | 3 + src/shared/components/donate-definitions.ts | 97 +++++++++------------ src/shared/components/instances.tsx | 13 +-- src/shared/components/main.tsx | 39 +++++++-- 7 files changed, 86 insertions(+), 72 deletions(-) diff --git a/joinlemmy-translations b/joinlemmy-translations index 988b403..74b5b50 160000 --- a/joinlemmy-translations +++ b/joinlemmy-translations @@ -1 +1 @@ -Subproject commit 988b403f36f53a6ee79111a62cc92bb2df9dfa46 +Subproject commit 74b5b5023bc27f6f0fc1bc2dc3fc81f49110b501 diff --git a/lemmy-docs b/lemmy-docs index fe95bd0..e80831f 160000 --- a/lemmy-docs +++ b/lemmy-docs @@ -1 +1 @@ -Subproject commit fe95bd00c3e9b08c8fb86e0f930452a1f4a2119b +Subproject commit e80831ffe1885d98d88bd8c365f6c5898b523405 diff --git a/lemmy-translations b/lemmy-translations index abd40d4..6fbc869 160000 --- a/lemmy-translations +++ b/lemmy-translations @@ -1 +1 @@ -Subproject commit abd40d4737fa732321fd7b62e42bbfcd51081cb6 +Subproject commit 6fbc86932a03c4d40829ee4a3395259b2a7660e5 diff --git a/recommended-instances.json b/recommended-instances.json index 2081811..fd56d3e 100644 --- a/recommended-instances.json +++ b/recommended-instances.json @@ -6,9 +6,12 @@ "feddit.it", "lemmygrad.ml", "reddthat.com", + "lemmy.sdf.org", + "feddit.uk", "hexbear.net", "lemmy.fmhy.ml", "discuss.online", + "feddit.de", "lemmings.world" ], "exclude": [ diff --git a/src/shared/components/donate-definitions.ts b/src/shared/components/donate-definitions.ts index de5cee5..f20f530 100644 --- a/src/shared/components/donate-definitions.ts +++ b/src/shared/components/donate-definitions.ts @@ -1,3 +1,8 @@ +export interface Coder { + name: string; + link?: string; +} + export interface LinkedSponsor { name: string; link: string; @@ -9,6 +14,38 @@ export interface GoldSponsor { avatar?: string; } +export interface Translation { + lang: string; + country?: string; + translators: Translator[]; +} + +export interface Translator { + name: string; + link?: string; +} + +interface FundingPlatform { + supporterCount: number; + monthlyEUR: number; +} + +export const CODERS: Coder[] = [ + { name: "dessalines", link: "https://github.com/dessalines" }, + { name: "Nutomic", link: "https://github.com/nutomic" }, + { name: "phiresky", link: "https://github.com/phiresky" }, + { name: "SleeplessOne1917", link: "https://github.com/SleeplessOne1917" }, + { name: "asonix", link: "https://github.com/asonix" }, + { name: "MV-GH", link: "https://github.com/MV-GH" }, + { name: "dullbananas", link: "https://github.com/dullbananas" }, + { name: "sunaurus", link: "https://github.com/sunaurus" }, + { name: "shilangyu", link: "https://github.com/shilangyu" }, + { name: "eiknat", link: "https://github.com/eiknat" }, + { name: "ernestwisniewski", link: "https://github.com/ernestwisniewski" }, + { name: "zacanger", link: "https://github.com/zacanger" }, + { name: "iav", link: "https://github.com/iav" }, +]; + export const GOLD_SPONSORS: GoldSponsor[] = [ { name: "Erlend Sogge Heggen", @@ -71,64 +108,9 @@ export const HIGHLIGHTED_SPONSORS = [ "OliverLost", "THE-DIESEL999", ]; -export const GENERAL_SPONSORS = [ - "0ti.me", - "Alex Wasserman", - "Alexander Bierbaumer", - "alexx henry", - "Amir Zaidi", - "Andi", - "Andre Hoffmann", - "Andre Vallestero", - "Anthony", - "Remi Rampin", - "Cameron C", - "Vegard", - "Brendan", - "mexicanhalloween .", - "Arthur Nieuwland", - "Forrest Weghorst", - "Luke Black", - "Brandon Abbott", - "Eon Gattignolo", -]; -export interface Coder { - name: string; - link?: string; -} - -export const CODERS: Coder[] = [ - { name: "dessalines", link: "https://github.com/dessalines" }, - { name: "Nutomic", link: "https://github.com/nutomic" }, - { name: "phiresky", link: "https://github.com/phiresky" }, - { name: "SleeplessOne1917", link: "https://github.com/SleeplessOne1917" }, - { name: "asonix", link: "https://github.com/asonix" }, - { name: "MV-GH", link: "https://github.com/MV-GH" }, - { name: "dullbananas", link: "https://github.com/dullbananas" }, - { name: "sunaurus", link: "https://github.com/sunaurus" }, - { name: "shilangyu", link: "https://github.com/shilangyu" }, - { name: "eiknat", link: "https://github.com/eiknat" }, - { name: "ernestwisniewski", link: "https://github.com/ernestwisniewski" }, - { name: "zacanger", link: "https://github.com/zacanger" }, - { name: "iav", link: "https://github.com/iav" }, -]; - -export interface Translation { - lang: string; - country?: string; - translators: Translator[]; -} - -export interface Translator { - name: string; - link?: string; -} - -interface FundingPlatform { - supporterCount: number; - monthlyEUR: number; -} +// Don't do these until its automated +export const GENERAL_SPONSORS = []; // Updated 2023-10-11 // Monthly counts in EUR @@ -167,4 +149,5 @@ export const FUNDED_DEVS = TOTAL_RECURRING_MONTHLY_EUR / MEDIAN_DEV_MONTHLY_EUR; // Goal export const FUNDED_DEV_GOAL = 4; +// End fundraiser date export const END_FUNDRAISER_DATE = new Date("2024-12-01"); diff --git a/src/shared/components/instances.tsx b/src/shared/components/instances.tsx index c3c1ba0..9efd6f5 100644 --- a/src/shared/components/instances.tsx +++ b/src/shared/components/instances.tsx @@ -263,7 +263,7 @@ export const DetailsModal = ({ monthlyUsers={monthlyUsers} />
- {i18n.t("join")} + {i18n.t("browse_instance")}
{sidebar && ( @@ -275,7 +275,7 @@ export const DetailsModal = ({ className="btn btn-primary btn-block text-white normal-case" href={buildUrl(domain)} > - {i18n.t("join")} + {i18n.t("browse_instance")} @@ -364,10 +364,13 @@ export class Instances extends Component { } // Set the filters by the query params if they exist - componentDidMount(): void { + componentDidMount() { this.setState(getInstancesQueryParams()); - this.buildInstanceList(); - this.scrollToSearch(); + // This is browser intensive, so run in the background + setTimeout(() => { + this.buildInstanceList(); + this.scrollToSearch(); + }, 0); } scrollToSearch() { diff --git a/src/shared/components/main.tsx b/src/shared/components/main.tsx index b652e2f..af76583 100644 --- a/src/shared/components/main.tsx +++ b/src/shared/components/main.tsx @@ -3,7 +3,7 @@ import { Link } from "inferno-router"; import { Helmet } from "inferno-helmet"; import { i18n } from "../i18next"; import { T } from "inferno-i18next"; -import { isBrowser } from "../utils"; +import { getQueryParams, isBrowser } from "../utils"; import { Icon } from "./icon"; import { BottomSpacer, @@ -63,15 +63,17 @@ const CarouselBlock = () => ( ); const JoinServerButton = ({ i }: MainProps) => ( - + ); const SeeAllServersButton = () => ( @@ -422,8 +424,27 @@ const MoreFeaturesCard = ({ icons, text }) => ( ); -export class Main extends Component { - state = { +function getMainQueryParams() { + return getQueryParams({ + showJoinModal: d => !!d, + }); +} + +interface Props { + showJoinModal?: boolean; +} + +interface State { + resetInstancePicker: boolean; + showJoinModal?: boolean; +} + +function showJoinModal() { + (document.getElementById("picker") as any).showModal(); +} + +export class Main extends Component { + state: State = { resetInstancePicker: false, }; @@ -435,6 +456,10 @@ export class Main extends Component { if (isBrowser()) { window.scrollTo(0, 0); } + this.setState(getMainQueryParams()); + if (this.state.showJoinModal) { + showJoinModal(); + } } render() {