mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-15 09:33:03 -04:00
spotifyControls: make title/artists of local tracks unclickable (#201)
Co-authored-by: Vendicated <vendicated@riseup.net>
This commit is contained in:
parent
58636a9a82
commit
15f12073cf
3 changed files with 30 additions and 25 deletions
|
@ -18,19 +18,18 @@
|
|||
|
||||
import { React } from "../webpack/common";
|
||||
|
||||
interface Props {
|
||||
href: string;
|
||||
interface Props extends React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> {
|
||||
disabled?: boolean;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
export function Link(props: React.PropsWithChildren<Props>) {
|
||||
if (props.disabled) {
|
||||
props.style ??= {};
|
||||
props.style.pointerEvents = "none";
|
||||
props["aria-disabled"] = true;
|
||||
}
|
||||
return (
|
||||
<a href={props.href} target="_blank" style={props.style}>
|
||||
<a role="link" target="_blank" {...props}>
|
||||
{props.children}
|
||||
</a>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue