diff --git a/examples/with-ssr-modal/.gitignore b/examples/with-ssr-modal/.gitignore new file mode 100644 index 000000000..6680baa7b --- /dev/null +++ b/examples/with-ssr-modal/.gitignore @@ -0,0 +1,4 @@ +build +node_modules +out +.vercel diff --git a/examples/with-ssr-modal/README.md b/examples/with-ssr-modal/README.md new file mode 100644 index 000000000..59042885e --- /dev/null +++ b/examples/with-ssr-modal/README.md @@ -0,0 +1,7 @@ +# with-ssr-modal + +Example controlling the open/close rendering of a modal with server code only (server action + SSR with streaming). + +```bash +bun create brisa --example with-ssr-modal +``` diff --git a/examples/with-ssr-modal/bunfig.toml b/examples/with-ssr-modal/bunfig.toml new file mode 100644 index 000000000..69803a7a9 --- /dev/null +++ b/examples/with-ssr-modal/bunfig.toml @@ -0,0 +1,2 @@ +[test] +preload = "brisa/test" \ No newline at end of file diff --git a/examples/with-ssr-modal/package.json b/examples/with-ssr-modal/package.json new file mode 100644 index 000000000..7dc39ed3b --- /dev/null +++ b/examples/with-ssr-modal/package.json @@ -0,0 +1,20 @@ +{ + "name": "with-ssr-modal", + "module": "src/pages/index.tsx", + "type": "module", + "example-category": "basics", + "webTitle": "Server-Side Dialog Management", + "scripts": { + "dev": "brisa dev", + "dev:debug": "brisa dev --debug", + "build": "brisa build", + "start": "brisa start" + }, + "dependencies": { + "brisa": "0.2.1-canary.2" + }, + "devDependencies": { + "@types/bun": "latest", + "typescript": "latest" + } +} diff --git a/examples/with-ssr-modal/src/components/footer.tsx b/examples/with-ssr-modal/src/components/footer.tsx new file mode 100644 index 000000000..d61deb5f8 --- /dev/null +++ b/examples/with-ssr-modal/src/components/footer.tsx @@ -0,0 +1,19 @@ +export default function Footer() { + return ( + + ); +} diff --git a/examples/with-ssr-modal/src/components/navigation.tsx b/examples/with-ssr-modal/src/components/navigation.tsx new file mode 100644 index 000000000..eb11e0eb8 --- /dev/null +++ b/examples/with-ssr-modal/src/components/navigation.tsx @@ -0,0 +1,25 @@ +export default function Nav() { + return ( + + ); +} diff --git a/examples/with-ssr-modal/src/layout/index.tsx b/examples/with-ssr-modal/src/layout/index.tsx new file mode 100644 index 000000000..65a4edb6c --- /dev/null +++ b/examples/with-ssr-modal/src/layout/index.tsx @@ -0,0 +1,36 @@ +import Nav from '@/components/navigation'; +import Footer from '@/components/footer'; + +import '@/styles/style.css'; +import '@/styles/nav.css'; +import '@/styles/footer.css'; + +export default function Layout({ children }: { children: JSX.Element }) { + return ( + + + Brisa + + + + + + + + +
+
+
{children}
+