Skip to content

Commit

Permalink
Merge pull request #33145 from software-mansion-labs/prepare-renderer…
Browse files Browse the repository at this point in the history
…-for-videos
  • Loading branch information
francoisl authored Dec 20, 2023
2 parents 4b9889f + 9515870 commit 4afbde0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,17 @@ function BaseHTMLEngineProvider(props) {
mixedUAStyles: {...styles.textLabelSupporting},
}),
'next-steps-email': defaultHTMLElementModels.span.extend({tagName: 'next-steps-email'}),
video: defaultHTMLElementModels.div.extend({
tagName: 'video',
mixedUAStyles: {whiteSpace: 'pre'},
}),
}),
[styles.colorMuted, styles.formError, styles.mb0, styles.textLabelSupporting],
);

// We need to memoize this prop to make it referentially stable.
const defaultTextProps = useMemo(() => ({selectable: props.textSelectable, allowFontScaling: false, textBreakStrategy: 'simple'}), [props.textSelectable]);
const defaultViewProps = {style: [styles.alignItemsStart, styles.userSelectText]};

return (
<TRenderEngineProvider
customHTMLElementModels={customHTMLElementModels}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function AnchorRenderer(props) {
const isAttachment = Boolean(htmlAttribs[CONST.ATTACHMENT_SOURCE_ATTRIBUTE]);
const displayName = lodashGet(props.tnode, 'domNode.children[0].data', '');
const parentStyle = lodashGet(props.tnode, 'parent.styles.nativeTextRet', {});
const attrHref = htmlAttribs.href || '';
const attrHref = htmlAttribs.href || htmlAttribs[CONST.ATTACHMENT_SOURCE_ATTRIBUTE] || '';
const internalNewExpensifyPath = Link.getInternalNewExpensifyPath(attrHref);
const internalExpensifyPath = Link.getInternalExpensifyPath(attrHref);

Expand Down
1 change: 1 addition & 0 deletions src/components/HTMLEngineProvider/HTMLRenderers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default {
a: AnchorRenderer,
code: CodeRenderer,
img: ImageRenderer,
video: AnchorRenderer, // temporary until we have a video player component

// Custom tag renderers
edited: EditedRenderer,
Expand Down

0 comments on commit 4afbde0

Please sign in to comment.