mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08: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:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user