Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 581cb74

Browse files
authored
Merge pull request #192 from sanjam-deriv/favicon
2 parents 8bef163 + e6a57c3 commit 581cb74

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/components/Header/__tests__/Header.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ import React from 'react';
22
import { Header } from '..';
33
import { render, screen } from '@testing-library/react';
44

5+
beforeAll(() => {
6+
const script_tag = document.createElement('div');
7+
script_tag.setAttribute('id', '__docusaurus');
8+
document.body.appendChild(script_tag);
9+
});
10+
511
describe('Header', () => {
612
it('should be able to render the header with links', () => {
713
render(<Header />);

src/components/Header/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
import React from 'react';
1+
import React, { useEffect } from 'react';
22
import styles from './Header.module.scss';
33
import Link from '@docusaurus/Link';
44
export const Header = () => {
5+
useEffect(() => {
6+
const s = document.createElement('script');
7+
s.src =
8+
'https://survey.survicate.com/workspaces/83b651f6b3eca1ab4551d95760fe5deb/web_surveys.js';
9+
s.async = true;
10+
const e = document.getElementById('__docusaurus');
11+
e.parentNode.insertBefore(s, e);
12+
}, []);
513
return (
614
<div className={styles.Navtop}>
715
<div className={styles.NavtopContainer}>

0 commit comments

Comments
 (0)