Skip to content

Commit

Permalink
[FLASK] Fix overflow issues with text coming from snap UI (#18169)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikBolding authored Mar 16, 2023
1 parent 872a8c7 commit dce4c6d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui/components/app/flask/snap-ui-markdown/snap-ui-markdown.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import React from 'react';
import PropTypes from 'prop-types';
import ReactMarkdown from 'react-markdown';
import { TypographyVariant } from '../../../../helpers/constants/design-system';
import {
TypographyVariant,
OVERFLOW_WRAP,
} from '../../../../helpers/constants/design-system';
import Typography from '../../../ui/typography/typography';

const Paragraph = (props) => (
<Typography
{...props}
variant={TypographyVariant.H6}
className="snap-ui-markdown__text"
overflowWrap={OVERFLOW_WRAP.BREAK_WORD}
/>
);

Expand Down
2 changes: 2 additions & 0 deletions ui/components/app/flask/snap-ui-renderer/snap-ui-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
FONT_WEIGHT,
DISPLAY,
FLEX_DIRECTION,
OVERFLOW_WRAP,
} from '../../../../helpers/constants/design-system';
import { SnapDelineator } from '../snap-delineator';
import { useI18nContext } from '../../../../hooks/useI18nContext';
Expand All @@ -33,6 +34,7 @@ export const UI_MAPPING = {
props: {
variant: TypographyVariant.H3,
fontWeight: FONT_WEIGHT.BOLD,
overflowWrap: OVERFLOW_WRAP.BREAK_WORD,
},
}),
text: (props) => ({
Expand Down

0 comments on commit dce4c6d

Please sign in to comment.