mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 21:59:50 +01:00
updates to handle more than one weather widget
This commit is contained in:
@@ -17,6 +17,8 @@ const ColorToggle = dynamic(() => import("components/color-toggle"), {
|
||||
ssr: false,
|
||||
});
|
||||
|
||||
const rightAlignedWidgets = ["weatherapi", "openweathermap", "weather"];
|
||||
|
||||
export default function Home() {
|
||||
const { data: services, error: servicesError } = useSWR("/api/services");
|
||||
const { data: bookmarks, error: bookmarksError } = useSWR("/api/bookmarks");
|
||||
@@ -33,13 +35,13 @@ export default function Home() {
|
||||
{widgets && (
|
||||
<>
|
||||
{widgets
|
||||
.filter((widget) => widget.type !== "weather")
|
||||
.filter((widget) => !rightAlignedWidgets.includes(widget.type))
|
||||
.map((widget, i) => (
|
||||
<Widget key={i} widget={widget} />
|
||||
))}
|
||||
<div className="grow"></div>
|
||||
{widgets
|
||||
.filter((widget) => widget.type === "weather")
|
||||
.filter((widget) => rightAlignedWidgets.includes(widget.type))
|
||||
.map((widget, i) => (
|
||||
<Widget key={i} widget={widget} />
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user