Skip to content

Commit

Permalink
Minor tweaks ui
Browse files Browse the repository at this point in the history
  • Loading branch information
zeikar committed Dec 27, 2023
1 parent 10073ab commit a8e1802
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/pages/content/components/Demo/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ import IFrame from "../iframe";
import Header from "./header";

export default function App() {
const [iframeRendered, setIframeRendered] = useState(false);
const [shown, setShown] = useState(false);
const [url, setUrl] = useState("");

function updatePage(url) {
if (!iframeRendered) {
setIframeRendered(true);
}
setShown((prevShown) => !prevShown);
setUrl(url);
}
Expand Down Expand Up @@ -35,7 +39,7 @@ export default function App() {
return (
<div className={`commentarium-view ${shown ? "open" : ""}`}>
<Header onClick={() => setShown(false)} />
<IFrame url={url} />
{iframeRendered && <IFrame url={url} />}
</div>
);
}
4 changes: 3 additions & 1 deletion src/pages/content/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
flex-direction: row;
justify-content: space-between;
width: 100%;
padding: 8px;
max-width: 100%;
padding: 0.5rem 0rem;
border-bottom: 1px solid #ccc;
}

Expand All @@ -71,6 +72,7 @@
border: none;
cursor: pointer;
outline: none;
padding-left: 0.5rem;
width: 30px;
height: 30px;
}

0 comments on commit a8e1802

Please sign in to comment.