Skip to content

Commit e7abe4c

Browse files
committed
WIP
1 parent 1492f1c commit e7abe4c

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@ yarn-error.log
88
/templates
99
graphql.config.json
1010
output/*
11+
<<<<<<< Updated upstream
1112
.env
13+
<<<<<<< Updated upstream
1214
.env.local
15+
=======
16+
=======
17+
.env*
18+
!.env.template
19+
>>>>>>> Stashed changes
20+
>>>>>>> Stashed changes
1321
secrets
1422
/test/results/*

src/components/inlineSVG.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import React, { useRef, useEffect } from 'react';
22
import PropTypes from 'prop-types';
3+
import omit from 'lodash/omit';
34

4-
const InlineSVG = ({ src, ...otherProps }) => {
5+
const InlineSVG = props => {
56
return (
6-
<div
7-
// eslint-disable-next-line react/no-danger
8-
dangerouslySetInnerHTML={{ __html: src }}
9-
{...otherProps}
10-
/>
7+
<div {...omit(props, 'src')}>
8+
<iframe
9+
title="SVG"
10+
srcDoc={`<html><body>${props.src}</body></html>`}
11+
style={{ border: 'none', width: '100%', height: '100%' }}
12+
/>
13+
</div>
1114
);
1215
};
1316

0 commit comments

Comments
 (0)