mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-09 14:58:47 +00:00
Fixes for existing header styles, fix for glances
Signed-off-by: Denis Papec <denis.papec@gmail.com>
This commit is contained in:
parent
6f750dd83c
commit
1622069063
7 changed files with 34 additions and 16 deletions
|
@ -6,10 +6,22 @@ import SecondaryText from "./secondary_text";
|
|||
import Raw from "./raw";
|
||||
|
||||
export function getAllClasses(options, additionalClassNames = '') {
|
||||
if (options?.style?.header === "boxedWidgets") {
|
||||
return classNames(
|
||||
"flex flex-col justify-center first:ml-0 ml-2 mr-2",
|
||||
"mt-2 m:mb-0 rounded-md shadow-md shadow-theme-900/10 dark:shadow-theme-900/20 bg-theme-100/20 dark:bg-white/5 p-2 pl-3 pr-3",
|
||||
additionalClassNames
|
||||
);
|
||||
}
|
||||
|
||||
let widgetAlignedClasses = "flex flex-col max-w:full sm:basis-auto self-center grow-0 flex-wrap";
|
||||
if (options?.style?.isRightAligned) {
|
||||
widgetAlignedClasses = "flex flex-col justify-center first:ml-auto ml-2 mr-2 ";
|
||||
}
|
||||
|
||||
return classNames(
|
||||
"flex flex-col justify-center first:ml-0 ml-4 mr-2",
|
||||
additionalClassNames,
|
||||
options?.style === "boxedWidgets" && " ml-4 mt-2 m:mb-0 rounded-md shadow-md shadow-theme-900/10 dark:shadow-theme-900/20 bg-theme-100/20 dark:bg-white/5 p-2 pl-3",
|
||||
widgetAlignedClasses,
|
||||
additionalClassNames
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -18,8 +30,8 @@ export function getInnerBlock(children) {
|
|||
return Array.isArray(children) && <div className="flex flex-row items-center justify-end">
|
||||
<div className="flex flex-col items-center">{children.find(child => child.type === WidgetIcon)}</div>
|
||||
<div className="flex flex-col ml-3 text-left">
|
||||
<span className="text-theme-800 dark:text-theme-200 text-sm">{children.find(child => child.type === PrimaryText)}</span>
|
||||
<span className="text-theme-800 dark:text-theme-200 text-xs">{children.find(child => child.type === SecondaryText)}</span>
|
||||
{children.find(child => child.type === PrimaryText)}
|
||||
{children.find(child => child.type === SecondaryText)}
|
||||
</div>
|
||||
</div>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue