Skip to content

Commit

Permalink
Dev (#694)
Browse files Browse the repository at this point in the history
* ci: add new CI job for testing

* chore: remove unused linting before commit

* ci: update testing CI

* ci: update yarn caching logic

* ci: refacor dependency caching logic in ci files

* ci: update CI trigger time

* docs: update example baseUrl

* fix: demo app can't dislay in doc site

* fix: demo app can't be displayed in doc site.
  • Loading branch information
dohooo authored Oct 5, 2024
1 parent 2faaa71 commit 9b0cf4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions example/app/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ function RootLayoutNav() {
if (IS_WEB && inDoc) {
window.addEventListener("load", () => {
const carouselComponent = document.getElementById("carousel-component");

if (carouselComponent) {
console.log(carouselComponent.offsetHeight);
window.parent.postMessage(
{
type: "carouselHeight",
Expand Down
7 changes: 4 additions & 3 deletions example/website/components/Demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const ResizableIframe: React.FC<ResizableIframeProps> = ({ pagePath }) => {
const handleIframeLoad = () => {
// get carousel-component height by postmessage
window.addEventListener("message", (event) => {
console.log(event);
if (event.data.type === "carouselHeight") {
setCarouselHeight(event.data.height);
setIsLoading(false);
Expand All @@ -24,13 +25,13 @@ const ResizableIframe: React.FC<ResizableIframeProps> = ({ pagePath }) => {
style={{
marginTop: "24px",
width: "100%",
height: carouselHeight ?? 28,
height: carouselHeight ?? 280,
position: "relative",
overflow: "hidden",
transition: "height 0.3s ease-in-out",
}}
>
{isLoading && <div style={{ textAlign: "center" }}>Loading...</div>}
{/* {isLoading && <div style={{ textAlign: "center" }}>Loading...</div>} */}
<iframe
id="carousel-iframe"
onLoad={handleIframeLoad}
Expand All @@ -40,7 +41,7 @@ const ResizableIframe: React.FC<ResizableIframeProps> = ({ pagePath }) => {
height: "100%",
border: "none",
overflow: "hidden",
opacity: isLoading ? 0 : 1,
// opacity: isLoading ? 0 : 1,
}}
></iframe>
</div>
Expand Down

0 comments on commit 9b0cf4d

Please sign in to comment.