// @flow import type { Node } from 'react'; import React, { forwardRef } from 'react'; import Icon from 'component/common/icon'; import classnames from 'classnames'; import { NavLink } from 'react-router-dom'; import { formatLbryUriForWeb } from 'util/uri'; import { OutboundLink } from 'react-ga'; import * as PAGES from 'constants/pages'; type Props = { id: ?string, href: ?string, title: ?string, label: ?string, icon: ?string, iconRight: ?string, disabled: ?boolean, children: ?Node, navigate: ?string, className: ?string, description: ?string, type: string, button: ?string, // primary, secondary, alt, link iconSize?: number, iconColor?: string, constrict: ?boolean, // to shorten the button and ellipsis, only use for links activeClass?: string, innerRef: ?any, // Events onClick: ?(any) => any, onMouseEnter: ?(any) => any, onMouseLeave: ?(any) => any, pathname: string, emailVerified: boolean, requiresAuth: ?boolean, myref: any, dispatch: any, }; // use forwardRef to allow consumers to pass refs to the button content if they want to // flow requires forwardRef have default type arguments passed to it const Button = forwardRef((props: Props, ref: any) => { const { type = 'button', onClick, href, title, label, icon, // This should rarely be used. Regular buttons should just use `icon` // `iconRight` is used for the header (home) button with the LBRY icon and external links that are displayed inline iconRight, disabled, children, navigate, className, description, button, iconSize, iconColor, constrict, activeClass, emailVerified, requiresAuth, myref, dispatch, // ); }); export default Button;