From 0a6a7fb9b49a2180a68f6c96815ebd9b7f6b5ab7 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 8 Sep 2020 16:05:54 +0200 Subject: section 2 carousel --- animism-align/frontend/app/utils/viewer.utils.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 animism-align/frontend/app/utils/viewer.utils.js (limited to 'animism-align/frontend/app/utils/viewer.utils.js') diff --git a/animism-align/frontend/app/utils/viewer.utils.js b/animism-align/frontend/app/utils/viewer.utils.js new file mode 100644 index 0000000..b61f998 --- /dev/null +++ b/animism-align/frontend/app/utils/viewer.utils.js @@ -0,0 +1,14 @@ +import { store } from 'app/store' + +export const getSection = index => { + const { sections } = store.getState().viewer + return sections[index] +} + +export const getNextSection = section => { + const { sections } = store.getState().viewer + if (section.index === sections.length - 1) { + return null + } + return sections[section.index + 1] +} -- cgit v1.2.3-70-g09d2