viewUrl is always required and should never be null/undefined

This commit is contained in:
Collin M. Barrett 2019-08-07 15:18:38 -05:00
parent 3cf55967ce
commit 32e137ec1b

View file

@ -13,14 +13,12 @@ interface Props {
viewUrlMirrors: string[];
};
export const SubscribeButton = (props: Props): JSX.Element | null =>
export const SubscribeButton = (props: Props): JSX.Element =>
(props.viewUrlMirrors && props.viewUrlMirrors.length > 0)
? <SubscribeButtonDropdown {...props} />
: props.viewUrl
? <div>
<Button className={"single"} size="small" {...buildButtonProps(props.name, props.viewUrl)}>Subscribe</Button>
</div>
: null;
: <div>
<Button className={"single"} size="small" {...buildButtonProps(props.name, props.viewUrl)}>Subscribe</Button>
</div>;
const SubscribeButtonDropdown = (props: Props): JSX.Element => {
var buttonProps = buildButtonProps(props.name, props.viewUrl);