mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use anchor for onClick
This commit is contained in:
parent
88f9c3d31b
commit
7eda53f795
1 changed files with 21 additions and 11 deletions
|
@ -30,9 +30,7 @@ const createIconButtonElement = ({ is, id, className, title, icon, dataIndex, da
|
||||||
});
|
});
|
||||||
|
|
||||||
const IconButtonElement: FunctionComponent<IProps> = ({ is, id, className, title, icon, dataIndex, dataTag, dataProfileid, onClick }: IProps) => {
|
const IconButtonElement: FunctionComponent<IProps> = ({ is, id, className, title, icon, dataIndex, dataTag, dataProfileid, onClick }: IProps) => {
|
||||||
return (
|
const button = createIconButtonElement({
|
||||||
<div
|
|
||||||
dangerouslySetInnerHTML={createIconButtonElement({
|
|
||||||
is: is,
|
is: is,
|
||||||
id: id ? `id="${id}"` : '',
|
id: id ? `id="${id}"` : '',
|
||||||
className: className,
|
className: className,
|
||||||
|
@ -41,9 +39,21 @@ const IconButtonElement: FunctionComponent<IProps> = ({ is, id, className, title
|
||||||
dataIndex: (dataIndex || dataIndex === 0) ? `data-index="${dataIndex}"` : '',
|
dataIndex: (dataIndex || dataIndex === 0) ? `data-index="${dataIndex}"` : '',
|
||||||
dataTag: dataTag ? `data-tag="${dataTag}"` : '',
|
dataTag: dataTag ? `data-tag="${dataTag}"` : '',
|
||||||
dataProfileid: dataProfileid ? `data-profileid="${dataProfileid}"` : ''
|
dataProfileid: dataProfileid ? `data-profileid="${dataProfileid}"` : ''
|
||||||
})}
|
});
|
||||||
|
|
||||||
|
if (onClick !== undefined) {
|
||||||
|
return (
|
||||||
|
<a
|
||||||
|
dangerouslySetInnerHTML={button}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
/>
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
dangerouslySetInnerHTML={button}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue