Middleware and iframe updates
This commit is contained in:
parent
d7624d723f
commit
ba04aa108c
29 changed files with 69 additions and 4128 deletions
|
|
@ -10,9 +10,13 @@ export const ZammadWrapper: FC<ZammadWrapperProps> = ({
|
|||
path,
|
||||
hideSidebar = true,
|
||||
}) => {
|
||||
const origin = typeof window !== 'undefined' && window.location.origin
|
||||
? window.location.origin
|
||||
: '';
|
||||
const [display, setDisplay] = useState("hidden");
|
||||
const url = `https://redaranj-bookish-tribble-56jwjx5wh4j4w-8003.preview.app.github.dev/zammad${path}`;
|
||||
console.log({ base: process.env.LINK_URL, path, url })
|
||||
const url = `${origin}/zammad${path}`;
|
||||
console.log({ origin, path, url });
|
||||
|
||||
return (
|
||||
< Iframe
|
||||
id="link"
|
||||
|
|
@ -20,8 +24,7 @@ export const ZammadWrapper: FC<ZammadWrapperProps> = ({
|
|||
width="100%"
|
||||
height="100%"
|
||||
frameBorder={0}
|
||||
styles={{ display }
|
||||
}
|
||||
styles={{ display }}
|
||||
onLoad={() => {
|
||||
const linkElement = document.querySelector("iframe");
|
||||
if (
|
||||
|
|
@ -43,8 +46,10 @@ export const ZammadWrapper: FC<ZammadWrapperProps> = ({
|
|||
linkElement.contentDocument.querySelector(".sidebar").style =
|
||||
"display: none";
|
||||
}
|
||||
|
||||
setDisplay("inherit");
|
||||
}
|
||||
setDisplay("inherit");
|
||||
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue