Move symbols to its own cacheable file. Fixes #809 (#862)

This commit is contained in:
Dessalines 2022-11-18 13:28:05 -05:00 committed by GitHub
parent f90fa6dd3b
commit 6e3a6a601b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 258 additions and 263 deletions

View file

@ -158,7 +158,7 @@
position: absolute; position: absolute;
background-color: var(--light); background-color: var(--light);
min-width: 160px; 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; z-index: 2000;
} }
@ -368,7 +368,7 @@ br.big {
} }
.honeypot { .honeypot {
display:none !important; display: none !important;
} }
.slight-radius { .slight-radius {
@ -376,7 +376,7 @@ br.big {
} }
.modlog-choices-font-size { .modlog-choices-font-size {
font-size: .9375rem !important; font-size: 0.9375rem !important;
} }
.preview-lines { .preview-lines {

252
src/assets/symbols.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 52 KiB

View file

@ -12,7 +12,6 @@ import path from "path";
import process from "process"; import process from "process";
import serialize from "serialize-javascript"; import serialize from "serialize-javascript";
import { App } from "../shared/components/app/app"; import { App } from "../shared/components/app/app";
import { SYMBOLS } from "../shared/components/common/symbols";
import { httpBaseInternal } from "../shared/env"; import { httpBaseInternal } from "../shared/env";
import { import {
ILemmyConfig, ILemmyConfig,
@ -186,7 +185,6 @@ server.get("/*", async (req, res) => {
); );
const erudaStr = process.env["LEMMY_UI_DEBUG"] ? renderToString(eruda) : ""; const erudaStr = process.env["LEMMY_UI_DEBUG"] ? renderToString(eruda) : "";
const root = renderToString(wrapper); const root = renderToString(wrapper);
const symbols = renderToString(SYMBOLS);
const helmet = Helmet.renderStatic(); const helmet = Helmet.renderStatic();
const config: ILemmyConfig = { wsHost: process.env.LEMMY_UI_LEMMY_WS_HOST }; const config: ILemmyConfig = { wsHost: process.env.LEMMY_UI_LEMMY_WS_HOST };
@ -221,9 +219,6 @@ server.get("/*", async (req, res) => {
<!-- Current theme and more --> <!-- Current theme and more -->
${helmet.link.toString()} ${helmet.link.toString()}
<!-- Icons -->
${symbols}
</head> </head>
<body ${helmet.bodyAttributes.toString()}> <body ${helmet.bodyAttributes.toString()}>

View file

@ -22,7 +22,9 @@ export class Icon extends Component<IconProps, any> {
small: this.props.small, small: this.props.small,
})} })}
> >
<use xlinkHref={`#icon-${this.props.icon}`}></use> <use
xlinkHref={`/static/assets/symbols.svg#icon-${this.props.icon}`}
></use>
<div className="sr-only"> <div className="sr-only">
<title>{this.props.icon}</title> <title>{this.props.icon}</title>
</div> </div>

File diff suppressed because one or more lines are too long