mirror of
https://github.com/Radarr/Radarr
synced 2025-12-06 08:28:50 +01:00
(cherry picked from commit e1cbc4a78249881de96160739a50c0a399ea4313) Closes #10378 Fixed: Links tooltip closing too quickly (cherry picked from commit 0b9a212f33381d07ff67e2453753aaab64cc8041) Closes #10400 Fixed: Movie links not opening on iOS (cherry picked from commit f20ac9dc348e1f5ded635f12ab925d982b1b8957) Closes #10425
39 lines
910 B
TypeScript
39 lines
910 B
TypeScript
import React from 'react';
|
|
import Link, { LinkProps } from 'Components/Link/Link';
|
|
import styles from './Card.css';
|
|
|
|
interface CardProps extends Pick<LinkProps, 'onPress'> {
|
|
// TODO: Consider using different properties for classname depending if it's overlaying content or not
|
|
className?: string;
|
|
overlayClassName?: string;
|
|
overlayContent?: boolean;
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
function Card(props: CardProps) {
|
|
const {
|
|
className = styles.card,
|
|
overlayClassName = styles.overlay,
|
|
overlayContent = false,
|
|
children,
|
|
onPress,
|
|
} = props;
|
|
|
|
if (overlayContent) {
|
|
return (
|
|
<div className={className}>
|
|
<Link className={styles.underlay} onPress={onPress} />
|
|
|
|
<div className={overlayClassName}>{children}</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<Link className={className} onPress={onPress}>
|
|
{children}
|
|
</Link>
|
|
);
|
|
}
|
|
|
|
export default Card;
|