From 6e3a6a601b570950df33233b3dd498fd2044531a Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 18 Nov 2022 13:28:05 -0500 Subject: [PATCH] Move symbols to its own cacheable file. Fixes #809 (#862) --- src/assets/css/main.css | 6 +- src/assets/symbols.svg | 252 ++++++++++++++++++++++ src/server/index.tsx | 5 - src/shared/components/common/icon.tsx | 4 +- src/shared/components/common/symbols.tsx | 254 ----------------------- 5 files changed, 258 insertions(+), 263 deletions(-) create mode 100644 src/assets/symbols.svg delete mode 100644 src/shared/components/common/symbols.tsx diff --git a/src/assets/css/main.css b/src/assets/css/main.css index 0018f59..b5a33af 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -158,7 +158,7 @@ position: absolute; background-color: var(--light); min-width: 160px; - box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); z-index: 2000; } @@ -368,7 +368,7 @@ br.big { } .honeypot { - display:none !important; + display: none !important; } .slight-radius { @@ -376,7 +376,7 @@ br.big { } .modlog-choices-font-size { - font-size: .9375rem !important; + font-size: 0.9375rem !important; } .preview-lines { diff --git a/src/assets/symbols.svg b/src/assets/symbols.svg new file mode 100644 index 0000000..43efa4b --- /dev/null +++ b/src/assets/symbols.svg @@ -0,0 +1,252 @@ + diff --git a/src/server/index.tsx b/src/server/index.tsx index d4a73a1..291989f 100644 --- a/src/server/index.tsx +++ b/src/server/index.tsx @@ -12,7 +12,6 @@ import path from "path"; import process from "process"; import serialize from "serialize-javascript"; import { App } from "../shared/components/app/app"; -import { SYMBOLS } from "../shared/components/common/symbols"; import { httpBaseInternal } from "../shared/env"; import { ILemmyConfig, @@ -186,7 +185,6 @@ server.get("/*", async (req, res) => { ); const erudaStr = process.env["LEMMY_UI_DEBUG"] ? renderToString(eruda) : ""; const root = renderToString(wrapper); - const symbols = renderToString(SYMBOLS); const helmet = Helmet.renderStatic(); const config: ILemmyConfig = { wsHost: process.env.LEMMY_UI_LEMMY_WS_HOST }; @@ -221,9 +219,6 @@ server.get("/*", async (req, res) => { ${helmet.link.toString()} - - ${symbols} - diff --git a/src/shared/components/common/icon.tsx b/src/shared/components/common/icon.tsx index f922e17..be2cc57 100644 --- a/src/shared/components/common/icon.tsx +++ b/src/shared/components/common/icon.tsx @@ -22,7 +22,9 @@ export class Icon extends Component { small: this.props.small, })} > - +
{this.props.icon}
diff --git a/src/shared/components/common/symbols.tsx b/src/shared/components/common/symbols.tsx deleted file mode 100644 index cb066cc..0000000 --- a/src/shared/components/common/symbols.tsx +++ /dev/null @@ -1,254 +0,0 @@ -export const SYMBOLS = ( - -); -- 2.44.1