Skip to content

Commit 3470abf

Browse files
committed
feat: scroll-implementation
1 parent 07cc3b4 commit 3470abf

File tree

5 files changed

+155
-6
lines changed

5 files changed

+155
-6
lines changed

playground/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function App() {
99

1010
return (
1111
<div className="min-w-full min-h-screen flex flex-col">
12-
<header className="w-full bg-black text-white mb-10">
12+
<header className="w-full bg-black text-white mb-10 fixed top-0 left-0">
1313
<nav className="max-w-md container mx-auto py-4 flex flex-row gap-8 justify-between">
1414
<h1 className="font-extrabold">
1515
<Link href="https://github.com/g4rcez/brouther">Brouther</Link>
@@ -45,7 +45,7 @@ function App() {
4545
</ul>
4646
</nav>
4747
</header>
48-
<div className="w-full container max-w-lg mx-auto px-4 md:px-0">
48+
<div className="w-full container max-w-lg mx-auto mt-20 px-4 md:px-0">
4949
<main className="page">
5050
<Outlet />
5151
</main>

playground/src/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
html, body, #root {
66
@apply min-w-full min-h-screen;
7-
}
7+
}

playground/src/main.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ import App from "./App";
44
import { Brouther } from "../../src";
55
import { router } from "./routes";
66
import "./index.css";
7+
import { Scroll } from "../../src/brouther/scroll";
78

89
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
910
<React.StrictMode>
1011
<React.Suspense fallback={<div>Loading...</div>}>
1112
<Brouther ErrorElement={<p>Error</p>} config={router.config}>
12-
<App />
13+
<Scroll behavior="smooth">
14+
<App />
15+
</Scroll>
1316
</Brouther>
1417
</React.Suspense>
1518
</React.StrictMode>

0 commit comments

Comments
 (0)