forked from novuhq/novu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(web): echo terminal not working in docs modal (novuhq#5875)
- Loading branch information
1 parent
e7360d6
commit c7c9266
Showing
5 changed files
with
37 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { DOMAttributes } from 'react'; | ||
|
||
type CustomElement<T> = Partial<T & DOMAttributes<T> & { children: any }>; | ||
|
||
declare global { | ||
// eslint-disable-next-line @typescript-eslint/no-namespace | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
['nv-echo-terminal']: CustomElement<any>; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { useEffect } from 'react'; | ||
|
||
export const useEchoTerminalScript = () => { | ||
useEffect(() => { | ||
if (!document.getElementById('echo-terminal-loader')) { | ||
const script = document.createElement('script'); | ||
script.src = 'https://cdn.jsdelivr.net/gh/novuhq/docs/echo-terminal.min.js'; | ||
script.id = 'echo-terminal-loader'; | ||
document.body.appendChild(script); | ||
} | ||
}, []); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters