diff --git a/.vscode/settings.json b/.vscode/settings.json index 6ade07561..c28bad169 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -31,5 +31,8 @@ { "rule": "simple-import-sort/*", "severity": "off" }, { "rule": "prefer-const", "severity": "off" }, { "rule": "unused-imports/no-unused-imports", "severity": "off" } + ], + "cSpell.words": [ + "rsshub" ] } diff --git a/src/renderer/src/components/ui/modal/stacked/modal.tsx b/src/renderer/src/components/ui/modal/stacked/modal.tsx index c4a739b4a..6195977f0 100644 --- a/src/renderer/src/components/ui/modal/stacked/modal.tsx +++ b/src/renderer/src/components/ui/modal/stacked/modal.tsx @@ -80,6 +80,8 @@ export const ModalInternal: Component<{ modalContainerClassName, wrapper: Wrapper = Fragment, max, + icon, + } = item const modalStyle = useMemo(() => ({ zIndex: 99 + index }), [index]) const dismiss = useCallback( @@ -157,9 +159,7 @@ export const ModalInternal: Component<{ - - {title} - + {title}
-
+
{finalChildren}
@@ -209,8 +212,12 @@ export const ModalInternal: Component<{ onClick={stopPropagation} >
- - {title} + + {icon && {icon}} + + + {title} + diff --git a/src/renderer/src/components/ui/modal/stacked/types.tsx b/src/renderer/src/components/ui/modal/stacked/types.tsx index fe97a2004..9ff190057 100644 --- a/src/renderer/src/components/ui/modal/stacked/types.tsx +++ b/src/renderer/src/components/ui/modal/stacked/types.tsx @@ -4,6 +4,8 @@ import type { ModalContentPropsInternal } from "./context" export interface ModalProps { title: ReactNode + icon?: ReactNode + CustomModalComponent?: FC content: FC clickOutsideToDismiss?: boolean diff --git a/src/renderer/src/modules/discover/recommendations.tsx b/src/renderer/src/modules/discover/recommendations.tsx index ae6d8573a..de22e58e8 100644 --- a/src/renderer/src/modules/discover/recommendations.tsx +++ b/src/renderer/src/modules/discover/recommendations.tsx @@ -43,14 +43,13 @@ export function Recommendations() { onClick={() => { present({ content: () => , - title: ( -
- - {`${rsshubPopular.data[key].name} - ${rsshubPopular.data[key].routes[route].name}`} -
+ icon: ( + ), + title: `${rsshubPopular.data[key].name} - ${rsshubPopular.data[key].routes[route].name}`, clickOutsideToDismiss: true, }) }}