mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-10-04 02:33:47 +10:00
Signed-off-by: aaccardo <hackardo@gmail.com> Co-authored-by: Amruth Pillai <im.amruth@gmail.com>
This commit is contained in:
co-authored by
Amruth Pillai
parent
18d0c14aa1
commit
ed5d10c491
@@ -87,11 +87,12 @@ export function createBaseTemplateStyles({ metadata, foreground, r, metrics, pic
|
|||||||
...bodyText,
|
...bodyText,
|
||||||
width: metadata.typography.body.fontSize,
|
width: metadata.typography.body.fontSize,
|
||||||
textAlign: r.listMarkerTextAlign,
|
textAlign: r.listMarkerTextAlign,
|
||||||
|
flex: "initial",
|
||||||
} satisfies Style,
|
} satisfies Style,
|
||||||
|
|
||||||
richListItemContent: {
|
richListItemContent: {
|
||||||
...bodyText,
|
...bodyText,
|
||||||
flex: 1,
|
flex: "initial",
|
||||||
} satisfies Style,
|
} satisfies Style,
|
||||||
|
|
||||||
splitRow: {
|
splitRow: {
|
||||||
|
|||||||
@@ -61,10 +61,6 @@ export const RichText = ({ children }: RichTextProps) => {
|
|||||||
const { metadata, rtl } = useRender();
|
const { metadata, rtl } = useRender();
|
||||||
const rtlTextWrapStyle: Style | undefined = rtl ? { direction: "rtl", textAlign: "right" } : undefined;
|
const rtlTextWrapStyle: Style | undefined = rtl ? { direction: "rtl", textAlign: "right" } : undefined;
|
||||||
|
|
||||||
const richListItemMarkerMargin: Style = {
|
|
||||||
marginLeft: rtl ? 4 : 0,
|
|
||||||
marginRight: rtl ? 0 : 4,
|
|
||||||
};
|
|
||||||
const boldStyle = useTemplateStyle("bold");
|
const boldStyle = useTemplateStyle("bold");
|
||||||
const linkStyle = useTemplateStyle("link");
|
const linkStyle = useTemplateStyle("link");
|
||||||
const richParagraphStyle = useTemplateStyle("richParagraph");
|
const richParagraphStyle = useTemplateStyle("richParagraph");
|
||||||
@@ -123,7 +119,11 @@ export const RichText = ({ children }: RichTextProps) => {
|
|||||||
const contentItemStyles = itemStyles.map(stripRichTextVerticalMargins);
|
const contentItemStyles = itemStyles.map(stripRichTextVerticalMargins);
|
||||||
|
|
||||||
const markerNode = (
|
const markerNode = (
|
||||||
<PdfText key="marker" style={composeStyles(richListItemMarkerStyle, richListItemMarkerMargin)}>
|
<PdfText
|
||||||
|
key="marker"
|
||||||
|
minPresenceAhead={bodyLineHeight ?? metadata.typography.body.lineHeight}
|
||||||
|
style={composeStyles(richListItemMarkerStyle)}
|
||||||
|
>
|
||||||
{marker}
|
{marker}
|
||||||
</PdfText>
|
</PdfText>
|
||||||
);
|
);
|
||||||
@@ -153,10 +153,7 @@ export const RichText = ({ children }: RichTextProps) => {
|
|||||||
safeTextStyle,
|
safeTextStyle,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<View style={{ flexDirection: "row", alignItems: "flex-start" }}>
|
{children}
|
||||||
{markerNode}
|
|
||||||
<View style={{ flex: 1, minWidth: 0 }}>{children}</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -171,7 +168,7 @@ export const RichText = ({ children }: RichTextProps) => {
|
|||||||
getRichTextEdgeTrimStyle(element),
|
getRichTextEdgeTrimStyle(element),
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{rtl ? [contentNode, markerNode] : contentNode}
|
{rtl ? [contentNode, markerNode] : [markerNode, contentNode]}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user