From 49decf6b985bb88c577af469095120370909f844 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Sun, 1 Sep 2019 15:45:32 -0500 Subject: [PATCH] de-dup button def in SubscribeButtons --- .../src/components/SubscribeButtons.tsx | 36 +++++-------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/src/FilterLists.Web.V2/src/components/SubscribeButtons.tsx b/src/FilterLists.Web.V2/src/components/SubscribeButtons.tsx index fef26f4b7..ae00708bc 100644 --- a/src/FilterLists.Web.V2/src/components/SubscribeButtons.tsx +++ b/src/FilterLists.Web.V2/src/components/SubscribeButtons.tsx @@ -10,30 +10,10 @@ interface Props { export const SubscribeButtons = (props: Props) => <> - + ; -interface PrimaryButtonProps { - name: string; - viewUrl: string; -}; - -const PrimaryButton = (props: PrimaryButtonProps) => { - const buttonProps = buildButtonProps(props.name, props.viewUrl); - return ( - - ); -}; - interface MirrorButtonsProps { name: string; viewUrlMirrors: string[]; @@ -43,18 +23,18 @@ const MirrorButtons = (props: MirrorButtonsProps) => <> {props.viewUrlMirrors && props.viewUrlMirrors.length ? props.viewUrlMirrors.map((viewUrlMirror: string, i: number) => - ) + ) : null} ; -interface MirrorButtonProps { - index: number; - viewUrlMirror: string; +interface SubscribeButtonProps { name: string; + viewUrl: string; + text: string; }; -const MirrorButton = (props: MirrorButtonProps) => { - const buttonProps = buildButtonProps(props.name, props.viewUrlMirror); +const SubscribeButton = (props: SubscribeButtonProps) => { + const buttonProps = buildButtonProps(props.name, props.viewUrl); return ( ); };