|
1 |
| -import React, { useLayoutEffect } from "react"; |
2 |
| -import { |
3 |
| - disableSidebarForRoute, |
4 |
| - setNotificationPlatform, |
5 |
| - PLATFORM, |
6 |
| -} from "@topcoder/micro-frontends-navbar-app"; |
| 1 | +import React, { useEffect } from "react"; |
7 | 2 | import { VANILLA_EMBED_JS } from "./constants";
|
8 | 3 | import "styles/global.scss";
|
9 | 4 |
|
10 | 5 | export default function Root() {
|
11 |
| - useLayoutEffect(() => { |
12 |
| - // disableSidebarForRoute(`${APP_BASE_PATH}/*`); |
13 |
| - // setNotificationPlatform(PLATFORM.TAAS); |
| 6 | + useEffect(() => { |
| 7 | + // embed.js |
| 8 | + const script = document.createElement("script"); |
| 9 | + script.src = VANILLA_EMBED_JS; |
| 10 | + script.async = true; |
| 11 | + document.body.appendChild(script); |
| 12 | + return () => { |
| 13 | + document.body.removeChild(script); |
| 14 | + }; |
14 | 15 | }, []);
|
15 | 16 |
|
16 | 17 | return (
|
17 | 18 | <>
|
18 |
| - <script type="text/javascript" src={VANILLA_EMBED_JS}></script> |
| 19 | + <div id="vanilla-comments"></div> |
19 | 20 | <noscript>
|
20 | 21 | Please enable JavaScript to view the
|
21 | 22 | <a href="http://vanillaforums.com/?ref_noscript">
|
22 | 23 | discussions powered by Vanilla.
|
23 | 24 | </a>
|
24 | 25 | </noscript>
|
25 |
| - <div class="vanilla-credit"> |
26 |
| - <a class="vanilla-anchor" href="http://vanillaforums.com"> |
27 |
| - Discussions by <span class="vanilla-logo">Vanilla</span> |
| 26 | + <div className="vanilla-credit"> |
| 27 | + <a className="vanilla-anchor" href="http://vanillaforums.com"> |
| 28 | + Discussions by <span className="vanilla-logo">Vanilla</span> |
28 | 29 | </a>
|
29 | 30 | </div>
|
30 | 31 | </>
|
|
0 commit comments