✨(react) add Pagination component
In order to create a DataGrid we first need a fully working pagination component. It comes with multiples working examples in the documentation.
This commit is contained in:
15
apps/demo/src/App.tsx
Normal file
15
apps/demo/src/App.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Button, usePagination, Pagination } from "@openfun/cunningham-react";
|
||||
import React from "react";
|
||||
import { tokens } from "./cunningham-tokens";
|
||||
|
||||
export const App = () => {
|
||||
const pagination = usePagination({ defaultPage: 50, defaultPagesCount: 100 });
|
||||
return (
|
||||
<div className="center">
|
||||
<h1 className="test">Cunningham Demo.</h1>
|
||||
<Button>World best button.</Button>
|
||||
<h3>Primary-500 color is {tokens.theme.colors["primary-500"]}</h3>
|
||||
<Pagination {...pagination} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -1,15 +1,13 @@
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import "./index.scss";
|
||||
import { Button } from "@openfun/cunningham-react";
|
||||
import { tokens } from "./cunningham-tokens";
|
||||
import { CunninghamProvider } from "@openfun/cunningham-react";
|
||||
import { App } from "./App";
|
||||
|
||||
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
|
||||
<React.StrictMode>
|
||||
<div className="center">
|
||||
<h1 className="test">Cunningham Demo.</h1>
|
||||
<Button>World best button.</Button>
|
||||
<h3>Primary-500 color is {tokens.theme.colors["primary-500"]}</h3>
|
||||
</div>
|
||||
<CunninghamProvider>
|
||||
<App />
|
||||
</CunninghamProvider>
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user