Skip to content

Commit 17867ad

Browse files
committed
WIP
1 parent 59e8a54 commit 17867ad

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ yarn-error.log
88
/templates
99
graphql.config.json
1010
output/*
11+
<<<<<<< Updated upstream
1112
.env
13+
=======
14+
.env*
15+
!.env.template
16+
>>>>>>> Stashed changes
1217
secrets
1318
/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)