Skip to content

Commit be17350

Browse files
authored
Merge pull request #637 from AppQuality/fix-newline-finding
Fix newline finding
2 parents ca2dece + 4da7401 commit be17350

File tree

2 files changed

+10
-34
lines changed

2 files changed

+10
-34
lines changed

src/pages/Campaign/useWidgets/Experience/widgets/Insights/InsightCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { SpecialCard } from '@appquality/unguess-design-system';
2-
import styled from 'styled-components';
32
import { useTranslation } from 'react-i18next';
43
import { appTheme } from 'src/app/theme';
54
import { GetCampaignsByCidUxApiResponse } from 'src/features/api';
5+
import styled from 'styled-components';
66
import { getClusterTag, getSeverityIcon, getSeverityTag } from './utils';
77

88
export const CardFooter = styled(SpecialCard.Footer)`
@@ -35,7 +35,7 @@ const InsightCard = ({
3535
<SpecialCard.Header.Title style={{ marginBottom: appTheme.space.xs }}>
3636
{insight.title}
3737
</SpecialCard.Header.Title>
38-
{insight.description}
38+
<div style={{ whiteSpace: 'pre-wrap' }}>{insight.description}</div>
3939
</SpecialCard.Header>
4040
<CardFooter justifyContent="start">
4141
{getClusterTag(insight.cluster, t)}

src/pages/Campaign/useWidgets/Experience/widgets/Insights/Lightbox.tsx

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
import {
2-
// Button,
32
Lightbox,
43
MD,
4+
Player,
55
Slider,
66
Span,
77
XL,
8-
Player,
98
} from '@appquality/unguess-design-system';
9+
import { t } from 'i18next';
1010
import { useCallback, useRef } from 'react';
11-
import styled from 'styled-components';
12-
import useWindowSize from 'src/hooks/useWindowSize';
11+
import { Trans } from 'react-i18next';
1312
import { appTheme } from 'src/app/theme';
1413
import { GetCampaignsByCidUxApiResponse } from 'src/features/api';
15-
import { t } from 'i18next';
16-
// import { ReactComponent as DownloadIcon } from 'src/assets/icons/download-stroke.svg';
17-
import { Trans } from 'react-i18next';
18-
import {
19-
getClusterName,
20-
// getClusterTag,
21-
getSeverityTag,
22-
} from './utils';
14+
import useWindowSize from 'src/hooks/useWindowSize';
15+
import styled from 'styled-components';
16+
import { getClusterName, getSeverityTag } from './utils';
2317

2418
const LightboxHeader = styled(Lightbox.Header)`
2519
display: flex;
@@ -120,29 +114,11 @@ const InsightLightbox = ({
120114
'__CAMPAIGN_PAGE_INSIGHTS_LIGHTBOX_DETAILS_LINKED_INSIGHT_LABEL'
121115
)}
122116
</MD>
123-
<MD>{insight.description}</MD>
117+
<MD style={{ whiteSpace: 'pre-wrap' }}>{insight.description}</MD>
124118
</Lightbox.Body.Details>
125119
)}
126120
</Lightbox.Body>
127-
{/* TODO: check how to download the trimmed video, not the full media url 📦📦📦 */}
128-
<Lightbox.Footer>
129-
{/* <Button
130-
isBasic
131-
onClick={() => {
132-
if (items)
133-
if (currentIndex in items) {
134-
const media = items[currentIndex as number];
135-
// eslint-disable-next-line security/detect-non-literal-fs-filename
136-
window.open(media.url, '_blank');
137-
}
138-
}}
139-
>
140-
<Button.StartIcon>
141-
<DownloadIcon />
142-
</Button.StartIcon>
143-
{t('__BUGS_PAGE_BUG_DETAIL_ATTACHMENTS_DOWNLOAD_BUTTON')}
144-
</Button> */}
145-
</Lightbox.Footer>
121+
<Lightbox.Footer />
146122
<Lightbox.Close aria-label="Close insight lightbox" />
147123
</Lightbox>
148124
);

0 commit comments

Comments
 (0)