Skip to content

Commit

Permalink
controls cf #29
Browse files Browse the repository at this point in the history
  • Loading branch information
jbdesbas committed Aug 8, 2024
1 parent f9713aa commit c69bc66
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
24 changes: 24 additions & 0 deletions src/components/Control/Control.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Layout } from "antd"
import { CSSProperties, ReactNode } from "react"

const {Header} = Layout

interface IControlProps {
children: ReactNode;
style?:CSSProperties
}

/*
* Composant destiné à recevoir un Form avec les contrôles de la page
*/
const Control: React.FC<IControlProps> = ({ children, style = {} }) => {
return (
<Header
style={{padding: 12, position: "sticky", top: 0, zIndex: 1, backgroundColor: "#fff", ...style}}
>
{children}
</Header>
);
};

export default Control;
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import LoadingContainer from "./components/LoadingContainer/LoadingContainer"
import FlipCard from "./components/FlipCard/FlipCard"
import Attribution from "./components/Attributions/Attributions"
import NextPrevSelect from "./components/NextPrevSelect/NextPrevSelect"
import Control from "./components/Control/Control";

export { KeyFigure, DashboardElement, LoadingContainer, FlipCard, Attribution, NextPrevSelect }
export { KeyFigure, DashboardElement, LoadingContainer, FlipCard, Attribution, NextPrevSelect, Control }


// DataProviders
Expand All @@ -28,4 +29,4 @@ export {WfsProvider, DatafairProvider}


// Types
export type { SimpleRecord } from "./types"
export type { SimpleRecord } from "./types"

0 comments on commit c69bc66

Please sign in to comment.