mirror of
https://github.com/gethomepage/homepage.git
synced 2026-09-12 07:05:56 -07:00
81accd8dbe
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com> Signed-off-by: dependabot[bot] <support@github.com>
26 lines
881 B
React
26 lines
881 B
React
import classNames from "classnames";
|
|
|
|
import { columnMap } from "../../utils/layout/columns";
|
|
|
|
import Item from "components/bookmarks/item";
|
|
|
|
export default function List({ bookmarks, layout, bookmarksStyle }) {
|
|
let classes = layout?.style === "row" ? `grid ${columnMap[layout?.columns]} gap-x-2` : "flex flex-col bookmark-list";
|
|
const style = {};
|
|
if (layout?.iconsOnly || bookmarksStyle === "icons") {
|
|
classes = "grid gap-2 bookmark-list";
|
|
style.gridTemplateColumns = "repeat(auto-fill, minmax(60px, 1fr))";
|
|
}
|
|
return (
|
|
<ul className={classNames(classes, "mb-2", layout?.header === false ? "" : "mt-3")} style={style}>
|
|
{bookmarks.map((bookmark) => (
|
|
<Item
|
|
key={`${bookmark.name}-${bookmark.href}`}
|
|
bookmark={bookmark}
|
|
iconOnly={layout?.iconsOnly || bookmarksStyle === "icons"}
|
|
/>
|
|
))}
|
|
</ul>
|
|
);
|
|
}
|