✨ Removed widgets from tile definitions
This commit is contained in:
30
src/widgets/bitTorrent/BitTorrentTile.tsx
Normal file
30
src/widgets/bitTorrent/BitTorrentTile.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import { IconClock } from '@tabler/icons';
|
||||
import { HomarrCardWrapper } from '../../components/Dashboard/Tiles/HomarrCardWrapper';
|
||||
import { BaseTileProps } from '../../components/Dashboard/Tiles/type';
|
||||
import { defineWidget } from '../helper';
|
||||
import { IWidget } from '../widgets';
|
||||
|
||||
const definition = defineWidget({
|
||||
id: 'bitTorrent',
|
||||
icon: IconClock,
|
||||
options: {},
|
||||
gridstack: {
|
||||
minWidth: 2,
|
||||
minHeight: 2,
|
||||
maxWidth: 2,
|
||||
maxHeight: 2,
|
||||
},
|
||||
component: BitTorrentTile,
|
||||
});
|
||||
|
||||
export type IBitTorrent = IWidget<typeof definition['id'], typeof definition>;
|
||||
|
||||
interface BitTorrentTileProps extends BaseTileProps {
|
||||
module: IBitTorrent; // TODO: change to new type defined through widgetDefinition
|
||||
}
|
||||
|
||||
function BitTorrentTile({ className, module }: BitTorrentTileProps) {
|
||||
return <HomarrCardWrapper>Bit Torrent</HomarrCardWrapper>;
|
||||
}
|
||||
|
||||
export default definition;
|
||||
@@ -22,6 +22,12 @@ const definition = defineWidget({
|
||||
defaultValue: false,
|
||||
},
|
||||
},
|
||||
gridstack: {
|
||||
minWidth: 4,
|
||||
minHeight: 5,
|
||||
maxWidth: 12,
|
||||
maxHeight: 12,
|
||||
},
|
||||
component: CalendarTile,
|
||||
});
|
||||
|
||||
|
||||
@@ -18,6 +18,13 @@ const definition = defineWidget({
|
||||
defaultValue: false,
|
||||
},
|
||||
},
|
||||
|
||||
gridstack: {
|
||||
minWidth: 4,
|
||||
minHeight: 2,
|
||||
maxWidth: 12,
|
||||
maxHeight: 12,
|
||||
},
|
||||
component: ClockTile,
|
||||
});
|
||||
|
||||
|
||||
@@ -38,6 +38,12 @@ const definition = defineWidget({
|
||||
defaultValue: '',
|
||||
},
|
||||
},
|
||||
gridstack: {
|
||||
minWidth: 4,
|
||||
minHeight: 5,
|
||||
maxWidth: 12,
|
||||
maxHeight: 14,
|
||||
},
|
||||
component: DashDotTile,
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import calendar from './calendar/CalendarTile';
|
||||
|
||||
export default { calendar };
|
||||
// TODO: add exports of new IWidgetDefinitions to here
|
||||
import dashDot from './dashDot/DashDotTile';
|
||||
import useNet from './useNet/UseNetTile';
|
||||
import clock from './clock/ClockTile';
|
||||
import weather from './weather/WeatherTile';
|
||||
import bitTorrent from './bitTorrent/BitTorrentTile';
|
||||
import torrentNetworkTraffic from './torrentNetworkTraffic/TorrentNetworkTrafficTile';
|
||||
export default { calendar, dashDot, useNet, clock, weather, bitTorrent, torrentNetworkTraffic };
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import { IconClock } from '@tabler/icons';
|
||||
import { HomarrCardWrapper } from '../../components/Dashboard/Tiles/HomarrCardWrapper';
|
||||
import { BaseTileProps } from '../../components/Dashboard/Tiles/type';
|
||||
import { defineWidget } from '../helper';
|
||||
import { IWidget } from '../widgets';
|
||||
|
||||
const definition = defineWidget({
|
||||
id: 'torrentNetworkTraffic',
|
||||
icon: IconClock,
|
||||
options: {},
|
||||
|
||||
gridstack: {
|
||||
minWidth: 2,
|
||||
minHeight: 2,
|
||||
maxWidth: 2,
|
||||
maxHeight: 2,
|
||||
},
|
||||
component: TorrentNetworkTrafficTile,
|
||||
});
|
||||
|
||||
export type ITorrentNetworkTraffic = IWidget<typeof definition['id'], typeof definition>;
|
||||
|
||||
interface TorrentNetworkTrafficTileProps extends BaseTileProps {
|
||||
module: ITorrentNetworkTraffic; // TODO: change to new type defined through widgetDefinition
|
||||
}
|
||||
|
||||
function TorrentNetworkTrafficTile({ className, module }: TorrentNetworkTrafficTileProps) {
|
||||
return <HomarrCardWrapper>TorrentNetworkTraffic</HomarrCardWrapper>;
|
||||
}
|
||||
|
||||
export default definition;
|
||||
@@ -36,6 +36,12 @@ const definition = defineWidget({
|
||||
icon: IconFileDownload,
|
||||
options: {},
|
||||
component: UseNetTile,
|
||||
gridstack: {
|
||||
minWidth: 4,
|
||||
minHeight: 5,
|
||||
maxWidth: 12,
|
||||
maxHeight: 12,
|
||||
},
|
||||
});
|
||||
|
||||
export type IWeatherWidget = IWidget<typeof definition['id'], typeof definition>;
|
||||
|
||||
@@ -21,6 +21,12 @@ const definition = defineWidget({
|
||||
defaultValue: 'Paris',
|
||||
},
|
||||
},
|
||||
gridstack: {
|
||||
minWidth: 4,
|
||||
minHeight: 2,
|
||||
maxWidth: 12,
|
||||
maxHeight: 12,
|
||||
},
|
||||
component: WeatherTile,
|
||||
});
|
||||
|
||||
|
||||
6
src/widgets/widgets.d.ts
vendored
6
src/widgets/widgets.d.ts
vendored
@@ -66,5 +66,11 @@ export type IWidgetDefinition<TKey extends string = string> = {
|
||||
options: {
|
||||
[key: string]: IWidgetOptionValue;
|
||||
};
|
||||
gridstack: {
|
||||
minWidth: number;
|
||||
minHeight: number;
|
||||
maxWidth: number;
|
||||
maxHeight: number;
|
||||
};
|
||||
component: React.ComponentType<any>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user