react-layout-sdk 1.1.14 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/init.js +2 -2
- package/package.json +1 -1
package/bin/init.js
CHANGED
|
@@ -146,9 +146,9 @@ async function main() {
|
|
|
146
146
|
const footerContent = `import React from 'react';\n\nexport default function Footer(props: any) {\n const text = props?.text || '© 2026 JD Layout';\n return (\n <footer style={{ padding: '20px', background: '#333', color: '#fff', textAlign: 'center', marginTop: '40px' }}>\n <p style={{ margin: 0 }}>{text}</p>\n </footer>\n );\n}\n`;
|
|
147
147
|
await writeWithPrompt(footerPath, footerContent, 'components/Footer.tsx');
|
|
148
148
|
|
|
149
|
-
//
|
|
149
|
+
// 4. Create Layout.tsx
|
|
150
150
|
const layoutPath = path.join(basePath, 'Layout.tsx');
|
|
151
|
-
const layoutContent = `import React from 'react';\n\nexport default function Layout({ layoutData, placeholderComponent: Placeholder }: any) {\n const { route } = layoutData.strapi;\n return (\n <div
|
|
151
|
+
const layoutContent = `import React from 'react';\n\nexport default function Layout({ layoutData, placeholderComponent: Placeholder }: any) {\n const { route } = layoutData.strapi;\n\n return (\n <>\n <header>\n <div id="header">\n {route && <Placeholder name="header" rendering={route.placeholders.header || []} />}\n </div>\n </header>\n\n <main style={{ minHeight: 'calc(100vh - 100px)' }}>\n <div id="content" className="pageContent">\n {route && <Placeholder name="main" rendering={route.placeholders.main || []} />}\n </div>\n </main>\n\n <footer>\n <div id="footer">\n {route && <Placeholder name="footer" rendering={route.placeholders.footer || []} />}\n </div>\n </footer>\n </>\n );\n}\n`;
|
|
152
152
|
await writeWithPrompt(layoutPath, layoutContent, 'Layout.tsx (Root/src level)');
|
|
153
153
|
|
|
154
154
|
if (hasAppRouter) {
|