mirror of
https://github.com/ajnart/homarr.git
synced 2026-01-30 19:29:17 +01:00
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:
@@ -118,6 +118,7 @@ const optionMapping: OptionMapping = {
|
||||
enableRtl: (oldOptions) => oldOptions.enableRtl,
|
||||
maximumAmountPosts: (oldOptions) => oldOptions.maximumAmountOfPosts,
|
||||
textLinesClamp: (oldOptions) => oldOptions.textLinesClamp,
|
||||
hideDescription: () => undefined,
|
||||
},
|
||||
notebook: {
|
||||
allowReadOnlyCheck: (oldOptions) => oldOptions.allowReadOnlyCheck,
|
||||
|
||||
@@ -2259,6 +2259,9 @@
|
||||
},
|
||||
"maximumAmountPosts": {
|
||||
"label": "Amount posts limit"
|
||||
},
|
||||
"hideDescription": {
|
||||
"label": "Hide description"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -49,7 +49,7 @@ export default function RssFeed({ options }: WidgetComponentProps<"rssFeed">) {
|
||||
<Text dir={languageDir} fz="sm" lh="sm" lineClamp={2}>
|
||||
{feedEntry.title}
|
||||
</Text>
|
||||
{feedEntry.description && (
|
||||
{!options.hideDescription && feedEntry.description && (
|
||||
<Text
|
||||
className={feedEntry.description}
|
||||
dir={languageDir}
|
||||
|
||||
@@ -29,6 +29,9 @@ export const { definition, componentLoader } = createWidgetDefinition("rssFeed",
|
||||
defaultValue: 100,
|
||||
validate: z.number().min(1).max(9999),
|
||||
}),
|
||||
hideDescription: factory.switch({
|
||||
defaultValue: false,
|
||||
}),
|
||||
}));
|
||||
},
|
||||
}).withDynamicImport(() => import("./component"));
|
||||
|
||||
Reference in New Issue
Block a user