mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-25 01:15:26 +10:00
fix: make nested lists work in PDF renderer, resolves #2993
This commit is contained in:
@@ -5,6 +5,10 @@ import { useTemplateStyle } from "./context";
|
||||
import { safeTextStyle } from "./primitives";
|
||||
import { composeStyles, mergeLinkStyles, mergeStyles } from "./styles";
|
||||
|
||||
const richListItemContentStackStyle = {
|
||||
flexDirection: "column",
|
||||
} satisfies Style;
|
||||
|
||||
export const RichText = ({ children }: { children: string }) => {
|
||||
const boldStyle = useTemplateStyle("bold");
|
||||
const linkStyle = useTemplateStyle("link");
|
||||
@@ -29,7 +33,16 @@ export const RichText = ({ children }: { children: string }) => {
|
||||
return (
|
||||
<View style={composeStyles(richListItemRowStyle)}>
|
||||
<PdfText style={composeStyles(richListItemMarkerStyle)}>{marker}</PdfText>
|
||||
<PdfText style={composeStyles(richListItemContentStyle, ...itemStyle, safeTextStyle)}>{children}</PdfText>
|
||||
<View
|
||||
style={composeStyles(
|
||||
richListItemContentStyle,
|
||||
...itemStyle,
|
||||
richListItemContentStackStyle,
|
||||
safeTextStyle,
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user