Skip to content

Commit

Permalink
Merge branch 'main' into custom-view
Browse files Browse the repository at this point in the history
anadis504 committed Mar 28, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 96128aa + 86cf039 commit cc3ca26
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/pages/iframe.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { css } from "@emotion/css"
import { useRouter } from "next/router"
import React, { useCallback, useState } from "react"
import ReactDOM from "react-dom"

@@ -54,13 +52,6 @@ export type Url = {
const Iframe: React.FC<React.PropsWithChildren<unknown>> = () => {
const [state, setState] = useState<State | null>(null)

const router = useRouter()
const rawMaxWidth = router?.query?.width
let maxWidth: number | null = 500
if (rawMaxWidth) {
maxWidth = Number(rawMaxWidth)
}

const callback = useCallback((messageData: unknown, port: MessagePort) => {
//const messageData = customViewState as SetStateMessage
if (isSetStateMessage(messageData)) {
@@ -124,13 +115,7 @@ const Iframe: React.FC<React.PropsWithChildren<unknown>> = () => {

return (
<HeightTrackingContainer port={port}>
<div
className={css`
width: 100%;
${maxWidth && `max-width: ${maxWidth}px;`}
margin: 0 auto;
`}
>
<div>
<Renderer port={port} setState={setState} state={state} />
</div>
</HeightTrackingContainer>

0 comments on commit cc3ca26

Please sign in to comment.