feat(app-widget): add layout option (#3875)
This commit is contained in:
1 parent
d7b2298d14
commit
acd09c8c02
5 files changed
+99
-6
No files matched your search
@@ -56,7 +56,8 @@ export default function AppWidget({ options, isEditMode, height, width }: Widget
|
||||
[app, options.openInNewTab],
|
||||
);
|
||||
|
||||
const tinyText = height < 100 || width < 100;
|
||||
const isTiny = height < 100 || width < 100;
|
||||
const isColumnLayout = options.layout.startsWith("column");
|
||||
|
||||
return (
|
||||
<AppLink
|
||||
@@ -77,15 +78,22 @@ export default function AppWidget({ options, isEditMode, height, width }: Widget
|
||||
styles={{ tooltip: { maxWidth: 300 } }}
|
||||
>
|
||||
<Flex
|
||||
p={isTiny ? 4 : "sm"}
|
||||
className={combineClasses("app-flex-wrapper", app.name, app.id, app.href && classes.appWithUrl)}
|
||||
h="100%"
|
||||
w="100%"
|
||||
direction="column"
|
||||
direction={options.layout}
|
||||
justify="center"
|
||||
align="center"
|
||||
gap={isColumnLayout ? 0 : "sm"}
|
||||
>
|
||||
{options.showTitle && (
|
||||
<Text className="app-title" fw={700} size={tinyText ? "8px" : "sm"} ta="center">
|
||||
<Text
|
||||
className="app-title"
|
||||
fw={700}
|
||||
size={isTiny ? "8px" : "sm"}
|
||||
ta={isColumnLayout ? "center" : undefined}
|
||||
>
|
||||
{app.name}
|
||||
</Text>
|
||||
)}
|
||||
@@ -97,6 +105,8 @@ export default function AppWidget({ options, isEditMode, height, width }: Widget
|
||||
style={{
|
||||
height: "100%",
|
||||
width: "100%",
|
||||
minWidth: "20%",
|
||||
maxWidth: isColumnLayout ? undefined : "50%",
|
||||
}}
|
||||
/>
|
||||
</Flex>
|
||||
|
||||
Reference in new issue
Block a user