mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-07 14:18:47 +00:00
add global settings context
will be useful going forward, and simplify widget props being passed around all over the place
This commit is contained in:
parent
244a76de0b
commit
a677fbefbf
9 changed files with 57 additions and 28 deletions
|
@ -1,12 +1,17 @@
|
|||
export default function Item({ bookmark, target = "_blank" }) {
|
||||
import { useContext } from "react";
|
||||
|
||||
import { SettingsContext } from "utils/settings-context";
|
||||
|
||||
export default function Item({ bookmark }) {
|
||||
const { hostname } = new URL(bookmark.href);
|
||||
const { settings } = useContext(SettingsContext);
|
||||
|
||||
return (
|
||||
<li key={bookmark.name}>
|
||||
<a
|
||||
href={bookmark.href}
|
||||
title={bookmark.name}
|
||||
target={target}
|
||||
target={settings.target ?? "_blank"}
|
||||
className="block w-full text-left mb-3 cursor-pointer rounded-md font-medium text-theme-700 hover:text-theme-700 dark:text-theme-200 dark:hover:text-theme-300 shadow-md shadow-black/10 dark:shadow-black/20 bg-white/50 hover:bg-theme-300/10 dark:bg-white/10 dark:hover:bg-white/20"
|
||||
>
|
||||
<div className="flex">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue