diff --git a/src/FilterLists.Web.V2/src/components/SubscribeButtons.tsx b/src/FilterLists.Web.V2/src/components/SubscribeButtons.tsx index e544a68b7..fef26f4b7 100644 --- a/src/FilterLists.Web.V2/src/components/SubscribeButtons.tsx +++ b/src/FilterLists.Web.V2/src/components/SubscribeButtons.tsx @@ -1,5 +1,5 @@ import { Button } from 'antd'; -import { ButtonProps, ButtonType } from 'antd/lib/button'; +import { ButtonType } from 'antd/lib/button'; import React from 'react'; interface Props { @@ -10,28 +10,40 @@ interface Props { export const SubscribeButtons = (props: Props) => <> - - + + ; -const PrimaryButton = (props: Props) => { +interface PrimaryButtonProps { + name: string; + viewUrl: string; +}; + +const PrimaryButton = (props: PrimaryButtonProps) => { const buttonProps = buildButtonProps(props.name, props.viewUrl); return ( - ); }; -const MirrorButtons = (props: Props) => +interface MirrorButtonsProps { + name: string; + viewUrlMirrors: string[]; +}; + +const MirrorButtons = (props: MirrorButtonsProps) => <> {props.viewUrlMirrors && props.viewUrlMirrors.length ? props.viewUrlMirrors.map((viewUrlMirror: string, i: number) => - - ) + ) : null} ; @@ -45,16 +57,18 @@ const MirrorButton = (props: MirrorButtonProps) => { const buttonProps = buildButtonProps(props.name, props.viewUrlMirror); return ( ); }; -const buildButtonProps = (name: string, viewUrl: string): [ButtonProps, boolean] => { +const buildButtonProps = (name: string, viewUrl: string) => { let type: ButtonType = "primary"; let disabled: boolean = false; @@ -86,5 +100,5 @@ const buildButtonProps = (name: string, viewUrl: string): [ButtonProps, boolean] const title = `${prefixes.length ? prefixes.join(" | ") + " | " : ""}${message}`; - return [{ type, href, title }, disabled]; + return { disabled, type, href, title }; }; \ No newline at end of file