first commit
This commit is contained in:
26
components/draughts/DraughtsContext.jsx
Normal file
26
components/draughts/DraughtsContext.jsx
Normal file
@ -0,0 +1,26 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import {
|
||||
DraughtsSettingsProvider,
|
||||
DraughtsSettingsProviderProps,
|
||||
} from './settings/DraughtsSettingsContext';
|
||||
import {
|
||||
DraughtsBoardProvider,
|
||||
DraughtsBoardProviderProps,
|
||||
} from './board/DraughtsBoardContext';
|
||||
import { DraughtsGameProvider } from './game/DraughtsGameContext';
|
||||
|
||||
export function DraughtsProvider(props) {
|
||||
return (
|
||||
<DraughtsSettingsProvider {...props.settings}>
|
||||
<DraughtsBoardProvider {...props.board}>
|
||||
<DraughtsGameProvider>{props.children}</DraughtsGameProvider>
|
||||
</DraughtsBoardProvider>
|
||||
</DraughtsSettingsProvider>
|
||||
);
|
||||
}
|
||||
|
||||
DraughtsProvider.propTypes = {
|
||||
board: PropTypes.shape(DraughtsBoardProviderProps),
|
||||
children: PropTypes.node.isRequired,
|
||||
settings: PropTypes.shape(DraughtsSettingsProviderProps),
|
||||
};
|
||||
Reference in New Issue
Block a user