fix: rss widget post sorting (#1855)

This commit is contained in:
Manuel
2024-01-28 21:15:46 +01:00
committed by GitHub
parent 6fdf1dfaa8
commit ff21033b0c
3 changed files with 60 additions and 31 deletions

View File

@@ -55,6 +55,17 @@ const definition = defineWidget({
type: 'switch',
defaultValue: true,
},
sortPostsWithoutPublishDateToTheTop: {
type: 'switch',
defaultValue: false
},
maximumAmountOfPosts: {
type: 'slider',
defaultValue: 20,
min: 1,
max: 350,
step: 1
}
},
gridstack: {
minWidth: 2,
@@ -127,7 +138,7 @@ function RssTile({ widget }: RssTileProps) {
<Stack h="100%">
<ScrollArea className="scroll-area-w100" w="100%" mt="sm" mb="sm">
<Stack w="100%" spacing="xs">
{orderedFeedItems.map((item: any, index: number) => (
{orderedFeedItems.slice(0, widget.properties.maximumAmountOfPosts).map((item: any, index: number) => (
<Card
key={index}
withBorder