From 803ea6a3c0d86a410e9990dab191a206d7e10632 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 3 Oct 2023 11:27:50 -0400 Subject: [PATCH] Adding bottom spacer. --- src/shared/components/apps.tsx | 3 ++- src/shared/components/common.tsx | 2 ++ src/shared/components/contact.tsx | 3 ++- src/shared/components/donate.tsx | 10 ++++++-- src/shared/components/icon.tsx | 39 +++++++++++------------------ src/shared/components/main.tsx | 3 ++- src/shared/components/navbar.tsx | 20 ++++++++++----- src/shared/components/news-item.tsx | 2 ++ src/shared/components/news.tsx | 3 ++- 9 files changed, 49 insertions(+), 36 deletions(-) diff --git a/src/shared/components/apps.tsx b/src/shared/components/apps.tsx index aa0fa37..633fab4 100644 --- a/src/shared/components/apps.tsx +++ b/src/shared/components/apps.tsx @@ -1,7 +1,7 @@ import { Component } from "inferno"; import { Helmet } from "inferno-helmet"; import { i18n } from "../i18next"; -import { TEXT_GRADIENT } from "./common"; +import { BottomSpacer, TEXT_GRADIENT } from "./common"; import { ANDROID_APPS, API_LIBRARIES, @@ -146,6 +146,7 @@ export class Apps extends Component { + ); } diff --git a/src/shared/components/common.tsx b/src/shared/components/common.tsx index 16fda50..89bb106 100644 --- a/src/shared/components/common.tsx +++ b/src/shared/components/common.tsx @@ -70,3 +70,5 @@ export const SupportDonateBlock = () => ( ); + +export const BottomSpacer = () =>
; diff --git a/src/shared/components/contact.tsx b/src/shared/components/contact.tsx index 1700a9b..c31b78e 100644 --- a/src/shared/components/contact.tsx +++ b/src/shared/components/contact.tsx @@ -1,7 +1,7 @@ import { Component } from "inferno"; import { Helmet } from "inferno-helmet"; import { i18n } from "../i18next"; -import { TEXT_GRADIENT } from "./common"; +import { BottomSpacer, TEXT_GRADIENT } from "./common"; import { Icon } from "./icon"; const TitleBlock = () => ( @@ -48,6 +48,7 @@ export class Contact extends Component { +
); } diff --git a/src/shared/components/donate.tsx b/src/shared/components/donate.tsx index 8079f7c..92f8ce1 100644 --- a/src/shared/components/donate.tsx +++ b/src/shared/components/donate.tsx @@ -5,7 +5,12 @@ import { T } from "inferno-i18next"; import { translators } from "../translations/translators"; import { languagesAll, countries } from "countries-list"; import { isBrowser } from "../utils"; -import { Badge, SupportDonateBlock, TEXT_GRADIENT } from "./common"; +import { + Badge, + BottomSpacer, + SupportDonateBlock, + TEXT_GRADIENT, +} from "./common"; import { CODERS, GOLD_SPONSORS, @@ -166,7 +171,7 @@ const GeneralSponsorCard = () => { }; const CryptoBlock = () => ( -
+
@@ -268,6 +273,7 @@ export class Donate extends Component { +
); } diff --git a/src/shared/components/icon.tsx b/src/shared/components/icon.tsx index b3ddab9..27ff774 100644 --- a/src/shared/components/icon.tsx +++ b/src/shared/components/icon.tsx @@ -1,31 +1,22 @@ -import { Component } from "inferno"; +export enum IconSize { + Small = "w-3 h-3", + Medium = "w-4 h-4", + Large = "w-6 h-6", +} interface IconProps { icon: string; + size?: IconSize; classes?: string; } -export class Icon extends Component { - constructor(props: any, context: any) { - super(props, context); - } +export const Icon = ({ icon, size = IconSize.Medium, classes }: IconProps) => ( + + {icon} + + +); - render() { - return ( - - {this.props.icon} - - - ); - } -} - -export class Spinner extends Component { - constructor(props: any, context: any) { - super(props, context); - } - - render() { - return ; - } -} +export const Spinner = () => ( + +); diff --git a/src/shared/components/main.tsx b/src/shared/components/main.tsx index 77b7b49..de271bb 100644 --- a/src/shared/components/main.tsx +++ b/src/shared/components/main.tsx @@ -5,7 +5,7 @@ import { i18n } from "../i18next"; import { T } from "inferno-i18next"; import { isBrowser } from "../utils"; import { Icon } from "./icon"; -import { SupportDonateBlock, TEXT_GRADIENT } from "./common"; +import { BottomSpacer, SupportDonateBlock, TEXT_GRADIENT } from "./common"; const TitleBlock = () => (
@@ -378,6 +378,7 @@ export class Main extends Component { +
); } diff --git a/src/shared/components/navbar.tsx b/src/shared/components/navbar.tsx index 9ec01e0..7b1b67a 100644 --- a/src/shared/components/navbar.tsx +++ b/src/shared/components/navbar.tsx @@ -1,6 +1,6 @@ import { ChangeEvent, linkEvent } from "inferno"; import { Link } from "inferno-router"; -import { Icon } from "./icon"; +import { Icon, IconSize } from "./icon"; import { i18n, languages } from "../i18next"; import classNames from "classnames"; @@ -28,7 +28,11 @@ function handleLanguageChange(_: any, event: ChangeEvent) { export const Footer = () => ; export const Navbar = ({ footer = false }) => ( -
+
@@ -64,13 +68,17 @@ export const Navbar = ({ footer = false }) => ( className="btn btn-ghost sm:max-lg:hidden" href="https://github.com/LemmyNet" > - + )} -
+
diff --git a/src/shared/components/news-item.tsx b/src/shared/components/news-item.tsx index b14becb..ae09471 100644 --- a/src/shared/components/news-item.tsx +++ b/src/shared/components/news-item.tsx @@ -3,6 +3,7 @@ import { Helmet } from "inferno-helmet"; import { i18n } from "../i18next"; import { news_md } from "../translations/news"; import { isBrowser, mdToHtml } from "../utils"; +import { BottomSpacer } from "./common"; const title = i18n.t("news"); @@ -34,6 +35,7 @@ export class NewsItem extends Component {
+
); } diff --git a/src/shared/components/news.tsx b/src/shared/components/news.tsx index 620004c..a325db4 100644 --- a/src/shared/components/news.tsx +++ b/src/shared/components/news.tsx @@ -4,7 +4,7 @@ import { Helmet } from "inferno-helmet"; import { i18n } from "../i18next"; import { isBrowser } from "../utils"; import { news_md } from "../translations/news"; -import { Badge, TEXT_GRADIENT } from "./common"; +import { Badge, BottomSpacer, TEXT_GRADIENT } from "./common"; import { Icon } from "./icon"; const title = i18n.t("news"); @@ -108,6 +108,7 @@ export class News extends Component { +
); }