mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-29 12:10:24 +00:00
Initial commit of eigent-main
This commit is contained in:
commit
723df5a03e
1144 changed files with 103478 additions and 0 deletions
51
package/@stackframe/react/dist/esm/components/elements/maybe-full-page.js
vendored
Normal file
51
package/@stackframe/react/dist/esm/components/elements/maybe-full-page.js
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
"use client";
|
||||
"use client";
|
||||
|
||||
// src/components/elements/maybe-full-page.tsx
|
||||
import { useId } from "react";
|
||||
import { SsrScript } from "./ssr-layout-effect";
|
||||
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
||||
function MaybeFullPage({
|
||||
children,
|
||||
fullPage
|
||||
}) {
|
||||
const uniqueId = useId();
|
||||
const id = `stack-full-page-container-${uniqueId}`;
|
||||
const scriptString = `(([id]) => {
|
||||
const el = document.getElementById(id);
|
||||
if (!el) {
|
||||
// component is not full page
|
||||
return;
|
||||
}
|
||||
const offset = el.getBoundingClientRect().top + document.documentElement.scrollTop;
|
||||
el.style.minHeight = \`calc(100vh - \${offset}px)\`;
|
||||
})(${JSON.stringify([id])})`;
|
||||
if (fullPage) {
|
||||
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
||||
/* @__PURE__ */ jsx(
|
||||
"div",
|
||||
{
|
||||
suppressHydrationWarning: true,
|
||||
id,
|
||||
style: {
|
||||
minHeight: "100vh",
|
||||
alignSelf: "stretch",
|
||||
flexGrow: 1,
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
alignItems: "center"
|
||||
},
|
||||
className: "stack-scope",
|
||||
children
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ jsx(SsrScript, { script: scriptString })
|
||||
] });
|
||||
} else {
|
||||
return /* @__PURE__ */ jsx(Fragment, { children });
|
||||
}
|
||||
}
|
||||
export {
|
||||
MaybeFullPage
|
||||
};
|
||||
//# sourceMappingURL=maybe-full-page.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue