Skip to content

Commit

Permalink
[keymanager][devenv] several style fixes, previous positioning broke …
Browse files Browse the repository at this point in the history
…the app layout, also some cosmetic fixes
  • Loading branch information
edda committed Jun 14, 2022
1 parent a7a6529 commit 2f7ec48
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions apps/keymanager/src/DevEnv.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ const DevEnv = () => {
for (let key in dataset) {
element.setAttribute(key, dataset[key])
}

document.body.appendChild(element)
let wrapper = document.createElement("div")
wrapper.appendChild(element)
document.body.appendChild(wrapper)

return () => {
console.log(`Dynamic Script Removed: ${url}`)
Expand All @@ -64,16 +65,15 @@ const DevEnv = () => {
}, [])

return (
<>
<div className="flex flex-col" style={showDetails ? {height: "100vh"} : {}}>
{token ? (
<div style={{ textAlign: "right" }}>
Wellcome {token.user.name}{" "}
<div className="flex gap-2 items-center p-2 ml-auto">
Welcome {token.user.name}{" "}
<Button variant="subdued" onClick={logout} size="small">
Logout
</Button>{" "}
<Button
size="small"
variant="primary"
onClick={() =>
showDetails ? setShowDetails(false) : setShowDetails(true)
}
Expand All @@ -87,21 +87,18 @@ const DevEnv = () => {
</Button>
)}
{showDetails && (
<>
<br />
<pre tw="block m-0 p-0 overflow-auto text-white text-sm bg-gray-800">
{JSON.stringify(token, null, 2)}
</pre>
</>
<pre className="overflow-y-auto grow">
{JSON.stringify(token, null, 2)}
</pre>
)}
</>
</div>
)
}

const dev = document.createElement("div")
dev.setAttribute(
"style",
"position: absolute; right: 0px; top: 0px; z-index: 1000; padding: 15px;"
"position: absolute; right: 0px; top: 0px; z-index: 1000;"
)
document.body.prepend(dev)

Expand Down

0 comments on commit 2f7ec48

Please sign in to comment.