mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
explicitly define return types
This commit is contained in:
parent
ab2feb5119
commit
71a933346a
1 changed files with 3 additions and 2 deletions
|
|
@ -1,17 +1,18 @@
|
|||
import { Button } from 'antd';
|
||||
import { ButtonProps, ButtonType } from "antd/lib/button";
|
||||
import * as React from "react";
|
||||
import { JSXElement } from '@babel/types';
|
||||
|
||||
interface Props {
|
||||
name: string;
|
||||
viewUrl: string;
|
||||
};
|
||||
|
||||
export const SubscribeButton = (props: Props) => props.viewUrl
|
||||
export const SubscribeButton = (props: Props): JSX.Element | null => props.viewUrl
|
||||
? <Button {...buildButtonProps(props)}>Subscribe</Button>
|
||||
: null;
|
||||
|
||||
const buildButtonProps = (props: Props) => {
|
||||
const buildButtonProps = (props: Props): ButtonProps => {
|
||||
let type: ButtonType = "primary";
|
||||
|
||||
const hrefLocation = `${encodeURIComponent(props.viewUrl)}`;
|
||||
|
|
|
|||
Loading…
Reference in a new issue