use link opener service everywhere

This commit is contained in:
MathieuG-P
2022-10-19 22:46:28 +02:00
parent 4f41cd2cf3
commit 0dfdba702d
3 changed files with 10 additions and 10 deletions
@@ -1,16 +1,16 @@
import React, { CSSProperties } from "react";
import { CSSProperties } from "react";
import { Supporter } from "shared/models/supporters";
import { motion } from "framer-motion";
import txtBg from "../../../../../assets/images/gifs/txt-bg.gif"
import { IpcService } from "renderer/services/ipc.service";
import { LinkOpenerService } from "renderer/services/link-opener.service";
interface Props { supporter: Supporter, delay?: number }
export function SupporterItem({supporter, delay}: Props) {
const ipcService = IpcService.getInstance();
const linkOpener = LinkOpenerService.getInstance();
const openSupporterLink = () => supporter.link && ipcService.sendLazy("new-window", {args: supporter.link});
const openSupporterLink = () => supporter.link && linkOpener.open(supporter.link);
const additionnalStyles: CSSProperties = (() => {
const commonStyles: CSSProperties = {backgroundImage: `url(${txtBg})`, backgroundRepeat: "no-repeat", backgroundPosition: "center"}