mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: adding hydra shop constant
This commit is contained in:
parent
f428c522b6
commit
6e35600ffe
6 changed files with 15 additions and 9 deletions
|
@ -89,7 +89,12 @@ const handleDeepLinkPath = (uri?: string) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (url.host === "profile") {
|
if (url.host === "profile") {
|
||||||
WindowManager.redirect(`profile${url.search}`);
|
const userId = url.searchParams.get("userId");
|
||||||
|
|
||||||
|
if (userId) {
|
||||||
|
WindowManager.redirect(`profile/${userId}`);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,4 +15,4 @@ export const DOWNLOADER_NAME = {
|
||||||
|
|
||||||
export const MAX_MINUTES_TO_SHOW_IN_PLAYTIME = 120;
|
export const MAX_MINUTES_TO_SHOW_IN_PLAYTIME = 120;
|
||||||
|
|
||||||
export const WEB_STORE_URL = "https://hydrathemes.shop";
|
export const THEME_WEB_STORE_URL = "https://hydrathemes.shop";
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import type { GameShop } from "@types";
|
import type { GameShop } from "@types";
|
||||||
|
|
||||||
import Color from "color";
|
import Color from "color";
|
||||||
|
import { THEME_WEB_STORE_URL } from "./constants";
|
||||||
|
|
||||||
export const formatDownloadProgress = (
|
export const formatDownloadProgress = (
|
||||||
progress?: number,
|
progress?: number,
|
||||||
|
@ -61,7 +62,7 @@ export const injectCustomCss = (css: string) => {
|
||||||
currentCustomCss.remove();
|
currentCustomCss.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (css.startsWith("https://hydrathemes.shop/")) {
|
if (css.startsWith(THEME_WEB_STORE_URL)) {
|
||||||
const link = document.createElement("link");
|
const link = document.createElement("link");
|
||||||
link.id = "custom-css";
|
link.id = "custom-css";
|
||||||
link.rel = "stylesheet";
|
link.rel = "stylesheet";
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { useTranslation } from "react-i18next";
|
||||||
import { AddThemeModal, DeleteAllThemesModal } from "../index";
|
import { AddThemeModal, DeleteAllThemesModal } from "../index";
|
||||||
import "./theme-actions.scss";
|
import "./theme-actions.scss";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { WEB_STORE_URL } from "@renderer/constants";
|
import { THEME_WEB_STORE_URL } from "@renderer/constants";
|
||||||
|
|
||||||
interface ThemeActionsProps {
|
interface ThemeActionsProps {
|
||||||
onListUpdated: () => void;
|
onListUpdated: () => void;
|
||||||
|
@ -41,7 +41,7 @@ export const ThemeActions = ({
|
||||||
theme="primary"
|
theme="primary"
|
||||||
className="settings-appearance__button"
|
className="settings-appearance__button"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
window.open(WEB_STORE_URL, "_blank");
|
window.open(THEME_WEB_STORE_URL, "_blank");
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<GlobeIcon />
|
<GlobeIcon />
|
||||||
|
|
|
@ -7,7 +7,7 @@ import "./theme-card.scss";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { DeleteThemeModal } from "../modals/delete-theme-modal";
|
import { DeleteThemeModal } from "../modals/delete-theme-modal";
|
||||||
import { injectCustomCss, removeCustomCss } from "@renderer/helpers";
|
import { injectCustomCss, removeCustomCss } from "@renderer/helpers";
|
||||||
import { WEB_STORE_URL } from "@renderer/constants";
|
import { THEME_WEB_STORE_URL } from "@renderer/constants";
|
||||||
|
|
||||||
interface ThemeCardProps {
|
interface ThemeCardProps {
|
||||||
theme: Theme;
|
theme: Theme;
|
||||||
|
@ -104,7 +104,7 @@ export const ThemeCard = ({ theme, onListUpdated }: ThemeCardProps) => {
|
||||||
<div className="theme-card__actions__right">
|
<div className="theme-card__actions__right">
|
||||||
<Button
|
<Button
|
||||||
className={
|
className={
|
||||||
theme.code.startsWith(WEB_STORE_URL)
|
theme.code.startsWith(THEME_WEB_STORE_URL)
|
||||||
? "theme-card__actions__right--external"
|
? "theme-card__actions__right--external"
|
||||||
: ""
|
: ""
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import "./modals.scss";
|
||||||
import { Theme, UserProfile } from "@types";
|
import { Theme, UserProfile } from "@types";
|
||||||
import { injectCustomCss, removeCustomCss } from "@renderer/helpers";
|
import { injectCustomCss, removeCustomCss } from "@renderer/helpers";
|
||||||
import { useToast } from "@renderer/hooks";
|
import { useToast } from "@renderer/hooks";
|
||||||
import { WEB_STORE_URL } from "@renderer/constants";
|
import { THEME_WEB_STORE_URL } from "@renderer/constants";
|
||||||
|
|
||||||
interface ImportThemeModalProps {
|
interface ImportThemeModalProps {
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
|
@ -37,7 +37,7 @@ export const ImportThemeModal = ({
|
||||||
isActive: false,
|
isActive: false,
|
||||||
author: author?.id,
|
author: author?.id,
|
||||||
authorName: author?.displayName,
|
authorName: author?.displayName,
|
||||||
code: `${WEB_STORE_URL}/themes/${themeName}/theme.css`,
|
code: `${THEME_WEB_STORE_URL}/themes/${themeName}/theme.css`,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
updatedAt: new Date(),
|
updatedAt: new Date(),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue