Addressing PR comments.

This commit is contained in:
Dessalines 2023-10-21 21:51:23 -04:00
parent a83a27bff6
commit bfadf4ebfe
7 changed files with 86 additions and 72 deletions

@ -1 +1 @@
Subproject commit 988b403f36f53a6ee79111a62cc92bb2df9dfa46 Subproject commit 74b5b5023bc27f6f0fc1bc2dc3fc81f49110b501

@ -1 +1 @@
Subproject commit fe95bd00c3e9b08c8fb86e0f930452a1f4a2119b Subproject commit e80831ffe1885d98d88bd8c365f6c5898b523405

@ -1 +1 @@
Subproject commit abd40d4737fa732321fd7b62e42bbfcd51081cb6 Subproject commit 6fbc86932a03c4d40829ee4a3395259b2a7660e5

View file

@ -6,9 +6,12 @@
"feddit.it", "feddit.it",
"lemmygrad.ml", "lemmygrad.ml",
"reddthat.com", "reddthat.com",
"lemmy.sdf.org",
"feddit.uk",
"hexbear.net", "hexbear.net",
"lemmy.fmhy.ml", "lemmy.fmhy.ml",
"discuss.online", "discuss.online",
"feddit.de",
"lemmings.world" "lemmings.world"
], ],
"exclude": [ "exclude": [

View file

@ -1,3 +1,8 @@
export interface Coder {
name: string;
link?: string;
}
export interface LinkedSponsor { export interface LinkedSponsor {
name: string; name: string;
link: string; link: string;
@ -9,6 +14,38 @@ export interface GoldSponsor {
avatar?: string; 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[] = [ export const GOLD_SPONSORS: GoldSponsor[] = [
{ {
name: "Erlend Sogge Heggen", name: "Erlend Sogge Heggen",
@ -71,64 +108,9 @@ export const HIGHLIGHTED_SPONSORS = [
"OliverLost", "OliverLost",
"THE-DIESEL999", "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 { // Don't do these until its automated
name: string; export const GENERAL_SPONSORS = [];
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;
}
// Updated 2023-10-11 // Updated 2023-10-11
// Monthly counts in EUR // Monthly counts in EUR
@ -167,4 +149,5 @@ export const FUNDED_DEVS = TOTAL_RECURRING_MONTHLY_EUR / MEDIAN_DEV_MONTHLY_EUR;
// Goal // Goal
export const FUNDED_DEV_GOAL = 4; export const FUNDED_DEV_GOAL = 4;
// End fundraiser date
export const END_FUNDRAISER_DATE = new Date("2024-12-01"); export const END_FUNDRAISER_DATE = new Date("2024-12-01");

View file

@ -263,7 +263,7 @@ export const DetailsModal = ({
monthlyUsers={monthlyUsers} monthlyUsers={monthlyUsers}
/> />
<div className="btn btn-primary btn-outline btn-sm normal-case"> <div className="btn btn-primary btn-outline btn-sm normal-case">
<a href={buildUrl(domain)}>{i18n.t("join")}</a> <a href={buildUrl(domain)}>{i18n.t("browse_instance")}</a>
</div> </div>
</div> </div>
{sidebar && ( {sidebar && (
@ -275,7 +275,7 @@ export const DetailsModal = ({
className="btn btn-primary btn-block text-white normal-case" className="btn btn-primary btn-block text-white normal-case"
href={buildUrl(domain)} href={buildUrl(domain)}
> >
{i18n.t("join")} {i18n.t("browse_instance")}
</a> </a>
</div> </div>
</dialog> </dialog>
@ -364,10 +364,13 @@ export class Instances extends Component<Props, State> {
} }
// Set the filters by the query params if they exist // Set the filters by the query params if they exist
componentDidMount(): void { componentDidMount() {
this.setState(getInstancesQueryParams()); this.setState(getInstancesQueryParams());
this.buildInstanceList(); // This is browser intensive, so run in the background
this.scrollToSearch(); setTimeout(() => {
this.buildInstanceList();
this.scrollToSearch();
}, 0);
} }
scrollToSearch() { scrollToSearch() {

View file

@ -3,7 +3,7 @@ import { Link } from "inferno-router";
import { Helmet } from "inferno-helmet"; import { Helmet } from "inferno-helmet";
import { i18n } from "../i18next"; import { i18n } from "../i18next";
import { T } from "inferno-i18next"; import { T } from "inferno-i18next";
import { isBrowser } from "../utils"; import { getQueryParams, isBrowser } from "../utils";
import { Icon } from "./icon"; import { Icon } from "./icon";
import { import {
BottomSpacer, BottomSpacer,
@ -63,15 +63,17 @@ const CarouselBlock = () => (
); );
const JoinServerButton = ({ i }: MainProps) => ( const JoinServerButton = ({ i }: MainProps) => (
<button <a
href="?showJoinModal=true"
className="btn btn-primary text-white normal-case z-10" className="btn btn-primary text-white normal-case z-10"
onClick={() => { onClick={e => {
e.preventDefault();
i.setState({ resetInstancePicker: true }); i.setState({ resetInstancePicker: true });
(document.getElementById("picker") as any).showModal(); showJoinModal();
}} }}
> >
{i18n.t("join_a_server")} {i18n.t("join_a_server")}
</button> </a>
); );
const SeeAllServersButton = () => ( const SeeAllServersButton = () => (
@ -422,8 +424,27 @@ const MoreFeaturesCard = ({ icons, text }) => (
</div> </div>
); );
export class Main extends Component<any, any> { function getMainQueryParams() {
state = { return getQueryParams<Props>({
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<Props, State> {
state: State = {
resetInstancePicker: false, resetInstancePicker: false,
}; };
@ -435,6 +456,10 @@ export class Main extends Component<any, any> {
if (isBrowser()) { if (isBrowser()) {
window.scrollTo(0, 0); window.scrollTo(0, 0);
} }
this.setState(getMainQueryParams());
if (this.state.showJoinModal) {
showJoinModal();
}
} }
render() { render() {