mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 07:25:48 +01:00
🐛 Hide wrappers with no tiles inside
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { WrapperType } from '../../../../types/wrapper';
|
||||
import { useEditModeStore } from '../../Views/useEditModeStore';
|
||||
import { useGridstack } from '../gridstack/use-gridstack';
|
||||
import { WrapperContent } from '../WrapperContent';
|
||||
|
||||
@@ -8,10 +9,12 @@ interface DashboardWrapperProps {
|
||||
|
||||
export const DashboardWrapper = ({ wrapper }: DashboardWrapperProps) => {
|
||||
const { refs, apps, widgets } = useGridstack('wrapper', wrapper.id);
|
||||
const isEditMode = useEditModeStore((x) => x.enabled);
|
||||
const defaultClasses = 'grid-stack grid-stack-wrapper min-row';
|
||||
|
||||
return (
|
||||
<div
|
||||
className="grid-stack grid-stack-wrapper"
|
||||
className={apps.length > 0 || isEditMode ? defaultClasses : `${defaultClasses} gridstack-empty-wrapper`}
|
||||
style={{ transitionDuration: '0s' }}
|
||||
data-wrapper={wrapper.id}
|
||||
ref={refs.wrapper}
|
||||
|
||||
@@ -87,3 +87,8 @@
|
||||
.grid-stack.grid-stack-animate {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.gridstack-empty-wrapper {
|
||||
height: 0px;
|
||||
min-height: 0px !important;
|
||||
}
|
||||
Reference in New Issue
Block a user