fix: finish widget modernization audit
This commit is contained in:
1 parent
bbcfc505bc
commit
747ccdfa9e
27 files changed
+340
-115
No files matched your search
@@ -0,0 +1,16 @@
|
||||
interface UmamiLayoutInput {
|
||||
width: number;
|
||||
height: number;
|
||||
displayMode: "compact" | "advanced";
|
||||
}
|
||||
|
||||
export const getUmamiLayout = ({ width, height, displayMode }: UmamiLayoutInput) => {
|
||||
const isAdvanced = displayMode === "advanced";
|
||||
return {
|
||||
isDense: !isAdvanced && height < 120,
|
||||
showXAxis: isAdvanced || height >= 140,
|
||||
showSecondaryStats: isAdvanced || height >= 96,
|
||||
showDetailedStats: isAdvanced || (width >= 260 && height >= 150),
|
||||
stackAdvancedContent: isAdvanced && width < 900,
|
||||
};
|
||||
};
|
||||
Reference in new issue
Block a user