|
@@ -6,6 +6,12 @@ type CustomLinkProps = {
|
|
children: ReactChild
|
|
children: ReactChild
|
|
to: string
|
|
to: string
|
|
disabled?: boolean
|
|
disabled?: boolean
|
|
|
|
+ className?: string
|
|
|
|
+ replace?: boolean
|
|
|
|
+ ref?: React.Ref<HTMLAnchorElement>
|
|
|
|
+ innerRef?: React.Ref<HTMLAnchorElement>
|
|
|
|
+ getProps?: any
|
|
|
|
+ state?: any
|
|
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void
|
|
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void
|
|
} & CustomLinkStyleProps
|
|
} & CustomLinkStyleProps
|
|
|
|
|
|
@@ -13,12 +19,29 @@ export default function CustomLink({
|
|
children,
|
|
children,
|
|
to = "",
|
|
to = "",
|
|
disabled = false,
|
|
disabled = false,
|
|
|
|
+ className = "",
|
|
|
|
+ replace = false,
|
|
|
|
+ ref = () => {},
|
|
|
|
+ innerRef = () => {},
|
|
|
|
+ getProps = () => {},
|
|
|
|
+ state = null,
|
|
onClick,
|
|
onClick,
|
|
- ...styleProps
|
|
|
|
|
|
+ ...props
|
|
}: CustomLinkProps) {
|
|
}: CustomLinkProps) {
|
|
|
|
|
|
- let styles = makeStyles(styleProps)
|
|
|
|
|
|
+ let styles = makeStyles(props)
|
|
|
|
|
|
if (disabled) return <label css={styles.disabled}>{children}</label>
|
|
if (disabled) return <label css={styles.disabled}>{children}</label>
|
|
- return <Link to={to} css={styles.regular}>{children}</Link>
|
|
|
|
|
|
+ return <Link
|
|
|
|
+ to={to}
|
|
|
|
+ css={styles.regular}
|
|
|
|
+ className={className}
|
|
|
|
+ replace={replace}
|
|
|
|
+ ref={ref}
|
|
|
|
+ innerRef={innerRef}
|
|
|
|
+ getProps={getProps}
|
|
|
|
+ state={state}
|
|
|
|
+ >
|
|
|
|
+ {children}
|
|
|
|
+ </Link>
|
|
}
|
|
}
|