Introduce React-Trello in place of React-Kanban
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
38
client/src/components/trello-board/index.jsx
Normal file
38
client/src/components/trello-board/index.jsx
Normal file
@@ -0,0 +1,38 @@
|
||||
import React from "react";
|
||||
|
||||
import Draggable from "./dnd/Draggable.jsx";
|
||||
import Container from "./dnd/Container.jsx";
|
||||
import BoardContainer from "./controllers/BoardContainer.jsx";
|
||||
import Board from "./controllers/Board.jsx";
|
||||
import Lane from "./controllers/Lane.jsx";
|
||||
import deprecationWarnings from "./helpers/deprecationWarnings";
|
||||
import DefaultComponents from "./components";
|
||||
|
||||
import widgets from "./widgets/index";
|
||||
|
||||
import { StyleSheetManager } from "styled-components";
|
||||
import isPropValid from "@emotion/is-prop-valid";
|
||||
|
||||
export { Draggable, Container, BoardContainer, Lane, widgets };
|
||||
|
||||
export { DefaultComponents as components };
|
||||
|
||||
// Enhanced default export using arrow function for simplicity
|
||||
const TrelloBoard = ({ components, ...otherProps }) => {
|
||||
deprecationWarnings(otherProps);
|
||||
|
||||
return (
|
||||
<StyleSheetManager shouldForwardProp={shouldForwardProp}>
|
||||
<Board components={{ ...DefaultComponents, ...components }} {...otherProps} />;
|
||||
</StyleSheetManager>
|
||||
);
|
||||
};
|
||||
|
||||
const shouldForwardProp = (propName, target) => {
|
||||
if (typeof target === "string") {
|
||||
return isPropValid(propName);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
export default TrelloBoard;
|
||||
Reference in New Issue
Block a user