mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-24 19:31:03 +00:00
feat: add deep link theme installation support
This commit is contained in:
@@ -61,13 +61,20 @@ export const injectCustomCss = (css: string) => {
|
||||
currentCustomCss.remove();
|
||||
}
|
||||
|
||||
const style = document.createElement("style");
|
||||
|
||||
style.id = "custom-css";
|
||||
style.textContent = `
|
||||
${css}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
if (css.startsWith("https://hydrathemes.shop/")) {
|
||||
const link = document.createElement("link");
|
||||
link.id = "custom-css";
|
||||
link.rel = "stylesheet";
|
||||
link.href = css;
|
||||
document.head.appendChild(link);
|
||||
} else {
|
||||
const style = document.createElement("style");
|
||||
style.id = "custom-css";
|
||||
style.textContent = `
|
||||
${css}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("failed to inject custom css:", error);
|
||||
}
|
||||
|
||||
@@ -85,6 +85,10 @@
|
||||
flex-direction: row;
|
||||
gap: 8px;
|
||||
|
||||
&--external {
|
||||
display: none;
|
||||
}
|
||||
|
||||
Button {
|
||||
padding: 8px 11px;
|
||||
}
|
||||
|
||||
@@ -111,6 +111,7 @@ export const ThemeCard = ({ theme, onListUpdated }: ThemeCardProps) => {
|
||||
|
||||
<div className="theme-card__actions__right">
|
||||
<Button
|
||||
className={theme.code.startsWith("https://hydrathemes.shop/") ? "theme-card__actions__right--external" : ""}
|
||||
onClick={() => window.electron.openEditorWindow(theme.id)}
|
||||
title={t("edit_theme")}
|
||||
theme="outline"
|
||||
|
||||
Reference in New Issue
Block a user