-
+
-
-
- {`${slideshowItemIndex + 1} / ${numItems}`}
-
-
-
- {filters.map((filter) => (
-
+
+
+ {`${slideshowItemIndex + 1} / ${numItems}`}
+
+
+
+
+
)
diff --git a/src/pages/view/SlideshowFiltersInfo.js b/src/pages/view/SlideshowFiltersInfo.js
new file mode 100644
index 000000000..c89790553
--- /dev/null
+++ b/src/pages/view/SlideshowFiltersInfo.js
@@ -0,0 +1,80 @@
+import i18n from '@dhis2/d2-i18n'
+import { Layer, Popper } from '@dhis2/ui'
+import PropTypes from 'prop-types'
+import React, { useMemo, useState, useRef } from 'react'
+import { useSelector } from 'react-redux'
+import { sGetNamedItemFilters } from '../../reducers/itemFilters.js'
+import styles from './styles/SlideshowFiltersInfo.module.css'
+
+const popperModifiers = [
+ {
+ name: 'offset',
+ options: {
+ offset: [0, 8],
+ },
+ },
+]
+const FilterSection = ({ name, values }) => (
+
+
{name}
+
+ {values.map((value) => (
+ -
+ {value.name}
+
+ ))}
+
+
+)
+
+FilterSection.propTypes = {
+ name: PropTypes.string,
+ values: PropTypes.arrayOf(PropTypes.shape({ name: PropTypes.string })),
+}
+
+export const SlideshowFiltersInfo = () => {
+ const [isOpen, setIsOpen] = useState(false)
+ const ref = useRef(null)
+ const filters = useSelector(sGetNamedItemFilters)
+ const totalFilterCount = useMemo(
+ () =>
+ filters.reduce((total, filter) => total + filter.values.length, 0),
+ [filters]
+ )
+
+ if (filters.length === 0) {
+ return null
+ }
+
+ return (
+ <>
+
+ {isOpen && (
+
setIsOpen(false)}>
+
+ {filters.map((filter) => (
+
+ ))}
+
+
+ )}
+ >
+ )
+}
diff --git a/src/pages/view/styles/SlideshowControlbar.module.css b/src/pages/view/styles/SlideshowControlbar.module.css
index bee5956c9..3ad2a293a 100644
--- a/src/pages/view/styles/SlideshowControlbar.module.css
+++ b/src/pages/view/styles/SlideshowControlbar.module.css
@@ -6,23 +6,38 @@
justify-content: space-between;
align-items: center;
background-color: black;
- block-size: 40px;
+ padding-inline-start: 4px;
+ padding-inline-end: 4px;
+ z-index: 10;
+}
+.start,
+.middle,
+.end {
+ display: flex;
+ align-items: center;
+ width: calc(100% / 3);
+}
+
+.start {
+ justify-content: start;
+}
+
+.middle {
+ justify-content: center;
}
-.container > :first-child {
- flex-grow: 1;
- flex-basis: 0;
- margin-inline-start: 4px;
+.end {
+ justify-content: end;
}
+
.container button {
color: white;
background-color: #171819;
border-radius: 3px;
border: none;
- inline-size: 32px;
- block-size: 32px;
padding: 4px;
cursor: pointer;
+ flex-grow: 0;
}
.container button:hover {
@@ -32,6 +47,12 @@
.container button:disabled {
cursor: not-allowed;
}
+
+.container button.squareButton {
+ inline-size: 32px;
+ block-size: 32px;
+}
+
.controls {
padding: 4px;
border-radius: 5px;
@@ -39,6 +60,7 @@
align-items: center;
justify-content: center;
}
+
.pageCounter {
font-family: 'Roboto', sans-serif;
font-weight: 400;
@@ -51,20 +73,3 @@
text-align: center;
user-select: none;
}
-
-.filters {
- flex-grow: 1;
- flex-basis: 0;
- list-style-type: none;
- display: flex;
- justify-content: flex-end;
- margin-inline-end: 4px;
- gap: 4px;
-}
-
-.filter {
- padding: 4px;
- border-radius: 3px;
- color: black;
- background-color: #f4f6f8;
-}
diff --git a/src/pages/view/styles/SlideshowFiltersInfo.module.css b/src/pages/view/styles/SlideshowFiltersInfo.module.css
new file mode 100644
index 000000000..23deb876e
--- /dev/null
+++ b/src/pages/view/styles/SlideshowFiltersInfo.module.css
@@ -0,0 +1,30 @@
+.filterButton {
+ padding: 4px;
+ inline-size: auto;
+ border-radius: 3px;
+ color: black;
+ background-color: #f4f6f8;
+}
+
+.popover {
+ border: 1px solid var(--colors-grey400);
+ border-radius: 4px;
+ box-shadow: var(--elevations-e400);
+ padding: var(--spacers-dp8);
+ background-color: var(--colors-white);
+}
+
+.filterSection {
+ margin-block-end: var(--spacers-dp4);
+}
+
+.filterSectionHeader {
+ margin: 0;
+ padding: 0;
+}
+
+.filterSectionList {
+ margin: 0;
+ padding: 0;
+ padding-inline-start: 18px;
+}