Skip to content

Commit

Permalink
add isPrint missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
laszlocseh committed Mar 6, 2024
1 parent 4d07b9a commit d995789
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/actions/print.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Print action.
* @module actions/print
*/

import { SET_ISPRINT } from '@eeacms/volto-eea-website-theme/constants/ActionTypes';

export const setIsPrint = (data) => {
return {
type: SET_ISPRINT,
payload: data,
};
};
6 changes: 6 additions & 0 deletions src/constants/ActionTypes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Action types.
* @module constants/ActionTypes
*/

export const SET_ISPRINT = 'SET_ISPRINT';
1 change: 1 addition & 0 deletions src/reducers/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export print from './print';
21 changes: 21 additions & 0 deletions src/reducers/print.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Print reducer.
* @module reducers/print
*/

import { SET_ISPRINT } from '@eeacms/volto-eea-website-theme/constants/ActionTypes';

const initialState = {
isPrint: false,
};

export default function print(state = initialState, action) {
if (action.type === SET_ISPRINT) {
return {
...state,
isPrint: action.payload,
};
} else {
return state;
}
}

0 comments on commit d995789

Please sign in to comment.