feat(rss-widget): add hide description option (#4000)

Co-authored-by: HeapReaper <kelivn@heapreaper.nl>
Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
This commit is contained in:
HeapReaper
2025-09-04 22:57:24 +02:00
committed by GitHub
parent b34440470f
commit b2eb2c32f6
4 changed files with 8 additions and 1 deletions

View File

@@ -118,6 +118,7 @@ const optionMapping: OptionMapping = {
enableRtl: (oldOptions) => oldOptions.enableRtl, enableRtl: (oldOptions) => oldOptions.enableRtl,
maximumAmountPosts: (oldOptions) => oldOptions.maximumAmountOfPosts, maximumAmountPosts: (oldOptions) => oldOptions.maximumAmountOfPosts,
textLinesClamp: (oldOptions) => oldOptions.textLinesClamp, textLinesClamp: (oldOptions) => oldOptions.textLinesClamp,
hideDescription: () => undefined,
}, },
notebook: { notebook: {
allowReadOnlyCheck: (oldOptions) => oldOptions.allowReadOnlyCheck, allowReadOnlyCheck: (oldOptions) => oldOptions.allowReadOnlyCheck,

View File

@@ -2259,6 +2259,9 @@
}, },
"maximumAmountPosts": { "maximumAmountPosts": {
"label": "Amount posts limit" "label": "Amount posts limit"
},
"hideDescription": {
"label": "Hide description"
} }
} }
}, },

View File

@@ -49,7 +49,7 @@ export default function RssFeed({ options }: WidgetComponentProps<"rssFeed">) {
<Text dir={languageDir} fz="sm" lh="sm" lineClamp={2}> <Text dir={languageDir} fz="sm" lh="sm" lineClamp={2}>
{feedEntry.title} {feedEntry.title}
</Text> </Text>
{feedEntry.description && ( {!options.hideDescription && feedEntry.description && (
<Text <Text
className={feedEntry.description} className={feedEntry.description}
dir={languageDir} dir={languageDir}

View File

@@ -29,6 +29,9 @@ export const { definition, componentLoader } = createWidgetDefinition("rssFeed",
defaultValue: 100, defaultValue: 100,
validate: z.number().min(1).max(9999), validate: z.number().min(1).max(9999),
}), }),
hideDescription: factory.switch({
defaultValue: false,
}),
})); }));
}, },
}).withDynamicImport(() => import("./component")); }).withDynamicImport(() => import("./component"));