From d626ed67f984c6786878a58e2feb1a75497d5eca Mon Sep 17 00:00:00 2001 From: MathieuG-P Date: Thu, 29 Dec 2022 11:07:10 +0100 Subject: [PATCH 1/6] add discord button in settings --- assets/jsons/translations/en.json | 3 +++ assets/jsons/translations/es.json | 3 +++ assets/jsons/translations/fr.json | 3 +++ .../components/svgs/bsm-icon.component.tsx | 4 +++- .../svgs/icons/discord-icon.component.tsx | 15 +++++++++++++++ src/renderer/pages/settings-page.component.tsx | 4 ++++ 6 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/renderer/components/svgs/icons/discord-icon.component.tsx diff --git a/assets/jsons/translations/en.json b/assets/jsons/translations/en.json index fa86f981..0987426f 100644 --- a/assets/jsons/translations/en.json +++ b/assets/jsons/translations/en.json @@ -134,6 +134,9 @@ "supporters": "Supporters" } }, + "discord": { + "description": "Join the BSManager community by joining our Discord!" + }, "contribution": { "description": "Suggest new features or report a bug to help improve BSManager!", "buttons": { diff --git a/assets/jsons/translations/es.json b/assets/jsons/translations/es.json index 579b8f1f..dc6ab660 100644 --- a/assets/jsons/translations/es.json +++ b/assets/jsons/translations/es.json @@ -134,6 +134,9 @@ "supporters": "Apoyos" } }, + "discord": { + "description": "¡Únete a la comunidad de BSManager uniéndote a nuestro Discord!" + }, "contribution": { "description": "¡Sugiera nuevas características o reporte un error para ayudar a mejorar BSManager!", "buttons": { diff --git a/assets/jsons/translations/fr.json b/assets/jsons/translations/fr.json index 74cd70dc..d6365a2b 100644 --- a/assets/jsons/translations/fr.json +++ b/assets/jsons/translations/fr.json @@ -134,6 +134,9 @@ "supporters": "Supporteurs" } }, + "discord":{ + "description": "Prends part à la communauté de BSManager en rejoignant notre Discord !" + }, "contribution": { "description": "Propose de nouvelles fonctionnalités ou signale un bug pour contribuer à l'amélioration de BSManager !", "buttons": { diff --git a/src/renderer/components/svgs/bsm-icon.component.tsx b/src/renderer/components/svgs/bsm-icon.component.tsx index 4b92f7cb..3b2624e2 100644 --- a/src/renderer/components/svgs/bsm-icon.component.tsx +++ b/src/renderer/components/svgs/bsm-icon.component.tsx @@ -43,9 +43,10 @@ import { LinkIcon } from "./icons/link-icon.component"; import { UnlinkIcon } from "./icons/unlink-icon.component"; import { DownloadIcon } from "./icons/download-icon.component"; import { FilterIcon } from "./icons/filter-icon.component"; +import DiscordIcon from "./icons/discord-icon.component"; export type BsmIconType = BsvMapCharacteristic | ( - "settings"|"trash"|"favorite"|"folder"|"bsNote"|"check"|"three-dots"|"twitch"|"eye"|"play"|"checkCircleIcon"| + "settings"|"trash"|"favorite"|"folder"|"bsNote"|"check"|"three-dots"|"twitch"|"eye"|"play"|"checkCircleIcon"|"discord"| "terminal"|"desktop"|"oculus"|"add"|"cross"|"task"|"github"|"close"|"thumbUpFill"|"timerFill"|"pause"| "copy"|"steam"|"edit"|"export"|"patreon"|"search"|"bsMapDifficulty"|"link"|"unlink"|"download"|"filter"| "fr-FR-flag"|"es-ES-flag"|"en-US-flag"|"en-EN-flag" @@ -97,6 +98,7 @@ export const BsmIcon = memo(({className, icon, style}: {className?: string, icon if(icon === "unlink"){ return } if(icon === "download"){ return } if(icon === "filter"){ return } + if(icon === "discord"){ return } return } diff --git a/src/renderer/components/svgs/icons/discord-icon.component.tsx b/src/renderer/components/svgs/icons/discord-icon.component.tsx new file mode 100644 index 00000000..9a4d0d19 --- /dev/null +++ b/src/renderer/components/svgs/icons/discord-icon.component.tsx @@ -0,0 +1,15 @@ +import { CSSProperties } from "react"; + +export default function DiscordIcon(props: {className?: string, style?: CSSProperties}) { + return ( + + + + + + + + + + ) +} diff --git a/src/renderer/pages/settings-page.component.tsx b/src/renderer/pages/settings-page.component.tsx index a8d002f1..39b5bb38 100644 --- a/src/renderer/pages/settings-page.component.tsx +++ b/src/renderer/pages/settings-page.component.tsx @@ -147,6 +147,7 @@ export function SettingsPage() { const openGithub = () => linkOpener.open("https://github.com/Zagrios/bs-manager"); const openReportBug = () => linkOpener.open("https://github.com/Zagrios/bs-manager/issues/new?assignees=Zagrios&labels=bug&template=-bug--bug-report.md&title=%5BBUG%5D+%3A+"); const openRequestFeatures = () => linkOpener.open("https://github.com/Zagrios/bs-manager/issues/new?assignees=Zagrios&labels=enhancement&template=-feat---feature-request.md&title=%5BFEAT.%5D+%3A+"); + const openDiscord = () => linkOpener.open("https://discord.gg/uSqbHVpKdV"); const openLogs = () => ipcService.sendLazy("open-logs"); @@ -283,6 +284,9 @@ export function SettingsPage() { + + +
From 45cbecb21e7288983a43491451085cdbef86018a Mon Sep 17 00:00:00 2001 From: MathieuG-P Date: Thu, 29 Dec 2022 12:22:35 +0100 Subject: [PATCH 2/6] add notification to enable OneClicks if not --- assets/jsons/translations/en.json | 8 +++ assets/jsons/translations/es.json | 8 +++ assets/jsons/translations/fr.json | 8 +++ .../notification-item.component.tsx | 2 +- .../settings/setting-container.component.tsx | 13 +++- .../pages/settings-page.component.tsx | 2 +- src/renderer/windows/App.tsx | 61 ++++++++++++++++++- 7 files changed, 97 insertions(+), 5 deletions(-) diff --git a/assets/jsons/translations/en.json b/assets/jsons/translations/en.json index 0987426f..26c91e56 100644 --- a/assets/jsons/translations/en.json +++ b/assets/jsons/translations/en.json @@ -252,6 +252,14 @@ "error":{ "description":"An unknown error occurred." } + }, + "check-all-enabled":{ + "title": "OneClick Disabled", + "description": "One or more OneClick installations are disabled. Go to settings to enable them.", + "actions":{ + "settings": "Settings", + "not-remind": "Do not remind me" + } } } } diff --git a/assets/jsons/translations/es.json b/assets/jsons/translations/es.json index dc6ab660..92030fdf 100644 --- a/assets/jsons/translations/es.json +++ b/assets/jsons/translations/es.json @@ -252,6 +252,14 @@ "error":{ "description":"Ocurrió un error desconocido." } + }, + "check-all-enabled":{ + "title": "OneClick deshabilitado", + "description": "Una o más instalaciones de OneClick están deshabilitadas. Vaya a la configuración para habilitarlas.", + "actions":{ + "settings": "Ajustes", + "not-remind": "No volver a recordarme" + } } } } diff --git a/assets/jsons/translations/fr.json b/assets/jsons/translations/fr.json index d6365a2b..b9eb7f7c 100644 --- a/assets/jsons/translations/fr.json +++ b/assets/jsons/translations/fr.json @@ -252,6 +252,14 @@ "error":{ "description":"Une erreur inconnue s'est produite." } + }, + "check-all-enabled":{ + "title": "OneClick désactivée(s)", + "description": "Une ou plusieurs installations OneClick sont désactivées. Rendez-vous dans les paramètres pour les activer.", + "actions":{ + "settings": "Paramètres", + "not-remind": "Ne plus me rappeler" + } } } } diff --git a/src/renderer/components/notification/notification-item.component.tsx b/src/renderer/components/notification/notification-item.component.tsx index a0838bd9..3e9522fb 100644 --- a/src/renderer/components/notification/notification-item.component.tsx +++ b/src/renderer/components/notification/notification-item.component.tsx @@ -37,7 +37,7 @@ export function NotificationItem({resolver, notification}: {resolver?: (value: N } return ( - +
diff --git a/src/renderer/components/settings/setting-container.component.tsx b/src/renderer/components/settings/setting-container.component.tsx index 9b625748..e86ced16 100644 --- a/src/renderer/components/settings/setting-container.component.tsx +++ b/src/renderer/components/settings/setting-container.component.tsx @@ -1,12 +1,21 @@ import { ReactNode } from "react"; import { useTranslation } from "renderer/hooks/use-translation.hook"; -export function SettingContainer({className, title, minorTitle, description, children}: {className?: string, title?: string, minorTitle?: string, description?: string, children?: ReactNode}) { +type Props = { + id?: string, + className?: string, + title?: string, + minorTitle?: string, + description?: string, + children?: ReactNode +} + +export function SettingContainer({id, className, title, minorTitle, description, children}: Props) { const t = useTranslation(); return ( -
+
{ title &&

{t(title)}

} { minorTitle &&

{t(minorTitle)}

} { description &&

{t(description)}

} diff --git a/src/renderer/pages/settings-page.component.tsx b/src/renderer/pages/settings-page.component.tsx index 39b5bb38..df45dda2 100644 --- a/src/renderer/pages/settings-page.component.tsx +++ b/src/renderer/pages/settings-page.component.tsx @@ -229,7 +229,7 @@ export function SettingsPage() { - +
  • diff --git a/src/renderer/windows/App.tsx b/src/renderer/windows/App.tsx index b4b95473..1cd2e173 100644 --- a/src/renderer/windows/App.tsx +++ b/src/renderer/windows/App.tsx @@ -1,6 +1,6 @@ import { NavBar } from "../components/nav-bar/nav-bar.component"; import TitleBar from "../components/title-bar/title-bar.component"; -import { Routes, Route, useLocation } from "react-router-dom"; +import { Routes, Route, useLocation, useNavigate } from "react-router-dom"; import { AvailableVersionsList } from "../pages/available-versions-list.components"; import { VersionViewer } from "../pages/version-viewer.component"; import { Modal } from "../components/modal/modal.component"; @@ -14,24 +14,83 @@ import { MapsPage } from "../pages/maps-page.component"; import "tailwindcss/tailwind.css"; import { BsmIframeView } from "../components/shared/bsm-map-preview.component"; import 'tippy.js/dist/tippy.css'; +import { MapsManagerService } from "renderer/services/maps-manager.service"; +import { PlaylistsManagerService } from "renderer/services/playlists-manager.service"; +import { ModelsManagerService } from "renderer/services/models-manager.service"; +import { NotificationService } from "renderer/services/notification.service"; +import { timer } from "rxjs"; +import { ConfigurationService } from "renderer/services/configuration.service"; export default function App() { const themeService = ThemeService.getInstance(); const pageState = PageStateService.getInstance(); + const maps = MapsManagerService.getInstance(); + const playlists = PlaylistsManagerService.getInstance(); + const models = ModelsManagerService.getInstance(); + const notification = NotificationService.getInstance(); + const config = ConfigurationService.getInstance(); const location = useLocation(); + const navigate = useNavigate(); useEffect(() => { themeService.theme$.subscribe(() => { if(themeService.isDark || (themeService.isOS && window.matchMedia('(prefers-color-scheme: dark)').matches)){ return document.documentElement.classList.add('dark'); } document.documentElement.classList.remove('dark'); }); + + checkOneClicks(); + }, []); + const checkOneClicks = async () => { + + if(config.get("not-remind-oneclick") === true){ return; } + + await timer(2_000).toPromise(); + + const oneClicks = await Promise.all([ + maps.isDeepLinksEnabled(), + playlists.isDeepLinksEnabled(), + models.isDeepLinksEnabled() + ]); + + if(!oneClicks.some(enabled => enabled === false)){ return; } + + const choice = await notification.notifyWarning({ + title: "notifications.settings.additional-content.deep-link.check-all-enabled.title", + desc: "notifications.settings.additional-content.deep-link.check-all-enabled.description", + duration: 10_000, + actions: [ + {id: "0", title: "notifications.settings.additional-content.deep-link.check-all-enabled.actions.settings"}, + {id: "1", title: "notifications.settings.additional-content.deep-link.check-all-enabled.actions.not-remind", cancel: true} + ] + }); + + if(choice === "0"){ + return navigate("/settings#one-clicks"); + } + + if(choice === "1"){ + config.set("not-remind-oneclick", true); + } + + } useEffect(() => { + pageState.setLocation(location); + + if(!location.hash){ return; } + + const hash = location.hash.replace("#", ""); + const el = document.getElementById(hash); + + if(!el){ return; } + + el.scrollIntoView({block: "start", behavior: "smooth"}); + }, [location]) From 2b14f52db96aaa2a45c6b8b4d9ab980ba0231180 Mon Sep 17 00:00:00 2001 From: MathieuG-P Date: Thu, 29 Dec 2022 15:10:48 +0100 Subject: [PATCH 3/6] just try to link maps after download a BS version --- src/main/ipcs/bs-download-ipcs.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/ipcs/bs-download-ipcs.ts b/src/main/ipcs/bs-download-ipcs.ts index 6d592c01..d9e8b748 100644 --- a/src/main/ipcs/bs-download-ipcs.ts +++ b/src/main/ipcs/bs-download-ipcs.ts @@ -5,6 +5,7 @@ import { IpcRequest } from 'shared/models/ipc'; import { InstallationLocationService } from '../services/installation-location.service'; import { UtilsService } from '../services/utils.service'; import { BsmException } from 'shared/models/bsm-exception.model'; +import { LocalMapsManagerService } from '../services/additional-content/local-maps-manager.service'; export interface InitDownloadInfoInterface { @@ -25,7 +26,8 @@ export interface DownloadInfo { } ipcMain.on('bs-download.start', async (event, request: IpcRequest) => { - BSInstallerService.getInstance().downloadBsVersion(request.args).then(res => { + BSInstallerService.getInstance().downloadBsVersion(request.args).then(async res => { + await LocalMapsManagerService.getInstance().linkVersionMaps(request.args.bsVersion, true).catch(e => {}); UtilsService.getInstance().ipcSend(request.responceChannel, {success: true, data: res}); }).catch(e => { UtilsService.getInstance().ipcSend(request.responceChannel, {success: false, data: e}); From 574b1fe41416c41897bd33db5fd4483d26a2bde7 Mon Sep 17 00:00:00 2001 From: MathieuG-P Date: Thu, 29 Dec 2022 16:53:15 +0100 Subject: [PATCH 4/6] add mods disclaimer --- assets/jsons/translations/en.json | 12 ++- assets/jsons/translations/es.json | 12 ++- assets/jsons/translations/fr.json | 12 ++- package-lock.json | 15 ++-- package.json | 1 - .../available-versions-slider.component.tsx | 2 +- .../maps-playlists-panel.component.tsx | 4 +- .../mods-disclaimer-modal.component.tsx | 28 +++++++ .../shared/tab-nav-bar.component.tsx | 9 +- .../slides/mods/mods-slide.component.tsx | 83 ++++++++++++------- .../pages/version-viewer.component.tsx | 8 +- 11 files changed, 132 insertions(+), 54 deletions(-) create mode 100644 src/renderer/components/modal/modal-types/mods-disclaimer-modal.component.tsx diff --git a/assets/jsons/translations/en.json b/assets/jsons/translations/en.json index 26c91e56..72422ef0 100644 --- a/assets/jsons/translations/en.json +++ b/assets/jsons/translations/en.json @@ -8,7 +8,9 @@ "playlists": "Playlists", "models": "Models", "cancel": "Cancel", - "delete": "Delete" + "delete": "Delete", + "accept": "Accept", + "refuse": "Refuse" }, "pages": { "version-viewer": { @@ -492,6 +494,14 @@ "download-maps": { "search-btn": "Search", "loading-maps": "Loading maps..." + }, + "mods-disclaimer":{ + "title": "disclaimer", + "p-1": "By choosing to use mods, you understand that:", + "li-1": "You may experience problems that don't exist in the vanilla game. 99.9% of bugs, crashes, and lag are due to mods.", + "li-2": "Mods are subject to being broken by updates and that's normal - be patient and respectful when this happens, as modders are volunteers with real lives.", + "li-3": "Beat Games aren't purposefully trying to break mods. They wish to work on the codebase and sometimes this breaks mods, but they are not out to kill mods.", + "p-2": "Do not attack the game developers for issues related to mods, and vice versa - modders and game developers are two separate groups. Just don't be a jerk ok." } }, "maps": { diff --git a/assets/jsons/translations/es.json b/assets/jsons/translations/es.json index 92030fdf..8c453fd6 100644 --- a/assets/jsons/translations/es.json +++ b/assets/jsons/translations/es.json @@ -8,7 +8,9 @@ "playlists": "Playlists", "models": "Modelos", "cancel": "Cancelar", - "delete": "Borrar" + "delete": "Borrar", + "accept": "Aceptar", + "refuse": "Rechazar" }, "pages": { "version-viewer": { @@ -492,6 +494,14 @@ "download-maps": { "search-btn": "buscar", "loading-maps": "Cargando mapas..." + }, + "mods-disclaimer":{ + "title": "descargo de responsabilidad", + "p-1": "Al elegir usar mods, entiendes y aceptas que:", + "li-1": "Es posible que encuentres problemas que no existen en el juego base. El 99,9% de los errores, bloqueos y ralentizaciones son debidos a los mods.", + "li-2": "Es probable que los mods dejen de funcionar debido a las actualizaciones y eso es normal. Sé paciente y respetuoso cuando suceda esto, ya que los modders son voluntarios y tienen una vida.", + "li-3": "Beat Games no está intencionalmente tratando de romper los mods. Quieren mejorar el juego base y a veces esto rompe los mods, pero no es su objetivo matar a los mods.", + "p-2": "No ataques a los desarrolladores por problemas relacionados con los mods y viceversa. Los modders y los desarrolladores son dos grupos distintos. No seas tonto, ¿de acuerdo?" } }, "maps": { diff --git a/assets/jsons/translations/fr.json b/assets/jsons/translations/fr.json index b9eb7f7c..69801494 100644 --- a/assets/jsons/translations/fr.json +++ b/assets/jsons/translations/fr.json @@ -8,7 +8,9 @@ "playlists": "Playlists", "models": "Modèles", "cancel": "Annuler", - "delete": "Supprimer" + "delete": "Supprimer", + "accept": "Accepter", + "refuse": "Refuser" }, "pages": { "version-viewer": { @@ -492,6 +494,14 @@ "download-maps": { "search-btn": "Rechercher", "loading-maps": "Chargement des maps..." + }, + "mods-disclaimer":{ + "title": "avis de non-responsabilité", + "p-1": "En choisissant d'utiliser des mods, vous comprenez et acceptez que :", + "li-1": "Vous pouvez rencontrer des problèmes qui n'existent pas dans le jeu de base. 99.9% des bugs, plantages et ralentissements sont dus aux mods.", + "li-2": "Les mods sont susceptibles de ne plus fonctionner à cause des mises à jour et c'est normal - soyez patient et respectueux lorsque cela se produit, parce que les moddeurs sont bénévoles et ont une vie.", + "li-3": "Beat Games ne cherche pas volontairement à casser les mods. Ils souhaitent améliorer la base du jeu et parfois cela casse les mods, mais ce n'est pas dans leur objectif de tuer les mods.", + "p-2": "N'attaquez pas les développeurs pour des problèmes relatifs aux mods, et inversement - les moddeurs et les développeurs sont deux groupes distincts. Ne sois pas idiot, d'accord ?" } }, "maps": { diff --git a/package-lock.json b/package-lock.json index c3ec072d..198d71cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10354,7 +10354,8 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true }, "object-hash": { "version": "3.0.0", @@ -11280,6 +11281,7 @@ "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, "requires": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", @@ -11672,7 +11674,8 @@ "react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true }, "react-range": { "version": "1.8.14", @@ -11737,14 +11740,6 @@ } } }, - "react-visibility-sensor": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/react-visibility-sensor/-/react-visibility-sensor-5.1.1.tgz", - "integrity": "sha512-cTUHqIK+zDYpeK19rzW6zF9YfT4486TIgizZW53wEZ+/GPBbK7cNS0EHyJVyHYacwFEvvHLEKfgJndbemWhB/w==", - "requires": { - "prop-types": "^15.7.2" - } - }, "read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", diff --git a/package.json b/package.json index e4873efe..70a985dd 100644 --- a/package.json +++ b/package.json @@ -244,7 +244,6 @@ "react-dom": "^18.2.0", "react-range": "^1.8.14", "react-router-dom": "^6.3.0", - "react-visibility-sensor": "^5.1.1", "regedit": "^5.1.1", "rxjs": "^7.5.6", "sanitize-filename": "^1.6.3", diff --git a/src/renderer/components/available-versions/available-versions-slider.component.tsx b/src/renderer/components/available-versions/available-versions-slider.component.tsx index 01bf8fe7..e87439ce 100644 --- a/src/renderer/components/available-versions/available-versions-slider.component.tsx +++ b/src/renderer/components/available-versions/available-versions-slider.component.tsx @@ -23,7 +23,7 @@ export function AvailableVersionsSlider() { return (
    - +
      { availableYears.map(year => diff --git a/src/renderer/components/maps-mangement-components/maps-playlists-panel.component.tsx b/src/renderer/components/maps-mangement-components/maps-playlists-panel.component.tsx index d0170256..4c9a1fb7 100644 --- a/src/renderer/components/maps-mangement-components/maps-playlists-panel.component.tsx +++ b/src/renderer/components/maps-mangement-components/maps-playlists-panel.component.tsx @@ -82,7 +82,7 @@ export function MapsPlaylistsPanel({version}: Props) { {index === 0 &&(
      {isOnline && ( - {e.stopPropagation(); onClickAdd(index)}}> + {e.stopPropagation(); onClickAdd(index)}}> @@ -128,7 +128,7 @@ export function MapsPlaylistsPanel({version}: Props) {
      - +
      diff --git a/src/renderer/components/modal/modal-types/mods-disclaimer-modal.component.tsx b/src/renderer/components/modal/modal-types/mods-disclaimer-modal.component.tsx new file mode 100644 index 00000000..3dfa2d5f --- /dev/null +++ b/src/renderer/components/modal/modal-types/mods-disclaimer-modal.component.tsx @@ -0,0 +1,28 @@ +import { BsmButton } from "renderer/components/shared/bsm-button.component"; +import { BsmImage } from "renderer/components/shared/bsm-image.component"; +import { useTranslation } from "renderer/hooks/use-translation.hook"; +import { ModalComponent, ModalExitCode } from "renderer/services/modale.service"; +import BeatConflict from '../../../../../assets/images/apngs/beat-conflict.png' + +export const ModsDisclaimerModal: ModalComponent = ({resolver}) => { + + const t = useTranslation(); + + return ( +
      +

      {t("modals.mods-disclaimer.title")}

      + +

      {t("modals.mods-disclaimer.p-1")}

      +
        +
      • {t("modals.mods-disclaimer.li-1")}
      • +
      • {t("modals.mods-disclaimer.li-2")}
      • +
      • {t("modals.mods-disclaimer.li-3")}
      • +
      +

      {t("modals.mods-disclaimer.p-2")}

      +
      + {resolver({exitCode: ModalExitCode.CANCELED})}} withBar={false} text="misc.refuse"/> + {resolver({exitCode: ModalExitCode.COMPLETED})}} withBar={false} text="misc.accept"/> +
      + + ) +} \ No newline at end of file diff --git a/src/renderer/components/shared/tab-nav-bar.component.tsx b/src/renderer/components/shared/tab-nav-bar.component.tsx index 4907d3cb..68fdfb0f 100644 --- a/src/renderer/components/shared/tab-nav-bar.component.tsx +++ b/src/renderer/components/shared/tab-nav-bar.component.tsx @@ -1,8 +1,9 @@ -import { DetailedHTMLProps, Fragment, useState } from "react"; +import { DetailedHTMLProps, Fragment } from "react"; import { useThemeColor } from "renderer/hooks/use-theme-color.hook"; import { useTranslation } from "renderer/hooks/use-translation.hook"; type Props = { + tabIndex: number tabsText: string[], onTabChange: (index: number) => void, className?: string, @@ -11,12 +12,12 @@ type Props = { export function TabNavBar(props: Props) { - const [currentTabIndex, setCurrentTabIndex] = useState(0); + const currentIndex = props.tabIndex ?? 0; + const t = useTranslation(); const secondColor = useThemeColor("second-color"); const selectTab = (index: number) => { - setCurrentTabIndex(index); props.onTabChange(index); } @@ -24,7 +25,7 @@ export function TabNavBar(props: Props) {