mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-07-25 04:55:58 -04:00
migrate to prisma accelerate
https://prismaio.notion.site/Migration-Guide-For-Data-Proxy-Users-Moving-to-Prisma-Accelerate-5df9
This commit is contained in:
@@ -43,7 +43,7 @@ const Link = ({ href, rel, target, prefetch = false, underline = true, openInNew
|
||||
// links) or a new tab (the default for external links). Defaults can be overridden with `openInNewTab={true}`.
|
||||
const isExternal =
|
||||
typeof href === "string" &&
|
||||
!(href.startsWith("/") || href.startsWith("#") || (process.env.BASE_URL && href.startsWith(process.env.BASE_URL)));
|
||||
!(href[0] === "/" || href[0] === "#" || (process.env.BASE_URL && href.startsWith(process.env.BASE_URL)));
|
||||
|
||||
if (openInNewTab || isExternal) {
|
||||
return (
|
||||
|
||||
@@ -5,11 +5,13 @@
|
||||
export const restoreTheme = () => {
|
||||
// `try/catch` in case I messed something up here bigly... (will default to light theme)
|
||||
try {
|
||||
// map of themes -> classnames ([0]=light, [1]=dark)
|
||||
const classNames = ["__CLASS_NAMES__"];
|
||||
// help minifier minify
|
||||
const htmlRoot = document.documentElement;
|
||||
// the list of <html>'s current class(es)...
|
||||
// eslint-disable-next-line prefer-destructuring
|
||||
const classList = document.documentElement.classList;
|
||||
const classList = htmlRoot.classList;
|
||||
// map of themes -> classnames ([0]=light, [1]=dark)
|
||||
const classNames = ["__CLASS_NAMES__"];
|
||||
// user's saved preference
|
||||
const pref = typeof Storage !== "undefined" ? window.localStorage.getItem("__STORAGE_KEY__") : null;
|
||||
|
||||
@@ -21,6 +23,9 @@ export const restoreTheme = () => {
|
||||
classList.remove(...classNames);
|
||||
|
||||
// ...and then FINALLY set the root class
|
||||
classList.add(classNames[newTheme]);
|
||||
classList.add(classNames[newTheme] || "");
|
||||
|
||||
// set "color-scheme" inline css property
|
||||
htmlRoot.style.colorScheme = newTheme === 1 ? "dark" : "light";
|
||||
} catch (error) {} // eslint-disable-line no-empty
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user