mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-16 01:39:49 +00:00
allow setting a global link target
This commit is contained in:
parent
75244cc40e
commit
20ac15b18c
7 changed files with 26 additions and 25 deletions
|
@ -2,7 +2,7 @@ import classNames from "classnames";
|
|||
|
||||
import List from "components/services/list";
|
||||
|
||||
export default function ServicesGroup({ services, layout }) {
|
||||
export default function ServicesGroup({ services, target, layout }) {
|
||||
return (
|
||||
<div
|
||||
key={services.name}
|
||||
|
@ -12,7 +12,7 @@ export default function ServicesGroup({ services, layout }) {
|
|||
)}
|
||||
>
|
||||
<h2 className="text-theme-800 dark:text-theme-300 text-xl font-medium">{services.name}</h2>
|
||||
<List services={services.services} layout={layout} />
|
||||
<List services={services.services} target={target} layout={layout} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ function resolveIcon(icon) {
|
|||
return `https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/${icon}.png`;
|
||||
}
|
||||
|
||||
export default function Item({ service }) {
|
||||
export default function Item({ service, target = "_blank" }) {
|
||||
const hasLink = service.href && service.href !== "#";
|
||||
|
||||
return (
|
||||
|
@ -37,7 +37,7 @@ export default function Item({ service }) {
|
|||
(hasLink ? (
|
||||
<a
|
||||
href={service.href}
|
||||
target="_blank"
|
||||
target={target}
|
||||
rel="noreferrer"
|
||||
className="flex-shrink-0 flex items-center justify-center w-12 "
|
||||
>
|
||||
|
@ -52,7 +52,7 @@ export default function Item({ service }) {
|
|||
{hasLink ? (
|
||||
<a
|
||||
href={service.href}
|
||||
target="_blank"
|
||||
target={target}
|
||||
rel="noreferrer"
|
||||
className="flex-1 flex items-center justify-between rounded-r-md "
|
||||
>
|
||||
|
|
|
@ -14,7 +14,7 @@ const columnMap = [
|
|||
"grid-cols-1 md:grid-cols-2 lg:grid-cols-8",
|
||||
];
|
||||
|
||||
export default function List({ services, layout }) {
|
||||
export default function List({ services, target, layout }) {
|
||||
return (
|
||||
<ul
|
||||
className={classNames(
|
||||
|
@ -23,7 +23,7 @@ export default function List({ services, layout }) {
|
|||
)}
|
||||
>
|
||||
{services.map((service) => (
|
||||
<Item key={service.name} service={service} />
|
||||
<Item key={service.name} target={target} service={service} />
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue