diff --git a/assets/jsons/translations/en.json b/assets/jsons/translations/en.json index 1d612590..0c3adea2 100644 --- a/assets/jsons/translations/en.json +++ b/assets/jsons/translations/en.json @@ -89,7 +89,14 @@ "support": "Support BSManager", "supporters":"Supporters 👀" } - + }, + "contribution":{ + "description":"Suggest new features or report a bug to help improve BSManager!", + "buttons":{ + "request-features":"Request a feature", + "report-bug":"Report a bug", + "open-logs": "Open logs" + } } } }, diff --git a/assets/jsons/translations/es.json b/assets/jsons/translations/es.json index 7843d4bc..69d63752 100644 --- a/assets/jsons/translations/es.json +++ b/assets/jsons/translations/es.json @@ -89,8 +89,16 @@ "support": "Apoyo BSManager", "supporters":"Apoyos 👀" } + }, + "contribution":{ + "description":"¡Sugiera nuevas características o reporte un error para ayudar a mejorar BSManager!", + "buttons":{ + "request-features":"Proponer una funcionalidad", + "report-bug":"Informar de un error", + "open-logs": "Abrir los registros" + } } - } + } }, "notifications":{ diff --git a/assets/jsons/translations/fr.json b/assets/jsons/translations/fr.json index 71d036d0..99ada023 100644 --- a/assets/jsons/translations/fr.json +++ b/assets/jsons/translations/fr.json @@ -89,7 +89,14 @@ "support": "Soutenir BSManager", "supporters":"Supporteurs 👀" } - + }, + "contribution":{ + "description":"Propose de nouvelles fonctionnalités ou signale un bug pour contribuer à l'amélioration de BSManager !", + "buttons":{ + "request-features":"Proposer une fonctionnalité", + "report-bug":"Signaler un bug", + "open-logs": "Ouvrir les logs" + } } } }, diff --git a/src/main/ipcs/os-controls-ipcs.ts b/src/main/ipcs/os-controls-ipcs.ts index ceda3cc6..fe258a84 100644 --- a/src/main/ipcs/os-controls-ipcs.ts +++ b/src/main/ipcs/os-controls-ipcs.ts @@ -48,3 +48,7 @@ ipcMain.on('save-file', async (event, request: IpcRequest<{filename?: string, fi ipcMain.on("current-version", async (event, request: IpcRequest) => { UtilsService.getInstance().ipcSend(request.responceChannel, {success: true, data: app.getVersion()}); }); + +ipcMain.on("open-logs", async (event, request: IpcRequest) => { + shell.openPath(app.getPath("logs")); +}); diff --git a/src/renderer/components/shared/bsm-button.component.tsx b/src/renderer/components/shared/bsm-button.component.tsx index c577b212..82eb20cb 100644 --- a/src/renderer/components/shared/bsm-button.component.tsx +++ b/src/renderer/components/shared/bsm-button.component.tsx @@ -23,10 +23,11 @@ type propsType = { onClickOutside?: (e: MouseEvent) => void, onClick?: (e: React.MouseEvent) => void, typeColor?:BsmButtonType, - color?: string + color?: string, + title?: string, } -export function BsmButton({className, style, imgClassName, iconClassName, icon, image, text, type, active, withBar = true, disabled, onClickOutside, onClick, typeColor, color}: propsType) { +export function BsmButton({className, style, imgClassName, iconClassName, icon, image, text, type, active, withBar = true, disabled, onClickOutside, onClick, typeColor, color, title}: propsType) { const t = useTranslation(); const secondColor = useThemeColor("second-color"); @@ -49,7 +50,7 @@ export function BsmButton({className, style, imgClassName, iconClassName, icon, return ( onClickOutside && onClickOutside(e)}> -
+
{ image && } { icon && } {text && (type === "submit" ? : {t(text)})} diff --git a/src/renderer/components/svgs/bsm-icon.component.tsx b/src/renderer/components/svgs/bsm-icon.component.tsx index 46281e2a..634d43b6 100644 --- a/src/renderer/components/svgs/bsm-icon.component.tsx +++ b/src/renderer/components/svgs/bsm-icon.component.tsx @@ -22,10 +22,11 @@ import PatreonIcon from "./icons/patreon-icon.component"; import { SearchIcon } from "./icons/search-icon.component"; import { CheckIcon } from "./icons/check-icon.component"; import { ThreeDotsIcon } from "./icons/three-dots-icon.component"; +import { GitHubIcon } from "./icons/github-icon.component"; export type BsmIconType = ( "settings"|"trash"|"favorite"|"folder"|"bsNote"|"check"|"three-dots"| - "terminal"|"desktop"|"oculus"|"add"|"cross"|"task"| + "terminal"|"desktop"|"oculus"|"add"|"cross"|"task"|"github"| "copy"|"steam"|"edit"|"export"|"patreon"|"search"| "fr-FR-flag"|"es-ES-flag"|"en-US-flag"|"en-EN-flag" ); @@ -56,6 +57,7 @@ export const BsmIcon = memo(({className, icon, style}: {className?: string, icon if(icon === "search"){ return } if(icon === "check"){ return } if(icon === "three-dots"){ return } + if(icon === "github"){ return } return } diff --git a/src/renderer/components/svgs/icons/github-icon.component.tsx b/src/renderer/components/svgs/icons/github-icon.component.tsx new file mode 100644 index 00000000..67c4e6cc --- /dev/null +++ b/src/renderer/components/svgs/icons/github-icon.component.tsx @@ -0,0 +1,9 @@ +import { CSSProperties } from 'react' + +export function GitHubIcon(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 901e5ada..5a5ce15f 100644 --- a/src/renderer/pages/settings-page.component.tsx +++ b/src/renderer/pages/settings-page.component.tsx @@ -17,6 +17,7 @@ import { NotificationService } from "renderer/services/notification.service"; import { ProgressBarService } from "renderer/services/progress-bar.service"; import { ThemeService } from "renderer/services/theme.service"; import { SupportersView } from "renderer/components/settings/supporters-view/supporters-view.component"; +import { LinkOpenerService } from "renderer/services/link-opener.service"; export function SettingsPage() { @@ -29,6 +30,7 @@ export function SettingsPage() { const authService: AuthUserService = AuthUserService.getInstance(); const notificationService: NotificationService = NotificationService.getInstance(); const i18nService: I18nService = I18nService.getInstance(); + const linkOpener: LinkOpenerService = LinkOpenerService.getInstance(); const {firstColor, secondColor} = useThemeColor(); const sessionExist = useObservable(authService.sessionExist$); @@ -111,13 +113,19 @@ export function SettingsPage() { }; const openPatreonPage = () => { - ipcService.sendLazy("new-window", {args: "https://www.patreon.com/bsmanager?fan_landing=true"}) + linkOpener.open("https://www.patreon.com/bsmanager?fan_landing=true"); } const toogleShowSupporters = () => { setShowSupporters(show => !show); } + 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_report.md&title=%5BBUG%5D"); + const openRequestFeatures = () => linkOpener.open("https://github.com/Zagrios/bs-manager/issues/new?assignees=Zagrios&labels=enhancement&template=feature_request.md&title=%5BAME%5D"); + + const openLogs = () => ipcService.sendLazy("open-logs"); + return (
@@ -156,6 +164,18 @@ export function SettingsPage() {
+ +
+
+ + +
+
+ + +
+
+
v{appVersion} diff --git a/src/renderer/services/link-opener.service.ts b/src/renderer/services/link-opener.service.ts new file mode 100644 index 00000000..5df418c1 --- /dev/null +++ b/src/renderer/services/link-opener.service.ts @@ -0,0 +1,22 @@ +import { IpcService } from "./ipc.service"; + +export class LinkOpenerService{ + + private static instance: LinkOpenerService; + + private readonly ipcService: IpcService + + public static getInstance(): LinkOpenerService{ + if(!LinkOpenerService.instance){ LinkOpenerService.instance = new LinkOpenerService(); } + return LinkOpenerService.instance; + } + + private constructor(){ + this.ipcService = IpcService.getInstance(); + } + + public open(url: string): void{ + this.ipcService.sendLazy("new-window", {args: url}); + } + +} \ No newline at end of file