From 1a4db014d710586881cc01b7fefe4c8b2cafa0a0 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 16 Jul 2021 12:51:54 -0400 Subject: [PATCH] Fix symbols issue. Fixes #319 --- src/server/index.tsx | 12 +- src/shared/components/app.tsx | 2 - src/shared/components/icon.tsx | 2 +- src/shared/components/symbols.tsx | 352 +++++++++++++++--------------- 4 files changed, 181 insertions(+), 187 deletions(-) diff --git a/src/server/index.tsx b/src/server/index.tsx index 2d2a662..7af8da8 100644 --- a/src/server/index.tsx +++ b/src/server/index.tsx @@ -15,6 +15,7 @@ import IsomorphicCookie from "isomorphic-cookie"; import { GetSite, GetSiteResponse, LemmyHttp } from "lemmy-js-client"; import process from "process"; import { Helmet } from "inferno-helmet"; +import { SYMBOLS } from "../shared/components/symbols"; import { initializeSite } from "../shared/initialize"; import { httpBaseInternal } from "../shared/env"; import { IncomingHttpHeaders } from "http"; @@ -109,6 +110,7 @@ server.get("/*", async (req, res) => { ); const root = renderToString(wrapper); + const symbols = renderToString(SYMBOLS); const cspStr = process.env.LEMMY_EXTERNAL_HOST ? renderToString(cspHtml) : ""; const helmet = Helmet.renderStatic(); @@ -140,6 +142,10 @@ server.get("/*", async (req, res) => { ${helmet.link.toString()} + + + ${symbols} + @@ -160,9 +166,9 @@ server.listen(Number(port), hostname, () => { console.log(`http://${hostname}:${port}`); }); -function setForwardedHeaders( - headers: IncomingHttpHeaders -): { [key: string]: string } { +function setForwardedHeaders(headers: IncomingHttpHeaders): { + [key: string]: string; +} { let out = { host: headers.host, }; diff --git a/src/shared/components/app.tsx b/src/shared/components/app.tsx index 898c93c..179db4d 100644 --- a/src/shared/components/app.tsx +++ b/src/shared/components/app.tsx @@ -8,7 +8,6 @@ import { Navbar } from "./navbar"; import { Footer } from "./footer"; import { NoMatch } from "./no-match"; import { Theme } from "./theme"; -import { Symbols } from "./symbols"; import { GetSiteResponse } from "lemmy-js-client"; import "./styles.scss"; import { favIconPngUrl, favIconUrl } from "../utils"; @@ -59,7 +58,6 @@ export class App extends Component { ))} } /> -