mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-11 23:58:46 +00:00
yaml validation
This commit is contained in:
parent
b5065673ab
commit
17f54da524
11 changed files with 83 additions and 32 deletions
|
@ -22,12 +22,6 @@ function resolveIcon(icon) {
|
|||
}
|
||||
|
||||
export default function Item({ service }) {
|
||||
const handleOnClick = () => {
|
||||
if (service.href && service.href !== "#") {
|
||||
window.open(service.href, "_blank").focus();
|
||||
}
|
||||
};
|
||||
|
||||
const hasLink = service.href && service.href !== "#";
|
||||
|
||||
return (
|
||||
|
@ -41,13 +35,9 @@ export default function Item({ service }) {
|
|||
<div className="flex select-none">
|
||||
{service.icon &&
|
||||
(hasLink ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleOnClick}
|
||||
className="flex-shrink-0 flex items-center justify-center w-12 "
|
||||
>
|
||||
<a type="button" href={service.href} className="flex-shrink-0 flex items-center justify-center w-12 ">
|
||||
<Image src={resolveIcon(service.icon)} width={32} height={32} alt="logo" />
|
||||
</button>
|
||||
</a>
|
||||
) : (
|
||||
<div className="flex-shrink-0 flex items-center justify-center w-12 ">
|
||||
<Image src={resolveIcon(service.icon)} width={32} height={32} alt="logo" />
|
||||
|
@ -57,7 +47,7 @@ export default function Item({ service }) {
|
|||
{hasLink ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleOnClick}
|
||||
href={service.href}
|
||||
className="flex-1 flex items-center justify-between rounded-r-md "
|
||||
>
|
||||
<div className="flex-1 px-2 py-2 text-sm text-left">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue