|
|
@ -209,7 +209,7 @@ function Home({ initialSettings }) {
|
|
|
|
searchProvider = searchProviders[searchWidget.options?.provider];
|
|
|
|
searchProvider = searchProviders[searchWidget.options?.provider];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const headerStyle = initialSettings?.headerStyle || "underlined";
|
|
|
|
const headerStyle = settings?.headerStyle || "underlined";
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
function handleKeyDown(e) {
|
|
|
|
function handleKeyDown(e) {
|
|
|
@ -233,12 +233,12 @@ function Home({ initialSettings }) {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
<Head>
|
|
|
|
<Head>
|
|
|
|
<title>{initialSettings.title || "Homepage"}</title>
|
|
|
|
<title>{settings.title || "Homepage"}</title>
|
|
|
|
{initialSettings.base && <base href={initialSettings.base} />}
|
|
|
|
{settings.base && <base href={settings.base} />}
|
|
|
|
{initialSettings.favicon ? (
|
|
|
|
{settings.favicon ? (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
<link rel="apple-touch-icon" sizes="180x180" href={initialSettings.favicon} />
|
|
|
|
<link rel="apple-touch-icon" sizes="180x180" href={settings.favicon} />
|
|
|
|
<link rel="icon" href={initialSettings.favicon} />
|
|
|
|
<link rel="icon" href={settings.favicon} />
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
) : (
|
|
|
|
) : (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
@ -248,11 +248,8 @@ function Home({ initialSettings }) {
|
|
|
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png?v=4" />
|
|
|
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png?v=4" />
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
<meta
|
|
|
|
<meta name="msapplication-TileColor" content={themes[settings.color || "slate"][settings.theme || "dark"]} />
|
|
|
|
name="msapplication-TileColor"
|
|
|
|
<meta name="theme-color" content={themes[settings.color || "slate"][settings.theme || "dark"]} />
|
|
|
|
content={themes[initialSettings.color || "slate"][initialSettings.theme || "dark"]}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<meta name="theme-color" content={themes[initialSettings.color || "slate"][initialSettings.theme || "dark"]} />
|
|
|
|
|
|
|
|
</Head>
|
|
|
|
</Head>
|
|
|
|
<div className="relative container m-auto flex flex-col justify-start z-10 h-full">
|
|
|
|
<div className="relative container m-auto flex flex-col justify-start z-10 h-full">
|
|
|
|
<QuickLaunch
|
|
|
|
<QuickLaunch
|
|
|
@ -267,7 +264,7 @@ function Home({ initialSettings }) {
|
|
|
|
className={classNames(
|
|
|
|
className={classNames(
|
|
|
|
"flex flex-row flex-wrap justify-between",
|
|
|
|
"flex flex-row flex-wrap justify-between",
|
|
|
|
headerStyles[headerStyle],
|
|
|
|
headerStyles[headerStyle],
|
|
|
|
initialSettings.cardBlur !== undefined && headerStyle === "boxed" && `backdrop-blur${initialSettings.cardBlur.length ? '-' : ""}${initialSettings.cardBlur}`
|
|
|
|
settings.cardBlur !== undefined && headerStyle === "boxed" && `backdrop-blur${settings.cardBlur.length ? '-' : ""}${settings.cardBlur}`
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{widgets && (
|
|
|
|
{widgets && (
|
|
|
@ -275,7 +272,7 @@ function Home({ initialSettings }) {
|
|
|
|
{widgets
|
|
|
|
{widgets
|
|
|
|
.filter((widget) => !rightAlignedWidgets.includes(widget.type))
|
|
|
|
.filter((widget) => !rightAlignedWidgets.includes(widget.type))
|
|
|
|
.map((widget, i) => (
|
|
|
|
.map((widget, i) => (
|
|
|
|
<Widget key={i} widget={widget} style={{ header: headerStyle, isRightAligned: false, cardBlur: initialSettings.cardBlur }} />
|
|
|
|
<Widget key={i} widget={widget} style={{ header: headerStyle, isRightAligned: false, cardBlur: settings.cardBlur }} />
|
|
|
|
))}
|
|
|
|
))}
|
|
|
|
|
|
|
|
|
|
|
|
<div className={classNames(
|
|
|
|
<div className={classNames(
|
|
|
@ -285,7 +282,7 @@ function Home({ initialSettings }) {
|
|
|
|
{widgets
|
|
|
|
{widgets
|
|
|
|
.filter((widget) => rightAlignedWidgets.includes(widget.type))
|
|
|
|
.filter((widget) => rightAlignedWidgets.includes(widget.type))
|
|
|
|
.map((widget, i) => (
|
|
|
|
.map((widget, i) => (
|
|
|
|
<Widget key={i} widget={widget} style={{ header: headerStyle, isRightAligned: true, cardBlur: initialSettings.cardBlur }} />
|
|
|
|
<Widget key={i} widget={widget} style={{ header: headerStyle, isRightAligned: true, cardBlur: settings.cardBlur }} />
|
|
|
|
))}
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
</>
|
|
|
@ -293,39 +290,42 @@ function Home({ initialSettings }) {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{services?.length > 0 && (
|
|
|
|
{services?.length > 0 && (
|
|
|
|
<div className="flex flex-wrap p-4 sm:p-8 sm:pt-4 items-start pb-2">
|
|
|
|
<div key="services" className="flex flex-wrap p-4 sm:p-8 sm:pt-4 items-start pb-2">
|
|
|
|
{services.map((group) => (
|
|
|
|
{services.map((group) => (
|
|
|
|
<ServicesGroup
|
|
|
|
<ServicesGroup
|
|
|
|
key={group.name}
|
|
|
|
key={group.name}
|
|
|
|
group={group.name}
|
|
|
|
group={group.name}
|
|
|
|
services={group}
|
|
|
|
services={group}
|
|
|
|
layout={initialSettings.layout?.[group.name]}
|
|
|
|
layout={settings.layout?.[group.name]}
|
|
|
|
fiveColumns={settings.fiveColumns}
|
|
|
|
fiveColumns={settings.fiveColumns}
|
|
|
|
disableCollapse={settings.disableCollapse} />
|
|
|
|
disableCollapse={settings.disableCollapse}
|
|
|
|
|
|
|
|
/>
|
|
|
|
))}
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
|
|
{bookmarks?.length > 0 && (
|
|
|
|
{bookmarks?.length > 0 && (
|
|
|
|
<div className={`grow flex flex-wrap pt-0 p-4 sm:p-8 gap-2 grid-cols-1 lg:grid-cols-2 lg:grid-cols-${Math.min(6, bookmarks.length)}`}>
|
|
|
|
<div key="bookmarks" className="flex flex-wrap p-4 sm:p-8 sm:pt-4 items-start pb-2">
|
|
|
|
{bookmarks.map((group) => (
|
|
|
|
{bookmarks.map((group) => (
|
|
|
|
<BookmarksGroup
|
|
|
|
<BookmarksGroup
|
|
|
|
key={group.name}
|
|
|
|
key={group.name}
|
|
|
|
group={group}
|
|
|
|
bookmarks={group}
|
|
|
|
disableCollapse={settings.disableCollapse} />
|
|
|
|
layout={settings.layout?.[group.name]}
|
|
|
|
|
|
|
|
disableCollapse={settings.disableCollapse}
|
|
|
|
|
|
|
|
/>
|
|
|
|
))}
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
|
|
<div className="flex flex-col mt-auto p-8 w-full">
|
|
|
|
<div className="flex flex-col mt-auto p-8 w-full">
|
|
|
|
<div className="flex w-full justify-end">
|
|
|
|
<div className="flex w-full justify-end">
|
|
|
|
{!initialSettings?.color && <ColorToggle />}
|
|
|
|
{!settings?.color && <ColorToggle />}
|
|
|
|
<Revalidate />
|
|
|
|
<Revalidate />
|
|
|
|
{!initialSettings?.theme && <ThemeToggle />}
|
|
|
|
{!settings.theme && <ThemeToggle />}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="flex mt-4 w-full justify-end">
|
|
|
|
<div className="flex mt-4 w-full justify-end">
|
|
|
|
{!initialSettings?.hideVersion && <Version />}
|
|
|
|
{!settings.hideVersion && <Version />}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|