Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b57e45637c | ||
|
|
3429b6ff2d | ||
|
|
144a55b34e | ||
|
|
46ccc6c245 |
No files matched your search
@@ -1405,6 +1405,9 @@
|
|||||||
"openNewTab": {
|
"openNewTab": {
|
||||||
"label": "Open in new tab"
|
"label": "Open in new tab"
|
||||||
},
|
},
|
||||||
|
"withBorder": {
|
||||||
|
"label": "Show border"
|
||||||
|
},
|
||||||
"items": {
|
"items": {
|
||||||
"label": "Bookmarks",
|
"label": "Bookmarks",
|
||||||
"add": "Add bookmark"
|
"add": "Add bookmark"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export default function BookmarksWidget({ options, itemId }: WidgetComponentProp
|
|||||||
const board = useRequiredBoard();
|
const board = useRequiredBoard();
|
||||||
const [data] = clientApi.app.byIds.useSuspenseQuery(options.items, {
|
const [data] = clientApi.app.byIds.useSuspenseQuery(options.items, {
|
||||||
select(data) {
|
select(data) {
|
||||||
return data.sort((appA, appB) => options.items.indexOf(appA.id) - options.items.indexOf(appB.id));
|
return data.toSorted((appA, appB) => options.items.indexOf(appA.id) - options.items.indexOf(appB.id));
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -56,6 +56,7 @@ export default function BookmarksWidget({ options, itemId }: WidgetComponentProp
|
|||||||
hideIcon={options.hideIcon}
|
hideIcon={options.hideIcon}
|
||||||
hideHostname={options.hideHostname}
|
hideHostname={options.hideHostname}
|
||||||
openNewTab={options.openNewTab}
|
openNewTab={options.openNewTab}
|
||||||
|
withBorder={options.withBorder}
|
||||||
hasIconColor={board.iconColor !== null}
|
hasIconColor={board.iconColor !== null}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -67,6 +68,7 @@ export default function BookmarksWidget({ options, itemId }: WidgetComponentProp
|
|||||||
hideIcon={options.hideIcon}
|
hideIcon={options.hideIcon}
|
||||||
hideHostname={options.hideHostname}
|
hideHostname={options.hideHostname}
|
||||||
openNewTab={options.openNewTab}
|
openNewTab={options.openNewTab}
|
||||||
|
withBorder={options.withBorder}
|
||||||
hasIconColor={board.iconColor !== null}
|
hasIconColor={board.iconColor !== null}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -81,6 +83,7 @@ interface FlexLayoutProps {
|
|||||||
hideIcon: boolean;
|
hideIcon: boolean;
|
||||||
hideHostname: boolean;
|
hideHostname: boolean;
|
||||||
openNewTab: boolean;
|
openNewTab: boolean;
|
||||||
|
withBorder: boolean;
|
||||||
hasIconColor: boolean;
|
hasIconColor: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,6 +94,7 @@ const FlexLayout = ({
|
|||||||
hideIcon,
|
hideIcon,
|
||||||
hideHostname,
|
hideHostname,
|
||||||
openNewTab,
|
openNewTab,
|
||||||
|
withBorder,
|
||||||
hasIconColor,
|
hasIconColor,
|
||||||
}: FlexLayoutProps) => {
|
}: FlexLayoutProps) => {
|
||||||
const board = useRequiredBoard();
|
const board = useRequiredBoard();
|
||||||
@@ -106,7 +110,15 @@ const FlexLayout = ({
|
|||||||
key={app.id}
|
key={app.id}
|
||||||
w="100%"
|
w="100%"
|
||||||
>
|
>
|
||||||
<Card radius={board.itemRadius} className={classes.card} w="100%" display="flex" p={4} h="100%">
|
<Card
|
||||||
|
radius={board.itemRadius}
|
||||||
|
className={classes.card}
|
||||||
|
w="100%"
|
||||||
|
display="flex"
|
||||||
|
p={4}
|
||||||
|
h="100%"
|
||||||
|
withBorder={withBorder}
|
||||||
|
>
|
||||||
{direction === "row" ? (
|
{direction === "row" ? (
|
||||||
<VerticalItem
|
<VerticalItem
|
||||||
app={app}
|
app={app}
|
||||||
@@ -138,6 +150,7 @@ interface GridLayoutProps {
|
|||||||
hideIcon: boolean;
|
hideIcon: boolean;
|
||||||
hideHostname: boolean;
|
hideHostname: boolean;
|
||||||
openNewTab: boolean;
|
openNewTab: boolean;
|
||||||
|
withBorder: boolean;
|
||||||
itemDirection: "horizontal" | "vertical";
|
itemDirection: "horizontal" | "vertical";
|
||||||
hasIconColor: boolean;
|
hasIconColor: boolean;
|
||||||
}
|
}
|
||||||
@@ -148,6 +161,7 @@ const GridLayout = ({
|
|||||||
hideIcon,
|
hideIcon,
|
||||||
hideHostname,
|
hideHostname,
|
||||||
openNewTab,
|
openNewTab,
|
||||||
|
withBorder,
|
||||||
itemDirection,
|
itemDirection,
|
||||||
hasIconColor,
|
hasIconColor,
|
||||||
}: GridLayoutProps) => {
|
}: GridLayoutProps) => {
|
||||||
@@ -168,6 +182,7 @@ const GridLayout = ({
|
|||||||
h="100%"
|
h="100%"
|
||||||
className={combineClasses(classes.card, classes["card-grid"])}
|
className={combineClasses(classes.card, classes["card-grid"])}
|
||||||
radius={board.itemRadius}
|
radius={board.itemRadius}
|
||||||
|
withBorder={withBorder}
|
||||||
p="xs"
|
p="xs"
|
||||||
>
|
>
|
||||||
{itemDirection === "horizontal" ? (
|
{itemDirection === "horizontal" ? (
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export const { definition, componentLoader } = createWidgetDefinition("bookmarks
|
|||||||
hideIcon: factory.switch({ defaultValue: false }),
|
hideIcon: factory.switch({ defaultValue: false }),
|
||||||
hideHostname: factory.switch({ defaultValue: false }),
|
hideHostname: factory.switch({ defaultValue: false }),
|
||||||
openNewTab: factory.switch({ defaultValue: true }),
|
openNewTab: factory.switch({ defaultValue: true }),
|
||||||
|
withBorder: factory.switch({ defaultValue: false }),
|
||||||
items: factory.sortableItemList<RouterOutputs["app"]["all"][number], string>({
|
items: factory.sortableItemList<RouterOutputs["app"]["all"][number], string>({
|
||||||
ItemComponent: ({ item, handle: Handle, removeItem, rootAttributes }) => {
|
ItemComponent: ({ item, handle: Handle, removeItem, rootAttributes }) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in new issue
Block a user